On Mon, Feb 09, 2009 at 02:04:24AM -0800, John Finlay wrote:
> Alessandro Dentella wrote:
> > Hi,
> >
> >   i'd like to use stock item in menu entries with modified labels to better
> >   suit context.
> >
> >   *  MenuItem doesn't allow to use images (reasonable)
> >   *  ImageMenuItem doesn't appearently allow to change label (really???)
> >
> >   I think I could go with IconFactory but it seems to me it's more complex
> >   than what is should be and I wandered if there is a simple way I was not
> >   able to work out.
> >
> >   Thanks
> >   
> >   sandro
> >   *:-)
> >
> >   
> A MenuItem is a Container so you can add anything to it. In your case 
> create an empty MenuItem and add an HBox containing an Image and a Label.

Today pygtk FAQ is back (yesterday was not reachable) and I saw the solution
there. What I didn't imaginis that you can instantiate an ImageMenuItem as:

   item = gtk.ImageMenuItem('Foo')


even thought official docs say:

   gtk.ImageMenuItem(stock_id=None, accel_group=None)

_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to