Derive from GtkDialog, and use stock buttons. Should be 100% source
2000-11-02 Havoc Pennington <hp@redhat.com> * gtk/gtkfilesel.h, gtk/gtkfilesel.c: Derive from GtkDialog, and use stock buttons. Should be 100% source compatible, appropriate filesel fields now point to dialog->vbox and dialog->action_area. On the bizarre side, dialog->action_area and filesel->action_area are not the same widget. (gtk_file_selection_init): Put some padding around the selection entry, so it isn't touching the GtkDialog separator. * gtk/gtkfontsel.h, gtk/gtkfontsel.c: Derive from GtkDialog, use stock buttons, etc. Should also be source compatible. Set the dialog default title in _init not _new(). * gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): Use stock buttons; don't put a button box inside the existing dialog button box. Don't bother with push/pop colormap anymore. * gtk/gtkdialog.h (GtkResponseType): Add a bunch of more specific GTK_RESPONSE_* values. This is clearer than ACCEPT/REJECT for message dialog, and necessary for the font selection and color selection with help and apply buttons. * gtk/gtkdialog.c (gtk_dialog_add_button): Return a pointer to the created button widget. Set GTK_CAN_DEFAULT on the button. (gtk_dialog_init): Default to GTK_BUTTONBOX_END, put less spacing between buttons, put less padding around the action area. (gtk_dialog_run): Exit on unmap rather than on destroy. This will also exit the loop if the widget is hidden. (gtk_dialog_delete_event_handler): Use GTK_RESPONSE_DELETE_EVENT instead of GTK_RESPONSE_NONE; since we're already adding a bunch of GTK_RESPONSE_* stuff, this seems cleaner, and lets you special-case delete event. * gtk/gtktexttagtable.c, gtk/gtktextview.c: Fix doc comment formatting
This commit is contained in:
committed by
Havoc Pennington
parent
8aef169f86
commit
69f42512fa
@ -150,11 +150,9 @@ setup_type(GtkMessageDialog *dialog, GtkMessageType type)
|
||||
*
|
||||
* Creates a new message dialog, which is a simple dialog with an icon
|
||||
* indicating the dialog type (error, warning, etc.) and some text the
|
||||
* user may want to see. If the button set you select with the @buttons
|
||||
* argument has positive buttons (OK, Yes) they will result in a response ID
|
||||
* of GTK_RESPONSE_ACCEPT. If it has negative buttons (Cancel, No) they will
|
||||
* result in a response ID of GTK_RESPONSE_REJECT. See #GtkDialog for more
|
||||
* details.
|
||||
* user may want to see. When the user clicks a button a "response"
|
||||
* signal is emitted with response IDs from #GtkResponseType. See
|
||||
* #GtkDialog for more details.
|
||||
*
|
||||
* Return value: a new #GtkMessageDialog
|
||||
**/
|
||||
@ -209,37 +207,37 @@ gtk_message_dialog_new (GtkWindow *parent,
|
||||
case GTK_BUTTONS_OK:
|
||||
gtk_dialog_add_button (dialog,
|
||||
GTK_STOCK_BUTTON_OK,
|
||||
GTK_RESPONSE_ACCEPT);
|
||||
GTK_RESPONSE_OK);
|
||||
break;
|
||||
|
||||
case GTK_BUTTONS_CLOSE:
|
||||
gtk_dialog_add_button (dialog,
|
||||
GTK_STOCK_BUTTON_CLOSE,
|
||||
GTK_RESPONSE_ACCEPT);
|
||||
GTK_RESPONSE_CLOSE);
|
||||
break;
|
||||
|
||||
case GTK_BUTTONS_CANCEL:
|
||||
gtk_dialog_add_button (dialog,
|
||||
GTK_STOCK_BUTTON_CANCEL,
|
||||
GTK_RESPONSE_REJECT);
|
||||
GTK_RESPONSE_CANCEL);
|
||||
break;
|
||||
|
||||
case GTK_BUTTONS_YES_NO:
|
||||
gtk_dialog_add_button (dialog,
|
||||
GTK_STOCK_BUTTON_YES,
|
||||
GTK_RESPONSE_ACCEPT);
|
||||
GTK_RESPONSE_YES);
|
||||
gtk_dialog_add_button (dialog,
|
||||
GTK_STOCK_BUTTON_NO,
|
||||
GTK_RESPONSE_REJECT);
|
||||
GTK_RESPONSE_NO);
|
||||
break;
|
||||
|
||||
case GTK_BUTTONS_OK_CANCEL:
|
||||
gtk_dialog_add_button (dialog,
|
||||
GTK_STOCK_BUTTON_OK,
|
||||
GTK_RESPONSE_ACCEPT);
|
||||
GTK_RESPONSE_OK);
|
||||
gtk_dialog_add_button (dialog,
|
||||
GTK_STOCK_BUTTON_CANCEL,
|
||||
GTK_RESPONSE_REJECT);
|
||||
GTK_RESPONSE_CANCEL);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user