func init // adds using namespace sys.add_use('Gtk') // initialize instance sys.add_var(this.name, 'static MessageDialog') a = this.props("DialogFlags").value flg = ((a _and_ 1) ? '|DialogFlags.Modal' : '') + ((a _and_ 2) ? '|DialogFlags.DestroyWithParent' : '') + ((a _and_ 4) ? '|DialogFlags.NoSeparator' : '') this.flags = '0' + flg // initialize temp variable if(linked("onResult") and not user_level) sys.add_var('result', 'ResponseType') end end func doShow(data) params = 'null' + ', ' + this.flags + ', ' + sys.get_typed_field('MessageType.Info', 'MessageType', 14, 'Gtk.MessageType') + ', ' + sys.get_typed_field('ButtonsType.None', 'ButtonsType', 14, 'Gtk.ButtonsType') + ', ' + sys.get_typed_field(data, 'Format', 2) + (linked("args") ? d("args") : '') blk.println(this.codename, ' = new MessageDialog(', params, ');') sys.set_typed_field(2, 'Text', '', '', blk) sys.set_typed_field(2, 'SecondaryText', '', '', blk) sys.set_typed_field(2, 'Markup', '', '', blk) sys.set_typed_field(104, 'UseMarkup', '', '', blk) sys.set_typed_field(104, 'SecondaryUseMarkup', '', '', blk) sys.set_typed_field(20, 'Image', '', '', blk) if(linked("onResult")) if(user_level) event("onResult", '(ResponseType)' + this.codename + '.Run()') else blk.println(this.result, ' = (ResponseType)', this.codename, '.Run();') event("onResult", this.result) end else blk.println(this.codename, '.Run();') end blk.println(this.codename, '.Destroy();') end