Re: Attaching a menu to a clist row
| From: | Rich Payne | Date: | Sun, 09 Feb 2003 00:11:47 +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-3017@lists.php.net to get a copy of this message | ||
Yes, I think you're right. It requires the user to do a manual selection
with the left button first. If you do come up with a better way let us
know.
--rdp
On 7 Feb 2003, Aaron Bishell wrote:
> I already tried this and it does not work because right click does not
> select a row unfortunately :/
>
> Rich Payne wrote:
>
> > $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
>
>
>
> --
> 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