Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 37929: /trunk/gtk/ /trunk/gtk/: main

From: Michael Tüxen <Michael.Tuexen@xxxxxxxxxxxxxxxxx>
Date: Fri, 8 Jul 2011 19:44:10 +0200
On Jul 8, 2011, at 6:57 PM, Maynard, Chris wrote:

>> -----Original Message-----
>> From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-
>> bounces@xxxxxxxxxxxxx] On Behalf Of Michael Tüxen
>> Sent: Friday, July 08, 2011 12:34 PM
>> To: Developer support list for Wireshark
>> Subject: Re: [Wireshark-dev] [Wireshark-commits] rev 37929: /trunk/gtk/
>> /trunk/gtk/: main_welcome.c
>> 
>> On Jul 8, 2011, at 6:23 PM, Maynard, Chris wrote:
>> 
>>>> -----Original Message-----
>>>> From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-
>>>> bounces@xxxxxxxxxxxxx] On Behalf Of Michael Tüxen
>>>> Sent: Friday, July 08, 2011 11:19 AM
>>>> To: Developer support list for Wireshark
>>>> Subject: Re: [Wireshark-dev] [Wireshark-commits] rev 37929:
>> /trunk/gtk/
>>>> /trunk/gtk/: main_welcome.c
>>>> 
>>>> How can I get an interface which shows the problem? (I'm not a
>> windows
>>>> user,
>>>> so please be precise...).
>>> 
>>> Here's an article that should be helpful:
>> http://support.microsoft.com/kb/839013
>> Thanks a lot.
>> 
>> I can reproduce the problem (using VMWare Interfaces).
>> 
>> I'll try to fix it. Maybe it has to wait until Irene is back from
>> vacation...
> 
> OK, good because I sent you the wrong link by mistake.  I think the "generic dialup and VPN capture" interface is actually installed with the Cisco VPN client software.  But I noticed that both the VMWare Interfaces and the "generic dialup" interfaces use the xpm_to_widget() call while the others use the pixbuf_to_widget() call, so I made the following quick code change and the icon is now displayed.  I don't know if it's the right change to make though.  Well if not, maybe it'll give you or Irene a hint at least.
> 
> Index: gtk/gui_utils.c
> ===================================================================
> --- gtk/gui_utils.c     (revision 37937)
> +++ gtk/gui_utils.c     (working copy)
> @@ -578,7 +578,7 @@
>     pixbuf = gdk_pixbuf_new_from_xpm_data(xpm);
>     gdk_pixbuf_render_pixmap_and_mask_for_colormap (pixbuf, gtk_widget_get_colormap(parent), &pixmap, &bitmap, 128);
> 
> -    return gtk_image_new_from_pixmap (pixmap, bitmap);
> +    return gtk_image_new_from_pixbuf(pixbuf);
> }
I've looked at the code... The problem is that in main_welcome.c the column which contains
the icon is declared as GDK_TYPE_PIXBUF. The icons are widgets. It looks like you can't use
xpm_to_widget to create a widget from an xmp and then use gtk_image_get_pixbuf(GTK_IMAGE(icon))
to get a pixbuf.

Declaring the column as GTK_TYPE_WIDGET should work, but I don't know what to write instead of
        renderer = gtk_cell_renderer_pixbuf_new();
        column = gtk_tree_view_column_new_with_attributes ("",
                                               GTK_CELL_RENDERER(renderer),
                                               "pixbuf", 0,
                                               NULL);

There does not seem to be a call for gtk_cell_renderer_widget_new()...

Does anyone know how to deal with it?

Best regards
Michael
> 
> 
> - Chris
> 
> 
> 
> 
> CONFIDENTIALITY NOTICE: The contents of this email are confidential
> and for the exclusive use of the intended recipient. If you receive this
> email in error, please delete it from your system immediately and 
> notify us either by email, telephone or fax. You should not copy,
> forward, or otherwise disclose the content of the email.
> 
> ___________________________________________________________________________
> Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
> Archives:    http://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
>             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe
>