dbus-viewer needs really new gtk2?

Tako Schotanus quintesse at palacio-cristal.com
Tue Mar 29 15:07:37 PST 2005


Havoc Pennington wrote:

>On Tue, 2005-03-29 at 00:50 +0200, Tako Schotanus wrote:
>  
>
>>I'm getting a compiler error for the dbsu-viewer in the tools folder:
>>
>>dbus-viewer.o(.text+0x713): In function `name_combo_changed_callback':
>>/home/tako/projects/dbus/dbus/tools/dbus-viewer.c:383: undefined 
>>reference to `gtk_combo_box_get_active_text'
>>
>>Googling around I find a reference that this function only exists in 
>>gtk2 2.6 and higher, my gtk2 is 2.4 so I guess this is standard on FC3. 
>>Is it possible to rewrite this viewer to not use this function? I know 
>>this is all cutting edge technology but I'd rather not upgrade my entire 
>>system just to compile a dbus tool :-)
>>
>>    
>>
>
>dbus-viewer isn't really good for anything right now, and I think gtk
>2.6 will be common by the time dbus reaches 1.0.
>
>If someone wants to patch it out though that's fine with me.
>
>Havoc
>
>  
>
Done ;-)

-Tako


-------------- next part --------------
Index: tools/dbus-viewer.c
===================================================================
RCS file: /cvs/dbus/dbus/tools/dbus-viewer.c,v
retrieving revision 1.11
diff -u -2 -r1.11 dbus-viewer.c
--- tools/dbus-viewer.c	17 Feb 2005 21:19:48 -0000	1.11
+++ tools/dbus-viewer.c	29 Mar 2005 23:05:15 -0000
@@ -379,12 +379,19 @@
                              TreeWindow  *w)
 {
-  char *text;
+  GtkTreeIter iter;
 
-  text = gtk_combo_box_get_active_text (combo);
-
-  if (text)
+  if (gtk_combo_box_get_active_iter (combo, &iter))
     {
-      tree_window_set_service (w, text);
-      g_free (text);
+      GtkTreeModel *model;
+      char *text;
+
+      model = gtk_combo_box_get_model (combo);
+      gtk_tree_model_get (model, &iter, 0, &text, -1);
+
+      if (text)
+        {
+          tree_window_set_service (w, text);
+          g_free (text);
+        }
     }
 }


More information about the dbus mailing list