Results 1 to 3 of 3

Thread: Gtk# eventHandlers

  1. #1
    Join Date
    Jul 2007
    Location
    UK
    Beans
    215
    Distro
    Ubuntu

    Gtk# eventHandlers

    Straight to the point, other than using 'global' variables, is it possible to pass a value to an event handler function as you would a parameter to an ordinary function?

    I.E. I have an event function that, when a button is clicked, does a series of things then closes a certain window. Most of the instructions are the same I just want to close a different window depending on which button is clicked. How could I pass the handle of the window to be closed, to the event function? (This is just hypothetical, there are many reasons I want to do this)

    In pygtk this is easy as we have the 'user data' parameter in the connect method however I cant seem to find this in mono and gtk# and the usual recommended way to connect an event is to just 'button.Clicked += button_clicked;' where button is your button widget and button_clicked is your event function. It doesnt help that the mono docs are only half complete aswell (nearly at 2.0 and they still wont tell us how to use it properly )

    Sorry about the long post, hope someone can help...
    Last edited by bubba_169; August 3rd, 2008 at 12:54 AM.

  2. #2
    Join Date
    Jul 2007
    Location
    UK
    Beans
    215
    Distro
    Ubuntu

    Re: Gtk# eventHandlers

    *bump*

  3. #3
    Join Date
    May 2006
    Location
    Pakistan
    Beans
    425
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: Gtk# eventHandlers

    Mono forums may answer.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •