Advertisement
diegotoral

Genie connect signal

May 8th, 2012
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Genie 0.57 KB | None | 0 0
  1. [indent=4]
  2. uses Gtk
  3.  
  4. init
  5.     Gtk.init (ref args)
  6.     var test = new TestWindow ()
  7.     test.show_all ()
  8.     Gtk.main ()
  9.  
  10. class TestWindow : Window
  11.     init
  12.         title = "Test Window"
  13.         default_height = 250
  14.         default_width = 250
  15.         window_position = WindowPosition.CENTER
  16.         destroy.connect (Gtk.main_quit)
  17.         var button = new Button.with_label ("Click me")
  18.         button.clicked.connect (clicked_cb)
  19.         add (button)
  20.        
  21.     def clicked_cb (btn : Button)
  22.         title = "Hello World"
  23.         btn.label = "Hello World"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement