Feed on Posts or Comments

Hacking & Maemo Gustavo Sverzut Barbieri on 04 Jul 2006 09:31 pm

HOWTO disable images/icons on stock GTK buttons

Maemo do not use icons/images on stock buttons, however it doesn’t specify that in its “rc” (resources) file, so we need to do that in our code.

Code is really simple, however since some people already asked me, I’ll publish it here (”widget” parameter can be a toplevel window):

  • C version:
    void disable_button_images( GtkWidget *widget )
    {
    GtkSettings *settings;
    
    settings = gtk_widget_get_settings( widget );
    g_object_set( G_OBJECT( settings ), "gtk-button-images", FALSE, NULL );
    }
  • Python version:
    def disable_button_images( widget ):
    settings = widget.get_settings()
    settings.set_property( "gtk-button-images", False )

Trackback This Post | Subscribe to the comments through RSS Feed

Leave a Reply

You must be logged in to post a comment.