Re: Attaching a menu to a clist row

From: Date: Fri, 07 Feb 2003 13:13:27 +0000
Subject: Re: Attaching a menu to a clist row
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-3014@lists.php.net to get a copy of this message
$clist->selection --rdp On 7 Feb 2003, Aaron Bishell wrote: > Also, is there any way to retrieve the row the mouse cursor is "over"? I > assumed right click would select the row but its not. Is there a way to > set right click to select a row maybe? > > Rich Payne wrote: > > > On 6 Feb 2003, Aaron Bishell wrote: > > > > I have the following example menu: > > > > > > ............................... > > > > > > $menu=new GtkMenu(); > > > > > > $menu_item1=new GtkMenuItem("menuitem 1"); > > > $menu_item1->connect("activate", "somefunction"); > > > $menu->append($menu_item1); > > > > > > $menu_item2=new GtkMenuItem("menuitem 2"); > > > $menu_item2->connect("activate", "somefunction2"); > > > $menu->append($menu_item2); > > > > > > ............................... > > > > > > How would I got about attaching this to a row on a clist so that when a > > > user clicks right mouse button on a row the menu pops up? Im assuming id > > > have to use something like "attach_to_widget()"? > > > $clist->connect('button_press_event',function_to_call,&$menu); > > ...... > > > > function function_to_call ($widget,$event, $menu) { > > // Find out if the user clicked the right button > > if ($event->button == 3) > > $menu->popup(null,null,null, $event->button, $event->time); > > } > > > > Hope that helps, > > --rdp > > > Rich Payne > > http://talisman.mv.com > > rdp at talisman dot mv dot com > > > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Rich Payne http://talisman.mv.com rdp at talisman dot mv dot com

« previous php.gtk.general (#3014) next »