Forum: Ruby FXRuby, FXTreeList

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C76a52a7216844fe0e462e3d39ac97e4?d=identicon&s=25 Fleck (Guest)
on 2005-11-16 07:40
(Received via mailing list)
Hi,
I' ve created a TreeList that shows the files in a directory. How can I
create a context menu that pops up, when I right-click on a selected
item? I know how to create the popup menu, but how can I prevent it to
get shown when I click somewhere else than the item? Do I have to
remember the items I selected and then check if it' s under the cursor
when right-clicking?

Thanks,
Alexander Fleck.
0276239ca57aee241d4b41379587fa20?d=identicon&s=25 lyle.johnson (Guest)
on 2005-11-16 18:09
(Received via mailing list)
On 11/16/05, Alexander Fleck <Fleck@schleissheimer.de> wrote:

> I' ve created a TreeList that shows the files in a directory. How can I create a context 
menu that pops up, when I right-click on a selected item? I know how to create the popup 
menu, but how can I prevent it to get shown when I click somewhere else than the item? Do 
I have to remember the items I selected and then check if it' s under the cursor when 
right-clicking?

I think that I'd just call FXTreeList#getItemAt(event.win_x,
event.win_y) to determine which item was right-clicked. If the user
right-clicked somewhere outside of an item, getItemAt() ought to
return nil.
C76a52a7216844fe0e462e3d39ac97e4?d=identicon&s=25 Fleck (Guest)
on 2005-11-17 09:08
(Received via mailing list)
Thanks,
it works, after a while of trying and modifying. I' m on my way into the
FXRuby library and still have some newbie problems with the events and
their handling. But I' m going to manage that.
Thanks,
Alex.
C76a52a7216844fe0e462e3d39ac97e4?d=identicon&s=25 Fleck (Guest)
on 2005-11-17 11:44
(Received via mailing list)
Hi,
but now another question:
When I selected an item, all works fine, but the menu always pops up,
when I right-clicked in the item' s row. That doesn' t happen above or
below the row. What happens here?

Thanks,
Alex.
This topic is locked and can not be replied to.