Re: Right clicking and clists
| From: | Ivan Rodriguez | Date: | Sun, 30 Mar 2003 12:57:11 +0000 |
| Subject: | Re: Right clicking and clists | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3184@lists.php.net to get a copy of this message | ||
To build a POPUP e can get more information in:
http://gtk.php.net/manual/en/gtk.gtkmenu.php
:-)
El dom, 30-03-2003 a las 14:22, Aaron Bishell escribió:
> I managed to get the row being selected on a clist when the right mouse
> button is clicked so I thought id post the code incase anyone else needs
> it:
>
> ---
>
> $clist->connect("button-press-event", "buttonPressEventCallback",
> $a_gtk_menu);
>
> function buttonPressEventCallback($clist, $event, & $menu)
> {
> // If the right button was pressed.
> if ( ($event->button == 3) )
> {
> list($row, $column)=$clist->get_selection_info($event->x, $event->y);
>
> // If a valid row was right clicked.
> if( (is_int($row)) && (is_int($column)) )
> {
> // Select this row.
> $clist->select_row($row, $column);
>
> // Popup the menu.
> $menu->popup(NULL, NULL, NULL, $event->button, $event->time);
> }
> }
> }
>
> ---
>
> I had a difficult time finding how to do this so enjoy :)
>
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>