home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.windows.open-look:3678 alt.toolkits.xview:811
- Path: sparky!uunet!autodesk!dansmith
- From: dansmith@Autodesk.COM (Daniel Smith)
- Newsgroups: comp.windows.open-look,alt.toolkits.xview
- Subject: Re: XView 3: PANEL_FONT for a scrolling list
- Message-ID: <17560@autodesk.COM>
- Date: 1 Sep 92 18:43:50 GMT
- References: <1992Sep1.022032.25886@sq.sq.com>
- Followup-To: comp.windows.open-look
- Organization: Autodesk Inc., Sausalito CA, USA
- Lines: 90
-
- In <1992Sep1.022032.25886@sq.sq.com> lee@sq.sq.com (Liam R. E. Quin) writes:
-
- > OK, how do I set the font for an entire scrolling list in XView 3, not
- > just an item at a time? I can set the font of the parent panel, and this
- > affects the list. I've even tried setting the set_font element in the
- > (private) Panel_list_info struct, but this doesn't work.
-
- Don't think there is way around "an item at a time"...
-
- /* Set the current list string, as well as its proper font. */
- xv_set(listbox->tile.item,
- PANEL_LIST_STRING, i, trunc_str,
- PANEL_LIST_FONT, i, graphfont,
- NULL);
-
- Actually, if you're going to set a lot at once, then perhaps
- you'll go the attr_choice_list route (including code I got from
- someone on the net earlier this year, thanks!)
-
- Attr_avlist create_attr_choice_list();
- Attr_avlist create_attr_scroll_list();
-
- /*
- create_attr_choice_list -> creates and returns an Attr_avlist.
- INPUTS :
- strings -> pointer to a list of strings
- num -> number of strings to put in list
-
- OUTPUTS :
- size -> number of elements in the Attr_avlist
- */
-
- Attr_avlist create_attr_choice_list(strings, num)
- char *strings[];
- int num;
- {
- int i, size, row = 1;
- Attr_avlist list;
-
- size = num + 3;
- list = (Attr_avlist) malloc((unsigned)(size * sizeof(Attr_attribute)));
- list[0] = (Attr_attribute) PANEL_CHOICE_STRINGS;
-
- for (i = 0; i< num; i++, row++)
- list[row] = (Attr_attribute) strings[i];
-
- list[row] = (Attr_attribute) NULL;
- list[row + 1] = (Attr_attribute) NULL;
-
- return list;
- }
-
-
-
-
- Attr_avlist create_attr_scroll_list(strings, num)
- char *strings[];
- int num;
- {
- int i, size, row = 1;
- Attr_avlist list;
-
- size = num + 3;
- list = (Attr_avlist) malloc((unsigned)(size * sizeof(Attr_attribute)));
- list[0] = (Attr_attribute) PANEL_LIST_STRINGS;
-
- for (i = 0; i< num; i++, row++)
- list[row] = (Attr_attribute) strings[i];
-
- list[row] = (Attr_attribute) NULL;
- list[row + 1] = (Attr_attribute) NULL;
-
- return list;
- }
-
-
- and:
-
- attr_list = create_attr_choice_list(strings, strcnt);
- xv_set(popup->tile.item, ATTR_LIST, attr_list, NULL);
-
- Something like that...adjust for scrolling list. Hope
- this points in the right direction for you.
-
- Daniel
- --
- dansmith@autodesk.com dansmith@well.sf.ca.us
- Daniel Smith, Autodesk, Sausalito, California, (415) 332-2344 x 2580
- Disclaimer: written by a highly caffeinated mammal
- $|=1;for("..."," hacker"," perl"," a","just"){print $l=$_.$l,"\015";sleep 1;}
-