Re: [ROOTTALK] How to do popup menus

From: Ilka Antcheva <Ilka.Antcheva_at_cern.ch>
Date: Fri, 13 Jul 2007 16:02:27 +0200


***Another try to send my answer to roottalk list. I got several times error messages***

Hi Tom,

A context menu will appear anytime on the top of the GUI, if it has gClient->GetDefaultRoot() as a parent. This way it gets the pointer to the root (i.e. desktop) window. If I understand well your message it was given GetParent()->GetParent() instead.

Currently there is no scroll feature implemented in TGPopupMenu class, but you can use cascaded menus to split a long list of entries in shorter parts.

Cheers, Ilka

Tom Roberts wrote:
> I am having problems getting a right-click popup menu to display
> correctly. the mouse event comes with X,Y relative to the TGTextEntry in
> which I clicked (the menu is a list of field-names to insert into the
> text entry). If I just display the TGPopupMenu in that frame, it is
> clipped and has room for only 1 entry. So I call GetParent() twice and
> can display in a TGFrame which clips the menu with room for 10-15
> entries. But my menu can have several dozen entries.
>
> What is the right way to display a TGPopup menu from a right click?
>
> How can I get the menu to scroll when it has more entries than can be
> displayed? Or fold into several columns.
>
>
> Tom Roberts
>
Received on Fri Jul 13 2007 - 16:03:33 CEST

This archive was generated by hypermail 2.2.0 : Fri Jul 13 2007 - 23:50:02 CEST