/src/ui/TextBuffer.hx

http://github.com/blackdog66/bdog-gtk · Haxe · 25 lines · 18 code · 7 blank · 0 comment · 0 complexity · 17ae25605fd2f6ce26d11344a8c2d859 MD5 · raw file

  1. package ui;
  2. import gtk.Model;
  3. import gtk.Gtk;
  4. import gtk.Glade;
  5. class TextBuffer extends Widget {
  6. public static function New(fn:TextBuffer->Void) {
  7. Gtk.textBufferNew(null,function(tb) {
  8. trace("Got new text buffer "+tb);
  9. fn(new TextBuffer(tb));
  10. });
  11. }
  12. public function new(id:String) {
  13. super(id);
  14. }
  15. public function setText(s:String) {
  16. Gtk.textBufferSetText(id,s,s.length);
  17. }
  18. }