[pygtk] Some questions on the UIManager and the ActionGroups

Nemesis nemesis2001 at gmx.it
Fri Aug 11 16:03:56 WST 2006


On Thu, 10 Aug 2006 18:50:16 -0700
John Finlay <finlay at moeraki.com> wrote:


> > 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.
> >   
> You could try using a lambda expression for the callback:

Yes, that's right, but I tend not to use lambdas cause I don't like
them and they are deprecated so could disappear in the future. 

Anyway I think that the add_actions method should be rethinked, what I
did manually should be performed inside the implementation of
add_actions. Otherwise is unuseful to have the "user_data" ... or at
least I think so ;-)

> lambda w: callback(w, data)
> > 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?
> >   
> Probably the easiest way is to add a Label to a ToolItem and insert
> that in the Toolbar without using the UIManager

You are right, I can add it manually with the insert method, I didn't
think about that. Thanks.


-- 
 
 |\ |       |HomePage   : http://nem01.altervista.org
 | \|emesis |XPN (my nr): http://xpn.altervista.org


More information about the pygtk mailing list