GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to bring up GTKStatusIcon popup menu using a left click?

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
wheels53
Familiar Face


Joined: 13 Feb 2007
Posts: 13

PostPosted: Mon Jan 07, 2008 10:15 pm    Post subject: How to bring up GTKStatusIcon popup menu using a left click? Reply with quote

Code: (Plaintext)
1
2
3
4
5
6
7
8
g_signal_connect (G_OBJECT (statusicon), "activate", G_CALLBACK (activate_menu), menu);

static void activate_menu (GtkStatusIcon *statusicon, GtkWidget *menu)
{
    g_signal_emit_by_name (statusicon, "popup_menu", 3, 0);
       
}


Using the code above I can left click to bring up the popup menu but, the popup menu will not stay up without me keeping the mouse button pressed. On a mouse release, the selected item is activated but, I need it to act like a right click.

Any ideas?
Back to top
wheels53
Familiar Face


Joined: 13 Feb 2007
Posts: 13

PostPosted: Tue Jan 08, 2008 12:04 am    Post subject: [Solved] Reply with quote

Code: (Plaintext)
1
2

g_signal_emit_by_name(statusicon, "popup_menu", 3, gtk_get_current_event_time());
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP