comparison pidgin/gtkmenutray.c @ 24060:824e346c5713

Change some menutray internals. This makes the tray-icons behave better.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 18 Sep 2008 16:19:11 +0000
parents 13a9b56f83b0
children 1a94a964bddf
comparison
equal deleted inserted replaced
24057:cd35c0f680b9 24060:824e346c5713
82 break; 82 break;
83 } 83 }
84 } 84 }
85 85
86 static void 86 static void
87 pidgin_menu_tray_map(GtkWidget *widget)
88 {
89 GTK_WIDGET_CLASS(parent_class)->map(widget);
90 gtk_container_add(GTK_CONTAINER(widget),
91 PIDGIN_MENU_TRAY(widget)->tray);
92 }
93
94 static void
87 pidgin_menu_tray_finalize(GObject *obj) 95 pidgin_menu_tray_finalize(GObject *obj)
88 { 96 {
89 PidginMenuTray *tray = PIDGIN_MENU_TRAY(obj); 97 PidginMenuTray *tray = PIDGIN_MENU_TRAY(obj);
90 #if 0 98 #if 0
91 /* This _might_ be leaking, but I have a sneaking suspicion that the widget is 99 /* This _might_ be leaking, but I have a sneaking suspicion that the widget is
107 115
108 static void 116 static void
109 pidgin_menu_tray_class_init(PidginMenuTrayClass *klass) { 117 pidgin_menu_tray_class_init(PidginMenuTrayClass *klass) {
110 GObjectClass *object_class = G_OBJECT_CLASS(klass); 118 GObjectClass *object_class = G_OBJECT_CLASS(klass);
111 GtkItemClass *item_class = GTK_ITEM_CLASS(klass); 119 GtkItemClass *item_class = GTK_ITEM_CLASS(klass);
120 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
112 GParamSpec *pspec; 121 GParamSpec *pspec;
113 122
114 parent_class = g_type_class_peek_parent(klass); 123 parent_class = g_type_class_peek_parent(klass);
115 124
116 object_class->finalize = pidgin_menu_tray_finalize; 125 object_class->finalize = pidgin_menu_tray_finalize;
117 object_class->get_property = pidgin_menu_tray_get_property; 126 object_class->get_property = pidgin_menu_tray_get_property;
118 127
119 item_class->select = pidgin_menu_tray_select; 128 item_class->select = pidgin_menu_tray_select;
120 item_class->deselect = pidgin_menu_tray_deselect; 129 item_class->deselect = pidgin_menu_tray_deselect;
130
131 widget_class->map = pidgin_menu_tray_map;
121 132
122 pspec = g_param_spec_object("box", "The box", 133 pspec = g_param_spec_object("box", "The box",
123 "The box", 134 "The box",
124 GTK_TYPE_BOX, 135 GTK_TYPE_BOX,
125 G_PARAM_READABLE); 136 G_PARAM_READABLE);
150 #endif 161 #endif
151 { 162 {
152 gtk_widget_set_size_request(widget, -1, height); 163 gtk_widget_set_size_request(widget, -1, height);
153 } 164 }
154 165
155 gtk_container_add(GTK_CONTAINER(menu_tray), menu_tray->tray);
156
157 gtk_widget_show(menu_tray->tray); 166 gtk_widget_show(menu_tray->tray);
158 } 167 }
159 168
160 /****************************************************************************** 169 /******************************************************************************
161 * API 170 * API