Re: Pop-pup on button pressed.




 Folks,

 I have foudn the solution to the problem I posted.

 I just got one response and I thought it to be wrong ... Here is the correct
one. (Thanks for the response anyway.)

gboolean
on_treeview1_event                     (GtkWidget       *widget,
                                        GdkEvent        *event,
                                        gpointer         user_data)

{
 
  GtkWidget* menu = NULL;  /* could have been attached to the user_data */
  if( event->type ==  GDK_BUTTON_PRESS) /* The mouse was clicked. !!! */
  {
        GdkEventButton *bevent = (GdkEventButton *) event; /* so it is a mouse
event and , therefore, safe to cast !!! */
        if(bevent->button == 3)  /*Check to see if it was the right most button
on the mouse  --*/
        {
                menu = create_popup_menu();  /* create the popup menu */
                /* Display the menu ! */
                gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
                                bevent->button, bevent->time);
                /* say that we handled the event. and not to propagae down */
                return TRUE;
        }
  }
  return FALSE;
}

--- Harring Figueiredo <harringf yahoo com> wrote:


 Folks,

 I have a GtkTreeview (Table) and would like to popup a menu when the right
button on the mouse is pressed.
  Any example of his ?

 The same thing with a GtkTextView.

 Thanks.

Harring

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com



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