Re: [Vala] Gtk.IconTheme Example



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




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