src/gtkutils.c

changeset 10504
eae130eefbfe
parent 10483
e7b09a8b1f52
child 10566
b681d2b3dec5
equal deleted inserted replaced
10503:6f6f0b990441 10504:eae130eefbfe
298 298
299 GtkWidget * 299 GtkWidget *
300 gaim_pixbuf_button_from_stock(const char *text, const char *icon, 300 gaim_pixbuf_button_from_stock(const char *text, const char *icon,
301 GaimButtonOrientation style) 301 GaimButtonOrientation style)
302 { 302 {
303 GtkWidget *button, *image, *label, *bbox, *ibox, *lbox; 303 GtkWidget *button, *image, *label, *bbox, *ibox, *lbox = NULL;
304 304
305 button = gtk_button_new(); 305 button = gtk_button_new();
306 306
307 if (style == GAIM_BUTTON_HORIZONTAL) { 307 if (style == GAIM_BUTTON_HORIZONTAL) {
308 bbox = gtk_hbox_new(FALSE, 0); 308 bbox = gtk_hbox_new(FALSE, 0);
309 ibox = gtk_hbox_new(FALSE, 0); 309 ibox = gtk_hbox_new(FALSE, 0);
310 lbox = gtk_hbox_new(FALSE, 0); 310 if (text)
311 lbox = gtk_hbox_new(FALSE, 0);
311 } else { 312 } else {
312 bbox = gtk_vbox_new(FALSE, 0); 313 bbox = gtk_vbox_new(FALSE, 0);
313 ibox = gtk_vbox_new(FALSE, 0); 314 ibox = gtk_vbox_new(FALSE, 0);
314 lbox = gtk_vbox_new(FALSE, 0); 315 if (text)
316 lbox = gtk_vbox_new(FALSE, 0);
315 } 317 }
316 318
317 gtk_container_add(GTK_CONTAINER(button), bbox); 319 gtk_container_add(GTK_CONTAINER(button), bbox);
318 320
319 if (icon) { 321 if (icon) {

mercurial