[comp.windows.open-look] Scrolling Lists and their fonts

chris@herbert.uucp (Chris Greve) (04/06/91)

Hi,

I am having trouble with Scrolling Lists under XView.  I need a
fixedwidth font and the code below is not working.  I have looked in
all of the XView programs that I have source to, and none of them sets
the list font.

Thanks to anyone you can steer me in the correct direction.  Please use
the email address below when replying.


-------------------------------------------------------------------------------
Chris Greve  --  EG&G, Energy Measurements  --  Remote Sensing Laboratory

UUCP:   {...}!sun!sunvegas!herbert!chris
        {...}!uunet!rsl-egg!chris


Example Code:

    font = (Xv_Font)xv_find(frame, FONT,
                FONT_FAMILY, FONT_FAMILY_DEFAULT_FIXEDWIDTH,
		NULL);
    xv_set(plist, PANEL_LIST_FONT, font, NULL);

harry@dustbin.uk.sun.com (Harry Protoolis - Sun EHQ) (04/06/91)

In article <1991Apr5.170330.5936@herbert.uucp>, chris@herbert.uucp (Chris Greve) writes:
|> 
|> Hi,
|> 
|> I am having trouble with Scrolling Lists under XView.  I need a
|> fixedwidth font and the code below is not working.  I have looked in
|> all of the XView programs that I have source to, and none of them sets
|> the list font.

stuff deleted ...

I am posting this 'cause it's the n'th time I have answered this question
(after asking it myself in a similar forum ... :-))

PANEL_LIST_FONT works on individual list entries, not on the whole list. You
must set it for each list item. I suspect this is a bug.

Try this everywhere you create a list entry,

given:
     font = (Xv_Font)xv_find(frame, FONT,
                 FONT_FAMILY, FONT_FAMILY_DEFAULT_FIXEDWIDTH,
 		NULL);
 		
each entry creation becomes:     
     xv_set(plist, PANEL_LIST_INSERT, row,
                PANEL_LIST_FONT, row, font,
                XV_NULL);
                
This is a pain, but it does work.

Hope this helps,
Harry

-- 
(smart Internet mailers) harry.protoolis@uk.sun.com
(smart JANET mailers) harry.protoolis@sun-microsystems.co.uk
(dumb uucp mailers) ...!sun!sunuk!harry.protoolis

'When I give food to the poor they call me a saint.
 When I ask why the poor have no food they call me a communist.'
         - Dom Helder Camara

warsaw@nlm.nih.gov (Barry A. Warsaw) (04/08/91)

	Harry> PANEL_LIST_FONT works on individual list entries, not on
	Harry> the whole list. You must set it for each list item. I
	Harry> suspect this is a bug.

The parallel list PANEL_LIST_FONTS also works but is buggy.  You
cannot have an abbreviated list.  You must have a font entry for each
item.  In other words:

xv_create( panel, PANEL_LIST,
	PANEL_LIST_STRINGS, "One", "Two", "Three", 0,
	PANEL_LIST_FONTS,   lucida, 0,
	NULL );

doesn't work correctly but:

xv_create( panel, PANEL_LIST,
	PANEL_LIST_STRINGS, "One", "Two", "Three", 0,
	PANEL_LIST_FONTS,   lucida, lucida, lucida, 0,
	NULL );


does.

-Barry

NAME:  Barry A. Warsaw         INET: warsaw@nlm.nih.gov
TELE:  (301) 496-1936          UUCP: uunet!nlm.nih.gov!warsaw