[indent=4] // Compile with uses Gtk Gdk class wMain : GLib.Object prop main_window : MainWindow init var main_window = new MainWindow() var main_viewport = new Viewport(null, null) main_window.scrolled_window.add(main_viewport) main_window.show_all() main_window.location_entry.activate.connect(on_location_activate) def on_show_menuitem_activate(show_menuitem:CheckMenuItem) if show_menuitem.active print "Toggled" main_window.show() else print "Not Toggled" main_window.hide() def on_location_activate(location_entry:Gtk.Entry) print "connected" class MainWindow : Gtk.Window prop scrolled_window : ScrolledWindow prop toolbar : Toolbar prop forward_button : ToolButton prop location_entry : Entry construct(type:Gtk.WindowType=Gtk.WindowType.TOPLEVEL) GLib.Object(type:type) this.set_default_size(900, 600) init this.delete_event.connect(on_mainwindow_delete_event) // Toolbar creation var scrolled_window = new ScrolledWindow(null, null) var vbox = new VBox(false, 0) var toolbar_hbox = new HBox(true, 0) var toolbar = new Toolbar() var back_button = new ToolButton.from_stock("gtk-go-back") var forward_button = new ToolButton.from_stock("gtk-go-forward") var location_entry = new Entry() //Toolbar Packing toolbar.insert(back_button, -1) toolbar.insert(forward_button, -1) toolbar_hbox.pack_start(toolbar, false, true) toolbar_hbox.pack_start(location_entry, false, true) vbox.pack_start(toolbar_hbox, false, true) vbox.pack_start(scrolled_window, true, true) this.add(vbox) def on_mainwindow_delete_event() : bool this.hide() return true init Gtk.init (ref args) new wMain() Gtk.main()