comparison src/gtkutils.c @ 5160:91ea5ef2278b

[gaim-migrate @ 5524] 1) Added neat little protocol icons next to the set away message menu when you have more than one account signed on. I basically just copied Nathan's code, so it should be ok. 2) Changed the horizontal rules in the away message menu so they show up for me. This is how horizontal rules are done in other menus, I'm not sure why the away message menu was different. 3) Moved 2 gtkish functions from util.c to gtkutils.c. Earlier I used one of these functions, and then earlier, but not as early, I realized that gtkutils.c existed, so I put 2 and 2 together and realized you were probably flying somewhere. Well then, let's put another shrimp on the barbi'! committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 18 Apr 2003 02:28:06 +0000
parents a9a831508b43
children b8eafeb874a1
comparison
equal deleted inserted replaced
5159:6b845e0cea87 5160:91ea5ef2278b
399 399
400 menuitem = gtk_separator_menu_item_new(); 400 menuitem = gtk_separator_menu_item_new();
401 gtk_widget_show(menuitem); 401 gtk_widget_show(menuitem);
402 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); 402 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
403 } 403 }
404
405 GtkWidget *gaim_new_item_from_stock(GtkWidget *menu, const char *str, const char *icon, GtkSignalFunc sf, gpointer data, guint accel_key, guint accel_mods, char *mod)
406 {
407 GtkWidget *menuitem;
408 /*
409 GtkWidget *hbox;
410 GtkWidget *label;
411 */
412 GtkWidget *image;
413
414 if (icon == NULL)
415 menuitem = gtk_menu_item_new_with_mnemonic(str);
416 else
417 menuitem = gtk_image_menu_item_new_with_mnemonic(str);
418
419 if (menu)
420 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
421
422 if (sf)
423 g_signal_connect(GTK_OBJECT(menuitem), "activate", sf, data);
424
425 if (icon != NULL) {
426 image = gtk_image_new_from_stock(icon, GTK_ICON_SIZE_MENU);
427 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
428 }
429 /* FIXME: this isn't right
430 if (mod) {
431 label = gtk_label_new(mod);
432 gtk_box_pack_end(GTK_BOX(hbox), label, FALSE, FALSE, 2);
433 gtk_widget_show(label);
434 }
435 */
436 /*
437 if (accel_key) {
438 gtk_widget_add_accelerator(menuitem, "activate", accel, accel_key,
439 accel_mods, GTK_ACCEL_LOCKED);
440 }
441 */
442
443 gtk_widget_show_all(menuitem);
444
445 return menuitem;
446 }
447
448 GtkWidget *gaim_new_item(GtkWidget *menu, const char *str)
449 {
450 GtkWidget *menuitem;
451 GtkWidget *label;
452
453 menuitem = gtk_menu_item_new();
454 if (menu)
455 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
456 gtk_widget_show(menuitem);
457
458 label = gtk_label_new(str);
459 gtk_label_set_pattern(GTK_LABEL(label), "_");
460 gtk_container_add(GTK_CONTAINER(menuitem), label);
461 gtk_widget_show(label);
462 /* FIXME: Go back and fix this
463 gtk_widget_add_accelerator(menuitem, "activate", accel, str[0],
464 GDK_MOD1_MASK, GTK_ACCEL_LOCKED);
465 */
466 return menuitem;
467 }