changeset 9766:14d997822897

[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 <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 16 Aug 2004 04:22:21 +0000
parents 5130709f3066
children c31e64c2bd85
files src/gtkconv.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }