Re: Creating Custom toolbars
- From: James Henstridge <james daa com au>
- To: Dave Smith <dsmith gdev net>
- cc: gnome-list gnome org
- Subject: Re: Creating Custom toolbars
- Date: Wed, 3 Feb 1999 14:01:29 +0800 (WST)
There are a few things to realise when you are doing this. First of all,
GNOME_UIINFO_ITEM and friends are macros that expand to something suitable
for assigning as an initial value for a variable.
There are two ways to do what you want. The first is to assign values to
the individual GnomeUIInfo structure members (which is slow and hard to
maintain). The second is to define a number of variables (probably static
const) to hold the uiinfo structures for each button:
GnomeUIInfo newbutton = GNOME_UIINFO_ITEM(...);
Now while creating the toolbar uiinfo array, just assign newbutton to an
array element.
Also, to terminate the array, use "toolbar[i].type = GNOME_APP_UI_ENDOFINFO".
James Henstridge.
--
Email: james@daa.com.au
WWW: http://www.daa.com.au/~james/
On Wed, 3 Feb 1999, Dave Smith wrote:
>
> This may not be the correct list to ask this question on, if not please
> direct me to the right one.
>
> I'm in the middle of porting our application (gIDE) to gnome. One of our
> features is a custom toolbar, where a user selects which tools are to be
> placed in the toolbar and which are left out. My question is, without
> knowing which or how many of the pre-defined buttons a user will select
> for the toolbar, how do we assemble the toolbar at compile time?
>
> I have tried:
>
> if (cfg->toolbar_custom)
> {
> glong i;
> GnomeUIInfo *toolbar[50];
>
> for (i = 0; i < cfg->toolbar_custom_items_no; i++)
> {
> if (!strcmp (cfg->toolbar_custom_items[i], "New"))
> {
> toolbar[i] = GNOMEUIINFO_ITEM_STOCK (N_("New"),
> N_("New File"),
> file_new, GNOME_STOCK_PIXMAP_NEW);
> };
>
> if (!strcmp (cfg->toolbar_custom_items[i], "Open"))
> printf("%s", item);
> *toolbar[i] = {GNOMEUIINFO_ITEM_STOCK (N_("Open"),
> N_("Open"),
> file_open, GNOME_STOCK_PIXMAP_OPEN)};
> }
>
> }
> i = i++;
> toolbar[i] = "GNOMEUIINFO_END";
>
> gnome_app_create_toolbar_with_data (GNOME_APP (app), toolbar,
> vbox);
>
> }
>
> but this is apparently impropper syntax. Please advise....
>
>
> Dave Smith
> dsmith@gdev.net
>
>
>
> --
> FAQ: Frequently-Asked Questions at http://www.gnome.org/gnomefaq
> To unsubscribe: mail gnome-list-request@gnome.org with
> "unsubscribe" as the Subject.
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]