GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Apr 24, 2014 10:01 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Glade, Buttons and Stock Images
PostPosted: Mon Jan 14, 2013 3:16 am 
Offline

Joined: Sun Jan 13, 2013 9:27 am
Posts: 2
I have been designing a basic web browser using Glade, and I set it to use stock images for the back, forward, refresh and stop buttons, but the images are not showing up with only the labels appearing. What can I do to enable stock images?


Top
 Profile  
 
 Post subject: Re: Glade, Buttons and Stock Images
PostPosted: Mon Jan 14, 2013 3:53 am 
Offline
GTK+ Guru

Joined: Fri Mar 25, 2011 5:16 pm
Posts: 176
Location: USA
What OS and version are you using?
If you're using Ubuntu, depending on your version you need to enable button images using gconf-editor. Then you can use either:

Code:
GtkSettings *default_settings = gtk_settings_get_default ();
g_object_set(default_settings, "gtk-button-images", TRUE, NULL);

Or in GTK+3.6 or newer, there's gtk_button_set_always_show_image()
http://developer.gnome.org/gtk3/3.6/GtkButton.html#gtk-button-set-always-show-image


Top
 Profile  
 
 Post subject: Re: Glade, Buttons and Stock Images
PostPosted: Mon Jan 14, 2013 4:18 pm 
Offline

Joined: Sun Jan 13, 2013 9:27 am
Posts: 2
I am currently using Fedora 18 with GTK 3.6.4. The code sample you gave worked. I am curious does that work with all versions of GTK3?


Top
 Profile  
 
 Post subject: Re: Glade, Buttons and Stock Images
PostPosted: Mon Jan 14, 2013 7:34 pm 
Offline
GTK+ Guru

Joined: Fri Mar 25, 2011 5:16 pm
Posts: 176
Location: USA
Which one worked for you the gtk_button_set_always_show_image() or the other two lines?

It worked in Ubuntu Natty when I used it. Since I've jumped to Ubuntu Quantal and it doesn't seam to be a problem to display button images even with that part of the code removed. This happens even after turning off 'buttons-have-icons' using dconf editor and restarting the system.

From the dash: dconf editor

From the command line: dconf-editor
org->gnome->desktop->interface
'buttons-have-icons'
There's also 'menus-have-icons' and other goodies like 'cursor-blink', 'enable-animations' ect.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group