Ethereal-dev: Re: [Ethereal-dev] [patch] simply bug in toolbar.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Wed, 29 Oct 2003 14:43:30 -0800

On Oct 29, 2003, at 12:25 AM, Ulf Lamping wrote:

As the construct_args parameter is NULL in this case, I get an access violation.

The difference in dfilter_dialog_cb() and display_filter_construct_cb() is exactly creating this construct_args field.

Yes, "dfilter_dialog_cb()" is the routine to construct an "Edit Display Filters" dialog box, and "display_filter_construct_cb()" is the routine to construct a dialog box for constructing a display filter.

BTW: This is a GTK2 problem, as I tried it without the patch with GTK1 and have no problems. Please don't ask me why this is working in GTK1 and not in GTK2, as I don't see the any difference at this point :-(

It looks like a GTK2 *bug*. At least as I read the documentation, the last argument to "gtk_toolbar_append_item()" is the user data to be passed to the callback; if that's not being passed to "display_filter_construct_cb()", that sounds like a bug. The only other possibility I can see is that the calling sequence for toolbar callbacks changed between GTK+ 1.2[.x] and GTK+ 2.x, so that the user data isn't passed as the second argument.

I've checked in a change to call "dfilter_dialog_cb()" *AND* to get rid of the "args" structure and pass NULL to the callback.

Nonetheless, the functions called from menu.c () "Edit/Display Filters" and toolbar.c icon should be the same in any case.

Or, at least, the function called from a toolbar "Edit Display Filters" icon should be the same as the function called from "Edit -> Display Filters".

However, before "args" is declared in "get_main_toolbar()", there's a comment that says, among other things,

* XXX - Adding the "Ok" and "Apply" buttons would need some more work here

The work in question means turning it from an "Edit Display Filters" button to a "Filter Display" button, which would presumably work the same way the "Filter:" button in the status line works (otherwise, the "Ok" and "Apply" buttons wouldn't make any sense and wouldn't belong there). Is that what you had in mind?