# HG changeset patch # User Mark Doliner # Date 1092630141 0 # Node ID 14d9978228974761926e4b5b4af6f28651c21be8 # Parent 5130709f30667b32794c8334c38957059b59f92f [gaim-migrate @ 10634] A patch from Stu Tomlinson that lets plugins use Gaim's gaim_gtkconv_button_new() function to create buttons without tooltips and/or callbacks. I like how Stu uses if (tooltip != NULL) instead of if (!tooltip) I started doing that after I saw Chip do it/I did a lot of Java programming. I like it because I feel like it's more clear and makes the code more readable. committer: Tailor Script diff -r 5130709f3066 -r 14d997822897 src/gtkconv.c --- a/src/gtkconv.c Mon Aug 16 04:18:11 2004 +0000 +++ b/src/gtkconv.c Mon Aug 16 04:22:21 2004 +0000 @@ -3670,10 +3670,12 @@ (buttons == GAIM_BUTTON_IMAGE ? NULL : text), (buttons == GAIM_BUTTON_TEXT ? NULL : icon), GAIM_BUTTON_VERTICAL); - gtk_tooltips_set_tip(tooltips, button, tooltip, NULL); + if (tooltip != NULL) + gtk_tooltips_set_tip(tooltips, button, tooltip, NULL); gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); - g_signal_connect(G_OBJECT(button), "clicked", - G_CALLBACK(callback), data); + if (callback != NULL) + g_signal_connect(G_OBJECT(button), "clicked", + G_CALLBACK(callback), data); return button; }