Xref: utzoo comp.windows.x:37232 comp.windows.open-look:1600 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!oakhill!nddsun1!soleil.sps.mot.com!cowan From: cowan@soleil.sps.mot.com (Andrew H Cowan) Newsgroups: comp.windows.x,comp.windows.open-look Subject: Need help with Xview PANEL_CHOICE_ITEM fonts. Message-ID: <1024@nddsun1.sps.mot.com> Date: 5 Jun 91 20:53:02 GMT Sender: root@nddsun1.sps.mot.com Reply-To: cowan@soleil.sps.mot.com (Andrew H Cowan) Followup-To: comp.windows.x Organization: Motorola, Inc., ASIC Div., Chandler, AZ. Lines: 97 Can't two panels in an Xview frame have different fonts? In the following program I'm trying to get two selection choice panel items in the same frame to come up in two different fonts. I've tried all manner of setting "PANEL_FONT", and "PANEL_CHOICE_FONTS", using multiple panels, etc., to no avail. Can anyone explain to me what I'm doing wrong? Can anyone explain how I can get a list of choices to come up in a small font. (I have a need to show a LOT of selection choices on the screen, thus a small font is required.) (The following code, compiles and executes on a Sun 4 SunOS Release 4.1.1 system.) ** / \ ** ** ** | | ** ** ** ** \___/ ** ** ******** ** ** ****** __ ** **** ** \_/oo\_/ **** ** ........**..........\||/................****.........**........... Andy Cowan...........||.............cowan@soleil.sps.mot.com...... ================= cut here ===================== /* This program does nothing more than: 1) creates a frame, 2) creates two panels in the frame, 3) the first panel gets a quit button and a list of choice items. 4) creates a 5x8 font, 5) the second panel gets another list of choice items, both the panel and the choices are set to use the 5x8 font. To compile: cc -g -I/usr/openwin_2/sun4/include -target sun4 -o test \ -L/usr/openwin_2/sun4/lib -lolgx -lxview -lX11 thisfile.c -L/usr/openwin_2/sun4/lib -lxview -lX11 -lolgx thisfile.c */ #include #include #include #include Frame Toplevel; Panel PanelOne; Panel PanelTwo; void quit(){ xv_destroy_safe( Toplevel ); } main(argc, argv) int argc; char *argv[]; { Xv_font font; Xv_font font2; xv_init( XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL ); Toplevel = (Frame) xv_create( NULL, FRAME, XV_HEIGHT, 100, NULL ); /* Create a font to use in the first panel */ font = (Xv_Font )xv_find( Toplevel, FONT, FONT_NAME, "5x8", NULL ); /* Create a panel for Quit button and first selection choices. */ PanelOne = (Panel) xv_create( Toplevel, PANEL, PANEL_FONT, font, NULL ); (void)xv_create( PanelOne, PANEL_BUTTON, PANEL_LABEL_STRING, "Quit", PANEL_NOTIFY_PROC, quit, NULL ); (void)xv_create( PanelOne, PANEL_CHOICE, PANEL_CHOICE_STRINGS , "These","should","be","in","5x8","font", NULL, NULL); /* Create a font to use in the second panel */ font2 = (Xv_Font )xv_find( Toplevel, FONT, FONT_NAME, "7x13", NULL ); /* Create a panel for second bunch of selection choices. */ PanelTwo = (Panel) xv_create( Toplevel, PANEL, XV_Y, 50, PANEL_FONT, font2, NULL ); (void)xv_create( PanelTwo, PANEL_CHOICE, PANEL_CHOICE_STRINGS , "These","should","be","in","7x13","font.","Why","not???", NULL, NULL); window_fit( Toplevel ); xv_main_loop( Toplevel ); }