Advertisement
rotrevrep

connect signals with Gtk & Gjs

Aug 9th, 2013
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function test(data){
  2.     var builder = new Gtk.Builder();
  3.     builder.add_from_file("window.ui");
  4.     var handlers = {
  5.             on_quit: Gtk.main_quit
  6.         };
  7.     let signal_handlers = new SignalHandlers();
  8.     builder.connect_signals_full(function(builder, object, signal, handler){
  9.             object.connect(signal,handlers[handler]);
  10.         },this);
  11.     var win = builder.get_object("window");
  12.    
  13.     this.show_all = function(widget){
  14.         win.show_all();
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement