Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!sun-barr!newstop!male!silverwood!helvie From: helvie@EBay.Sun.COM (Fred Helvie) Newsgroups: comp.windows.open-look Subject: Re: Changing fonts in a scrolling list Message-ID: Date: 16 May 91 19:39:01 GMT References: <589@rome.gdwb.oz.au> Sender: news@male.EBay.Sun.COM Lines: 68 csb@gdwb.oz.au (Craig Bishop) writes: >Is this possible? >There is a PANEL_LIST_FONT setting for scolling lists but it >isn't documented anywhere in the Xview book or in suns >documentation. >I have text which I want to line up correctly and I want to use >a fixed font in thescrolling list. The default font for the list item is inherited from the panel, so if one font is desired, create the panel with a font: f1 = xv_find( frame, FONT, FONT_NAME, "screen-bold-18", 0 ); panel = xv_create(frame, PANEL, XV_FONT, f1, 0); list_item = xv_create(panel, PANEL_LIST, PANEL_CHOOSE_ONE, FALSE, PANEL_LIST_WIDTH, 100, PANEL_LABEL_STRING, "List Item", PANEL_LIST_DISPLAY_ROWS, 3, PANEL_LIST_STRINGS, "One", "Two", "Three", 0, 0); If you desire different fonts for each item in the list: f1 = xv_find( frame, FONT, FONT_NAME, "screen-bold-12", 0 ); f2 = xv_find( frame, FONT, FONT_NAME, "lucidasans-italic-10", 0 ); f3 = xv_find( frame, FONT, FONT_NAME, "courier-14", 0 ); list_item = xv_create(panel, PANEL_LIST, PANEL_CHOOSE_ONE, FALSE, PANEL_LIST_WIDTH, 100, PANEL_LABEL_STRING, "List Item", PANEL_LIST_DISPLAY_ROWS, 3, PANEL_LIST_STRINGS, "One", "Two", "Three", 0, PANEL_LIST_FONTS, f1, f2, f3, 0, 0); The attribute: PANEL_LIST_FONT, index, font, is for setting a font on a single list item. The xview header files are always the "definitive" reference - xview/panel.h :^) Fred Helvie Sun Education - Milpitas, CA - USA