PageRenderTime 23ms CodeModel.GetById 18ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/ui/Window.hx

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