[Gambas-user] Chronic columnview Woes

Benoît Minisini gambas at ...1...
Wed May 8 13:03:35 CEST 2013


Le 08/05/2013 02:03, Richard Terry a écrit :
> Hi List,
>
 > ...
 >
> However, lets say I want to popup a menu of the letters collection:
>
> If I right mouse click on the list to bring up the menu the
> cvwLetters_Menu event triggers, but if one inspects the cvwLetters
> control itself in the IDE, the cvwLetters.item.key is null, however the
> cvwletters.selected[0] does contain the value one would expect to be in
> the cvwLetters.item.key.
>
> I've tried doing e.g cvwLetters.movecurrent() before popping up the
> menu, this does not seem to make much difference.

The Menu event is not an event managed by the ColumnView control, but by 
its Control parent class. This is the reason why the Item property is 
not set during the Menu event handler. The Menu event is raised even if 
you don't click on an item.

Normally, the Click event will be raised before the Menu event, and so 
you can store the key of the ColumnView.Item property during the Click 
event handler (which is a ColumnView event) to use it later during the 
Menu event handler.

>
> Also I've a chronic problem trying to generate a columnview click event
> in code, with a similar outcome to the above - the item.key is not set

The Item property *is* set during a Click event handler. What are you 
talking about with "generate a columnview click event"?

-- 
Benoît Minisini




More information about the User mailing list