FXRuby, FXTreeList


#1

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…


#2

On 11/16/05, Alexander F. removed_email_address@domain.invalid 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.


#3

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.


#4

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.