FXRuby, FXTreeList

A

Alexander Fleck

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.
 
L

Lyle Johnson

I' ve created a TreeList that shows the files in a directory. How can I c=
reate 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 w=
hen 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.
 
A

Alexander Fleck

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.
 
A

Alexander Fleck

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,197
Messages
2,571,038
Members
47,633
Latest member
BriannaLyk

Latest Threads

Top