Re: HIG Dialog widget proposal


On Mon, 2004-07-12 at 21:12 -0400, Matthias Clasen wrote:
> > GtkWidget *dialog = whatever_message_dialog (window,
> >                                              GTK_DIALOG_MODAL,
> >                                              GTK_MESSAGE_WARNING,
> >                                              "Delete filesystem?",                   /* primary text */
> >                                              "You will not be able to recover data", /* secondary text */
> >                                              GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
> >                                              "Delete it!", GTK_RESPONSE_OK,
> >                                              NULL);
> > 
> > I really think that we should have a constructor like this, for not
> > needing to do gtk_message_dialog_new(),
> > gtk_message_dialog_set_secondary_text() remove the buttons and
> > gtk_add_buttons() every time anyone wants to create a HIG-like dialog
> That makes sense to me. A one-stop constructor for the common
> cases is very convenient.
> > void       gst_hig_dialog_set_primary_text (GstHigDialog *dialog,
> >                                             const gchar  *message_format,
> >                                             ...) G_GNUC_PRINTF (2, 3);
> > 
> > void       gst_hig_dialog_set_secondary_text (GstHigDialog *dialog,
> >                                               const gchar  *message_format,
> >                                               ...) G_GNUC_PRINTF (2, 3);
> This too. We will need set_{primary,secondary}_markup as well.

ok, some time later, I've mixed the current GtkMessageDialog code and
the proposals I got in this list, you can see the current work in:

Here's a little list of issues I've found:

- In the code I proposed I've marked as deprecated the old functions, as
(IMHO) they duplicate functionality that's found in the new API (at
least the gtk_message_dialog_set_markup() <=>
gtk_message_dialog_set_secondary_markup() bit)

- _set_primary_markup() sets the initial (untouched) font style for the
title label and let's the users use their own markup, while
_set_primary_text() sets automatically bold and larger fonts

- I'd like to consider for adition an _add_extra_widget(), it could be
really useful for adding username/password/protocol/host/whatever in
authentication dialogs

Anyway, I think that this code keeps backwards compatibility and I
really think that an API like this could be really nice to have. What do
you think?

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