Ali H
Ali H

Reputation: 11

How do I remove GTK warnings?

I'm trying to build a Ruby GUI by using GTK Glade3, but when I'm running my program I get some warnings.

This is the warning: C:/Ruby/PATS/lib/ruby/gems/2.0.0/gems/gobject-introspection-3.0.7-x86-mingw32/lib/gobject-introspection/loader.rb: line 551 GLib-GObject-WARNING **:The property GtkButton:use-stock is deprecated and shouldn't be used anymore. It will be removed in a future version.

I'm using Win-10.

Anyone can help me how to remove those warnings?

XML code for GtkButton

Upvotes: 0

Views: 1422

Answers (1)

ebassi
ebassi

Reputation: 8805

You should modify the GtkBuilder XML to drop the deprecated GtkButton:use-stock property, and use a GtkImage child widget instead, e.g.:

<object class="GtkButton" id="back_button">
  <property name="width_request">100</property>
  <property name="visible">True</property>
  <property name="can_focus">True</property>
  <property name="receives_default">True</property>
  <child>
    <object class="GtkImage" id="back_button_image">
      <property name="visible">True</property>
      <property name="can_focus">False</property>
      <property name="icon_name">go-previous</property>
    </object>
  </child>
  <signal name="clicked" handler="screen_change" swapped="no"/>
  <style>
    <class name="image-button"/>
  </style>
</object>

Upvotes: 2

Related Questions