Re: Ideal way to create toolbar (with pic)

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

 



Hi John,

On Fri, 20 Feb 2004, John Cupitt wrote:
> Raymond Wan wrote:
> > 	I'm trying to create a toolbar button as follows:
> >
> >   iconw = gtk_image_new_from_file ("next.xpm");
> >   toolbar_button = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), NULL,
> > "Go to next", NULL, iconw, GTK_SIGNAL_FUNC (showNext), GINT_TO_POINTER
> > (curr));
> >
> > 	An obvious problem with this is that the .xpm file is assumed to
> > be in the current directory.  I could put an absolute path, but ideally,
> > I'd like to add the picture into the code.  The GTK docs present many
> > choices to choose from when creating toolbar buttons.  Could someone
> > recommend to me what is the ideal method for creating toolbars?
>
> I think the ideal way is to make a new themeable stock item (with your
> pic set as the default), and then use gtk_toolbar_insert_stock(). Check
> the docs on gtk_icon_*() and gtk_stock_*(). I have some sample code if
> you're interested.

	Hmmmm, neither the word "theme" nor the word "stock" were
considered, so at first glance, I don't know what you're talking about.
:)  I'll look into the documentation, but if you have sample code (or
point me to a GTK example) that shows how a stocks and themes are used,
that would be great!  Private e-mail is fine.

	Thank you!

Ray


_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux