FXRuby, FXTreeList

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 F…

On 11/16/05, Alexander F. [email protected] 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.

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.

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.