You are not logged in.

#1 2014-12-18 20:02:04

Debasish Patra
Member
Registered: 2014-03-06
Posts: 64

Popup menu seems very small

I was trying show a popup menu on rightclick of a icon entry in notification area using gtk2.
I can get the menu in the item, but it very small. You can see in the custom icon I have set in notificatin area.
There is thin line extending over the Network Manager applet.

image.jpg

I wanted it to show "Quit" there. Any help on this will be really helpful. smile

void tray_icon_on_menu(GtkStatusIcon *status_icon, guint button, 
                       guint activate_time, gpointer user_data)
{
//        printf("Popup menu\n");
	GtkWidget*	menu;
	GtkWidget*	menuitem;	

	menu = gtk_menu_new();
	menuitem = gtk_menu_item_new_with_label("Quit");
	gtk_menu_attach(GTK_MENU(menu),menuitem,0,1,0,1);
	gtk_menu_popup(GTK_MENU(menu),NULL,NULL,NULL,user_data,button, gtk_get_current_event_time());
}

Keep Calm, And Enjoy Life smile

Offline

#2 2014-12-18 23:55:00

SahibBommelig
Member
From: Germany
Registered: 2010-05-28
Posts: 80

Re: Popup menu seems very small

Try adding this before the call to popup():

gtk_widget_show_all(menu);

Last edited by SahibBommelig (2014-12-18 23:57:11)

Offline

#3 2014-12-19 04:16:00

Debasish Patra
Member
Registered: 2014-03-06
Posts: 64

Re: Popup menu seems very small

SahibBommelig wrote:

Try adding this before the call to popup():

gtk_widget_show_all(menu);

Thanks SahibBommelig. Really appreciate the help. Its working now big_smile


Keep Calm, And Enjoy Life smile

Offline

Board footer

Powered by FluxBB