[Mono-list] glade signal connections

Rob Brown-Bayliss rbb@orcon.net.nz
Tue, 31 Aug 2004 18:52:25 +1200


On Tue, 2004-08-31 at 16:51, Peter Williams wrote:

> Do you just mean that you want to manually connect to a signal? Gtk#
> wraps signals as events and you can treat them pretty much as you would
> any other event:
> 
> 	Gtk.Window window = whatever ();
> 	window.DestroyEvent += new DestroyEventHandler (myfunction);
> 
> Or am I not understanding your question?

Not sure, I have a glade file, inside the main app window, 4 or five
container children deep a list view (or any widget), in glade I decide I
want to capture the row_activated signal: on_main_list_row_activated

Now in monodevelop I have my main app class, if I dont define a handler
function inside this class then the app crashes:

Unhandled Exception: Glade.HandlerNotFoundException: No handler
on_main_list_row_activated found for signal row_activated

but I want the handler for this signal inside the class MyListView in
another file in the project.  Do I have to define the handler in the
main class and then call the function from my other class or is there a
better way?

in python I could, for lack of a better word divert this signal to the
class like so:


self.siglist = {"on_about1_activate": self.about,
                "on_main_list_row_activated": self.childclass.handler,        #  <---
                "on_app1_destroy_event": self.close_down,
                "on_app1_delete_event":self.delete_event,
                "on_quit1_activate": self.quit_activate}
self.wTree.signal_autoconnect(self.siglist)

Did I make that clear?  I am trying to avoid a lot of functions in the
main app class that simply take some args and pass them to another
function in another class, it seems like a lot of extra typeing and
overhead...

--
Rob Brown-Bayliss