Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using MeeGtk;
- void main(string[] args){
- init(null);
- var toto = new Toto();
- toto.show_all();
- Gtk.main();
- }
- public class Toto : GLib.Object
- {
- string s = """{
- "interface" : [
- {
- "class" : 'GtkAdjustment',
- "id" : 'adjustment1',
- "properties" : {
- "upper" : 100,
- "step_increment" : 1,
- "page_increment" : 10
- },
- "children" : null
- },
- {
- "class" : 'GtkWindow',
- "id" : 'window',
- "properties" : {
- "can_focus" : false
- },
- "children" : [
- {
- "class" : 'GtkBox',
- "id" : 'box1',
- "properties" : {
- "visible" : true,
- "can_focus" : false,
- "orientation" : 'vertical'
- },
- "children" : [
- {
- "class" : 'GtkProgressBar',
- "id" : 'progressbar1',
- "properties" : {
- "visible" : true,
- "can_focus" : false
- },
- "children" : null
- },
- {
- "class" : 'GtkSpinButton',
- "id" : 'spinbutton1',
- "properties" : {
- "visible" : true,
- "can_focus" : false,
- "invisible_char" : '•',
- "adjustment" : 'adjustment1'
- },
- "children" : null
- },
- {
- "class" : 'GtkImage',
- "id" : 'image1',
- "properties" : {
- "visible" : true,
- "can_focus" : false,
- "stock" : 'gtk-missing-image'
- },
- "children" : null
- },
- {
- "class" : 'GtkMenuBar',
- "id" : 'menubar1',
- "properties" : {
- "visible" : true,
- "can_focus" : false
- },
- "children" : [
- {
- "class" : 'GtkMenuItem',
- "id" : 'menuitem1',
- "properties" : {
- "visible" : true,
- "can_focus" : false,
- "label" : '_Fichier',
- "use_underline" : true
- },
- "children" : [
- {
- "class" : 'GtkMenu',
- "submenu" : true,
- "id" : 'menu1',
- "properties" : {
- "visible" : true,
- "can_focus" : false
- },
- "children" : [
- {
- "class" : 'GtkMenuItem',
- "id" : 'menuitem2',
- "properties" : {
- "visible" : true,
- "can_focus" : false,
- "label" : 'Menu',
- "use_underline" : true
- },
- "children" : null
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }""";
- Gtk.Window window;
- public Toto(){
- var c = new Constructor();
- c.load_from_data(s);
- c.connect_signals(this);
- window = (Gtk.Window)c["window"];
- }
- public void show_all(){ window.show_all(); }
- [CCode(instance_pos = -1)]
- public void on_btn_clicked(Gtk.Widget widget){ Gtk.main_quit(); }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement