creationix / node-gir

Node bindings to libgirepository
http://live.gnome.org/GObjectIntrospection
MIT License
231 stars 58 forks source link

problem connecting signals (gir/gtk3) #38

Open dg14 opened 11 years ago

dg14 commented 11 years ago

hi

i've some problems to understand where i fall, because it seems that when i try to connect a callback to a menuitem, when i click on that, it repeats the launching of the callback a number of times equals to the number of elements in that menu.

probably the function that link callbacks needs some work.

example:

var menu1=new gtk.Menu();
var menu1label=new gtk.MenuItem({label: "File"});
var openlabel=new gtk.MenuItem({label:"Open"});
var quitlabel=new gtk.MenuItem({label:"Quit"});
quitlabel.on("select", function() { console.log("quit"); } );
openlabel.on("select", function() { console.log("open"); });
menubar.append(menu1label);  

menu1label.set_submenu(menu1);
menu1.append(openlabel);
menu1.append(quitlabel);
menu1label.show_all();
piotras commented 11 years ago

Yeah, callback repeat is equal to number of callbacks IIRC. I didn't have time to check details. Any input appreciated.

dg14 commented 11 years ago

so, what's the starting point? i don't know v8 engine, only where i have to start?

piotras commented 11 years ago

object.cc and signals related routines are good places to visit :)