[pygtk] Some questions on the UIManager and the ActionGroups
Nemesis
nemesis2001 at gmx.it
Thu Aug 10 17:06:56 WST 2006
Hi all,
I'm rewriting my application in order to use the UIManager and the
ActionGroups. But I have some problems:
1) I'd like to use the function ActionGroup.add_actions in order to
populate the actiongroup. It accepts to arguments a list of tuples
containing the descriptions of the actions and a second value named
"user_data" that should be the data passed to the callback.
I need to send data to some of the callback, but I don't know how to
specify it.
I tried creating a list of tuples that contains themselves the data,
something like that:
[(tuple1, ..., callback),
(tuple2, ..., callback,data),
(tuple3, ..., callback)]
but this format is not accepted by add_actions. at the moment I'm using
a little workaround:
for action in actions:
if len(action)<7:
actiongroup.add_actions([action])
else:
actiongroup.add_actions([action[0:6]],action[-1])
but I'd like to implement a cleaner (if exists) solution.
2) Is possible to add labels on a Toolbar when you describe it with the
UIManager?
Reading the reference seems that the only items I can put on the Toolbar
are ToolItems and Separator, is that right?
--
|\ | |HomePage : http://nem01.altervista.org
| \|emesis |XPN (my nr): http://xpn.altervista.org
More information about the pygtk
mailing list