Re: Some questions




Hello Chris,

Chris Jones <chris@black-sun.co.uk> wrote:
>
> 1) Is it possible to make the buttons on the GNOME toolbar widget
> appear with a small icon and a label printed to the right of the icon
> rather than having the text under the icon (and have a button with
> just an icon and no text)?

	The gnome-app-helper routines use the GtkToolbar widget to
give an application its toolbars.  The gnome-app-helper routines
(gnome_app_create_toolbar() and family) use the value returned by
gnome_preferences_get_toolbar_labels() to determine whether to display
just icons or icons with labels.  

	All of the gnome-preferences settings are configurable by the
user using the ui-settings capplet from the control center (gnomecc).
The idea is that the user can choose whether or not he wants his
toolbars to have labels on a GNOME-wide basis.

	After giving careful consideration to the value of uniformity
in the user interface, if you still want to override this setting in
your application, you can do something like this:

		gnome_preferences_set_toolbar_labels (FALSE);
		gnome_app_create_toolbar (app, toolbar_uiinfo);

As long as you don't call gnome_preferences_save(), this will override
the setting for the lifetime of your application.

	The GtkToolbar widget doesn't support the notion of
side-by-side toolbar icons and labels by default.  It does, however,
allow you to insert arbitrary widgets into the toolbar (see
gtk_toolbar_insert_widget()), so there's nothing stopping you from
manually building your own crazy toolbars yourself.  You just won't be
able to use the gnome-app-helper routines.

> 2) Is it possible to have the toolbar widget render each button at
> different sizes? It's mildly annoying to have all the buttons the
> width of the widest button as I'm running out of space on screen!

	Well, no.  The GtkToolbar widget allocates the same width and
height to each button.  Whether this makes sense or not is a matter of
taste, I suppose.  You might like to know that this won't happen if
you insert your own custom widgets into the toolbar, however.

> 3) When I compile my app with GNOME menus using gcc's strict/pedantic
> ANSI rules, I get the following warning:
> 
> 	gui.c:59: warning: ANSI forbids initialization between function
> pointer and `void *'
> 
> which corresponds to the "GNOMEUIINFO_SEPARATOR" line of:

	Actually, it probably corresponds to all of the menu item
initializion lines which specify a callback function.

	The reason for this is that the callback is stored in the
internal GnomeUIInfo structure in the "gpointer moreinfo;" field, and
the macros aren't casting the function pointer to a gpointer for you.
So that's a bug in the GNOMEUIINFO_* macros.  This can be fixed by
adding some casts to gnome-app-helper.h.  Does anyone have any
objections to this?

> I know it's not a fatal error, but there are quite a few separators
> and it might be nice if it would compile cleanly.

	Yep, these kinds of reports are always good.  Thanks for
finding this problem.

Nat



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]