Re: [Usability] Re: RFE - API change from GtkMessageDialog to GtkAlert



Maciej Stachowiak <mjs noisehavoc org> writes: 
> The only critical flaw with the current GtkMessageDialog API is that
> it only allows button labels that come from a fairly small fixed set
> (OK, Yes, No, Cancel, Close), and only in a restricted set of
> combinations (for example three buttons are not possible).

That's not the case - the fixed set is just for the convenience
constructor, because the varargs were already used for the message, so
we couldn't use the varargs for buttons.

You do this (example from msm):
      
      saved->error_dialog =
        gtk_message_dialog_new (NULL,
                                0,
                                GTK_MESSAGE_ERROR,
                                GTK_BUTTONS_NONE,
                                _("The application '%s' has been
        restarted several times in the last few seconds, but crashed
        or exited each time. What do you want to do with this
        application?"),
                                name);

      gtk_dialog_add_buttons (GTK_DIALOG (saved->error_dialog),
                              _("_Keep restarting"),
                              RESPONSE_KEEP_TRYING,
                              _("_Never restart again"),
                              RESPONSE_REMOVE,
                              _("_Stop restarting for now"),
                              RESPONSE_DISABLE,
                              NULL);

GtkMessageDialog is a GtkDialog subclass, so supports the same
operations as GtkDialog, right.

Havoc



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