On Fri, 5 Jan 2001, Hans Breuer wrote:

> At 10:30 02.11.00 +0800, James Henstridge wrote:
> >On Tue, 31 Oct 2000, Hans Breuer wrote:
> >> At 09:14 31.10.00 +0800, James Henstridge wrote:
> >> >On Fri, 27 Oct 2000, Hans Breuer wrote:
> >> >
> >> >> the recent NLS patch has triggered a bug related to every menu 
> >> >> callback functions. 
> >> >> 
> >> >> [...]
> >> >Ugh.  This is going to cause some problems.
> >> >
> >> >The GNOME version of the menus use the same set of callbacks, and the
> >> >signature they require is (GtkWidget *, gpointer).  In all cases, we don't
> >> >care about the GtkWidget* argument, so we just need to make sure that 
> >> >the action (item factory) / user_data (gnome menus) is the second
> >> >argument.  Is there any particular reasons to switch to the other ordering
> >> >for the callback arguments for the item factory based code?
> >> >
> >> The small sollution could be to adapt only the two (?) functions requiring
> >> the action parameter and #ifdef GNOME there declaration. Should I commit
> >> such a sollution?
> >> 
> >> void
> >> #ifdef GNOME
> >> view_zoom_set_callback(GtkWidget *widget, gpointer data)
> >> #else
> >> view_zoom_set_callback(GtkWidget *widget, gpointer data, guint action)
> >> #endif
> >
> >I will have to think about this a bit more.
> >
> Hi James,
> For the records: I have just committed the minimum patch descried above. 
> 
> 2001-01-05  Hans Breuer <[EMAIL PROTECTED]>
> 
>       * app/commands.[hc] : corrected the signature for gtk menu callback
>       functions, which actually use the second or third parameter. This
>       is the absolute minimum change to make these functions/menu entries
>       work again. Using the other possible gtk menu callback signature
>       would have required one more function to change. (see mailing list
>       thread "Objects/Align/Equal Distance" for more information.
> 
> 
> These are the reasons:
> 
> Setting the 2 to 1 in the following call (menus.c) :
>   menus_create_items (display_item_factory,
>                     display_nmenu_items,
>                     display_menu_items,
>                     NULL, 2);
> 
> would require the following functions to be treated special,
> cause they are using the widget parameter.
> 
> view_aa_callback
> view_visible_grid_callback
> view_snap_to_grid_callback
> view_toggle_rulers_callback
> 
> I still think the much cleaner way to do all this, would be to change *all*
> menu call back functions, as suggested in my previous patch. But the
> changes described here, are the absolute minimum to make Dia work as expected
> again.

Hmm.  Maybe it would be possible to change things for the gnome menus
using a custom GnomeUIBuilderData set of callbacks for building the gnome
menus, which would use a proxy callback that would reorder the arguments.

I suppose I can look at doing this.

Hopefully with gtk 2.0/gnome-libs 2.0 we can switch back to only having a
single set of menu code.

James.

Reply via email to