[Glade-users] Passing User defined data in signal handlers[through Glade defined widgets]



Hi All,

I am new to Glade and to this list. I am creating a new
application UI interface through glade[glade-2].

I have a couple of queries regarding passing application data in signal
handlers. The details of which are given below:

Query 1: Regarding passing user data in menu item signal handlers
---------------------------------------------------------------------------------------------------
a. I have an application where I create the menu items
through Glade. The menu editor gives me only a Handler
option, where I add the signal handler that needs to be called.
Apart from the signal handler call,   I also need to pass the user data[or
udata ]
as well, when this handler gets called. For eg:  I have a menu item of this
form:
Add
- ByteStream
- Enum
- Parameter
[Where ByteStream, Enum, Parameter are sub menuitems are under Add].
Each of the activations of ByteStream, Enum, Parameter call the same
signal handler [add_parameter]. I also need to pass a constant alongwith
this call
[for eg BYTESTREAM, ENUM, PARAMETER], to identify which menu item
was activated.

Is it possible to make this constant get passed using the signal handler
added through
Glade?

For comparison sake, if I had to create the menuitems manually, I would have
had code like this:
 $param_bytestream_menuitem->signal_connect( ACTIVATE, \&add_parameter,
BYTESTREAM);
 $param_enum_menuitem->signal_connect( ACTIVATE, \&add_parameter, ENUM);
etc.



Query 2: Regarding Passing user data in signal handlers
------------------------------------------------------------------------------------
I have another  requirement in the application to pass user data alongwith
the signal handlers for other
Gtk widgets for eg: Toolbar widgets. [Similar
to the above one]. This data is in the form of constants.
I understand that the 'Object' portion under the Signals can be used for
this purpose.
But,  I am not clear as to how to use this portion and what type of values
to give in here.
For eg in my case, I need to pass constants alongwith the signal handler
call

Any help for the above two issues, will be highly appreciated.

Thanks and Regards
Ashwin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20060919/5ba0758b/attachment.html 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]