PageRenderTime 17ms CodeModel.GetById 10ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/src/ui/Button.hx

http://github.com/blackdog66/bdog-gtk
Haxe | 28 lines | 21 code | 7 blank | 0 comment | 0 complexity | 4f2c8a8c96230e5c3be03088ec3927b7 MD5 | raw file
 1
 2package ui;
 3
 4import gtk.Model;
 5import gtk.Gtk;
 6import gtk.Glade;
 7
 8class Button extends Widget {
 9
10  public function new(id:String) {
11    super(id);
12  }
13    
14  public static function
15  fromGlade(glade:GladeXml,name:String,fn:Button->Void) {
16    Ui.getGladeWidget(glade,name,function(w:String) {
17        fn(new Button(w));
18      });
19  }
20  
21  public function label(s:String) {
22    Gtk.buttonSetLabel(id,s);
23  }
24
25  public function onClick(fn:CallBack) {
26      Ui.event(this,clicked,fn);
27  }
28}