Fw: Right-click menu and selection in CList


I have a menu that pops up when the right mouse button is clicked on a CList.
I have some questions about this.

1. How do I select the row on which the right-button is clicked? Retrieving
the mouse co-ordinates and then using those the find out which row is selected
seems  like too many steps. I tried instead to make the right button select
(in addition to the left button), but it isn't having any effect on the mouse
actions. This is the call I am using.
   $some_CList->set_button_actions(3, [ 0,1,0,0 ]);
I think I am making some mistake in using the enum ButtonAction. The desired
effect I want is for the row (on which somebody right clicks) to be selected
(that is, highlighted, as if the left button was clicked on it), and in
addition I want the on_clist_button_press callback to be activated just like
it is now, so that I can pop the menu. Once some action is selected from the
menu, I can use clist-selection to retrieve the selected row(s) and process them. 

2. I'm using Glade-Perl and I always have a difficulty getting pointers to the
widgets in the packages that it generates for each window and pop-up menu. In
the case above, I want to do something like $menu->popup on a right-click. I
end up doing this - I put the menu in a different file SomeMenu.pm. On
right-click, I call   $menu = SomeMenu->new. The difference is I change the
SomeMenu package from that generated by Glade-Perl by returning $widgets from
it instead of $self. Is there a clean way to get to the menu widgets from the
all_forms hash? Simply scoping it (SomeMenu::all_forms) doesn't work.

3. Anybody know of a Perl binding for GtkSheet? Dermot, the link you sent is
for GtkTextExtra, not GtkExtra which has this widget :)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]