Rodrigo Cares schrieb:
> Please can some people make an example of use of Gtk.IconTheme.
> Thanks

----

using GLib;
using Gtk;

public class IconThemeExample : Window {

        construct {
                var icon_theme = IconTheme.get_default ();
                var button = new Button.with_label ("Button");
                try {
                        var icon = icon_theme.load_icon ("gnome-help", 48, 0);
                        button.image = new Image.from_pixbuf (icon);
                } catch (Error e) {
                        warning (e.message);
                }
                add (button);
                destroy += Gtk.main_quit;
        }

        public static int main (string[] args) {
                Gtk.init (ref args);

                var sample = new IconThemeExample ();
                sample.show_all ();

                Gtk.main ();

                return 0;
        }
}

----

# valac icon-theme-example.vala --pkg gtk+-2.0

_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to