Re: GNOME CVS: bonobo dietmar



Thanks for this hint. But I don't think calling gnome_dialog_close works. You have
do rewrite more than a few lines of code. I have only tried to fix that bug. Maybe
I've done it the wrong way, but it works (at least on my machine).

IMHO it is better to have a dirty, but working implementation?
Although a clean and working solution is better. ;-)

Federico Mena Quintero wrote:

> >  Modified files:
> >       .              : ChangeLog
> >       bonobo         : gnome-bonobo-selector.c
> >
> >  Log message:
> >  Wed Dec  1 15:45:55 1999  Dietmar Maurer  <dm@vlsivie.tuwien.ac.at>
> >
> >  * bonobo/gnome-bonobo-selector.c (select_row): bug fix: emit a clicked
> >  signal to simulate an OK button press.
>
> The relevant code is
>
>         static void
>         select_row (GtkCList *clist, gint row, gint col,
>                     GdkEvent *event, GnomeBonoboSelector *sel)
>         {
>                 if (event && event->type == GDK_2BUTTON_PRESS)
>                         gtk_signal_emit_by_name(GTK_OBJECT(sel), "clicked", 0);
>                 ...
>
> This is a hack and is wrong for several reasons:
>
>         1. GnomeDialog::clicked is not a GTK_RUN_ACTION signal,
>            meaning that it is not kosher for code which is not part of
>            GnomeDialog itself to emit the signal.
>
>         2. If you really wanted to do that, GnomeDialog should provide
>            a function to request that a click be simulated, a la
>            gtk_button_clicked().
>
>         3. You are defining that "activating" the thing actually means
>            "clicking on a button".  This is not very good practice.
>            You should not tie your internal semantics to the way they
>            are represented in the user interface.
>
> If the user double clicks on an item, then the bonobo selector should
> gnome_dialog_close() itself by hand and emit the proper notification
> signal.
>
>   Federico



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]