[gaim-migrate @ 10634]

Mon, 16 Aug 2004 04:22:21 +0000

author
Stu Tomlinson <nosnilmot@pidgin.im>
date
Mon, 16 Aug 2004 04:22:21 +0000
changeset 9766
2371af5578b6
parent 9765
e96eb185e767
child 9767
c68cfe03deec

[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: Mark Doliner <markdoliner@pidgin.im>

src/gtkconv.c file | annotate | diff | comparison | revisions
--- 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;
 }

mercurial