[pygtk] Tooltips on comboBox

Alessandro Dentella sandro at e-den.it
Thu Jan 22 01:53:41 WST 2009


I forward here the answer from Kristian Rietveld in gtk list. I thinks it may
be useful to others.

After this I decided to use deprecated widget OptionMenu, that gives a
normal MenuItem that supports tooltips



sandro

-----------------------------------------------------------------------
On Wed, Jan 21, 2009 at 10:22 AM, Alessandro Dentella <sandro a e-den.it> wrote:
> In my attempt to get tooltips I see that as I click on the arrow and the
> popup appears, the tooltip disappears.

This is also because GTK+ hides a tooltip as soon as something is
clicked to avoid the tooltip getting in your way.

> It seems the popup is a different gtk.Widget, and I should connect to that
> one to attach tooltips. Is that correct? and in case how can I have that
> widget?

Yes, the popup is a different widget.  There is no API call to access
this popup widget directly (this has also been done deliberately,
since the popup widget/window can change when the theme changes and in
general people shouldn't mess around with it ;).

> Can somebody clearify which is the way a ComboBox pops a menu and how I can
> get to it's components to set a tooltip?

Right now I don't see a way how to easily set a tooltip on the combo
box popup.  I do agree that this would be very useful to be able to do
and we should support this in a future version of GTK+.


regards,

-------------------------------------------------------------------------
On Wed, Jan 21, 2009 at 1:16 PM, Alessandro Dentella <sandro a e-den.it> wrote:
>> Right now I don't see a way how to easily set a tooltip on the combo
>> box popup.  I do agree that this would be very useful to be able to do
>> and we should support this in a future version of GTK+.
>
> sigh...
>
> Thank you so much for the explanation.

I have this mail thread marked in my inbox so that I won't forget to
open a bug for this issue ;)

> Of course I think that addition would be really usefull. For the time being
> I think the only solution for me will be to mock it with a menu. Would
> OptionMenu (that was deprecated in favor to ComboBox) give me the
> opportunity to set tootlip or I would meet the same problem?

I think the option menu will give you this opportunity since you have
to create the menu that is popped up yourself and pass that to the
GtkOptionMenu.



More information about the pygtk mailing list