gtk2/gtk/gtkdialog.h

180 lines
6.1 KiB
C
Raw Normal View History

1997-11-24 22:37:52 +00:00
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
1997-11-24 22:37:52 +00:00
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
1997-11-24 22:37:52 +00:00
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
1997-11-24 22:37:52 +00:00
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
1997-11-24 22:37:52 +00:00
#ifndef __GTK_DIALOG_H__
#define __GTK_DIALOG_H__
#include <gdk/gdk.h>
#include <gtk/gtkwindow.h>
G_BEGIN_DECLS
1997-11-24 22:37:52 +00:00
create some stock buttons with the default accel group (create_image): 2000-10-04 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c (create_buttons): create some stock buttons with the default accel group (create_image): test some new GtkImage features (make_message_dialog): test GtkMessageDialog (create_modal_window): fix someone's bizzarro indentation * gtk/gtkwindow.h, gtk/gtkwindow.c: Implement GTK_WIN_POS_CENTER_ON_PARENT. Add "destroy with parent" setting, which means the window goes away with its transient parent. (gtk_window_get_default_accel_group): get the default accel group for the window. (gtk_window_set_destroy_with_parent): set/unset destroy with parent flag (gtk_window_read_rcfiles): invalidate icon set caches after reloading rcfiles * gtk/gtkenums.h (GtkWindowPosition): add GTK_WIN_POS_CENTER_ON_PARENT, which centers a dialog on its parent window when the dialog is mapped for the first time. * gtk/gtkmessagedialog.h, gtk/gtkmessagedialog.c: Add a simple message dialog class * gtk/gtkdialog.c (gtk_dialog_init): Connect delete event handler to emit response signal, and maybe later it would honor a hide_on_delete flag - though that isn't there yet. Set border width on the vbox to 2, so we get some padding. Use a button box for the action area. (gtk_dialog_key_press): synthesize a delete event if Esc is pressed and the GtkWidget key press handler didn't handle the escape key. (gtk_dialog_new_with_buttons): new function creates a dialog with some default buttons in it. (gtk_dialog_add_action_widget): add an activatable widget as a button in the dialog - you can also add a non-activatable widget by accessing the action area directly. (gtk_dialog_add_button): add a simple button - stock ID or label - to the action area (gtk_dialog_response): emit response signal (gtk_dialog_run): block waiting for the dialog, return the response. Override normal delete_event behavior, so that delete_event does nothing inside gtk_dialog_run(). * gtk/gtkdialog.h, gtk/gtkdialog.c: Add "response" signal emitted when an action widget is clicked or the dialog gets delete_event * gtk/gtk.h: add gtkmessagedialog.h * gtk/Makefile.am: add gtkmessagedialog.[hc] 2000-10-20 Havoc Pennington <hp@redhat.com> * gtk/gtk-sections.txt: Add dialog docs
2000-10-20 23:14:41 +00:00
/* Parameters for dialog construction */
typedef enum
{
GTK_DIALOG_MODAL = 1 << 0, /* call gtk_window_set_modal (win, TRUE) */
GTK_DIALOG_DESTROY_WITH_PARENT = 1 << 1, /* call gtk_window_set_destroy_with_parent () */
GTK_DIALOG_NO_SEPARATOR = 1 << 2 /* no separator bar above buttons */
create some stock buttons with the default accel group (create_image): 2000-10-04 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c (create_buttons): create some stock buttons with the default accel group (create_image): test some new GtkImage features (make_message_dialog): test GtkMessageDialog (create_modal_window): fix someone's bizzarro indentation * gtk/gtkwindow.h, gtk/gtkwindow.c: Implement GTK_WIN_POS_CENTER_ON_PARENT. Add "destroy with parent" setting, which means the window goes away with its transient parent. (gtk_window_get_default_accel_group): get the default accel group for the window. (gtk_window_set_destroy_with_parent): set/unset destroy with parent flag (gtk_window_read_rcfiles): invalidate icon set caches after reloading rcfiles * gtk/gtkenums.h (GtkWindowPosition): add GTK_WIN_POS_CENTER_ON_PARENT, which centers a dialog on its parent window when the dialog is mapped for the first time. * gtk/gtkmessagedialog.h, gtk/gtkmessagedialog.c: Add a simple message dialog class * gtk/gtkdialog.c (gtk_dialog_init): Connect delete event handler to emit response signal, and maybe later it would honor a hide_on_delete flag - though that isn't there yet. Set border width on the vbox to 2, so we get some padding. Use a button box for the action area. (gtk_dialog_key_press): synthesize a delete event if Esc is pressed and the GtkWidget key press handler didn't handle the escape key. (gtk_dialog_new_with_buttons): new function creates a dialog with some default buttons in it. (gtk_dialog_add_action_widget): add an activatable widget as a button in the dialog - you can also add a non-activatable widget by accessing the action area directly. (gtk_dialog_add_button): add a simple button - stock ID or label - to the action area (gtk_dialog_response): emit response signal (gtk_dialog_run): block waiting for the dialog, return the response. Override normal delete_event behavior, so that delete_event does nothing inside gtk_dialog_run(). * gtk/gtkdialog.h, gtk/gtkdialog.c: Add "response" signal emitted when an action widget is clicked or the dialog gets delete_event * gtk/gtk.h: add gtkmessagedialog.h * gtk/Makefile.am: add gtkmessagedialog.[hc] 2000-10-20 Havoc Pennington <hp@redhat.com> * gtk/gtk-sections.txt: Add dialog docs
2000-10-20 23:14:41 +00:00
} GtkDialogFlags;
handle case where there are no rows in the model 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where there are no rows in the model * gtk/gtkliststore.c (gtk_list_store_iter_children): if parent is NULL, then return the start of the list * gtk/gtktreeview.c (gtk_tree_view_setup_model): don't build tree if we can't get any rows from an empty model * gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): remove extraneous * after function pointer typedef usage * Makefile.am: don't specify full path to cp and rm * gtk/gtkcellrenderertextpixbuf.c (gtk_cell_renderer_text_pixbuf_get_size): check width/height != NULL before dereferencing, fixes a segfault that happened from time to time * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_render): use gdk_pixbuf_render_to_drawable_alpha() to get alpha channel, and reindent the function (gtk_cell_renderer_pixbuf_get_size): indentation * gtk/gtkdialog.c (gtk_dialog_run): destroy main loop only after we quit it (gtk_dialog_add_buttons_valist): add g_return_if_fail (gtk_dialog_set_default_response): New function, to set default button (gtk_dialog_set_response_sensitive): New function, to set sensitivity of buttons * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_property): allow getting a NULL pixbuf (gtk_cell_renderer_pixbuf_set_property): allow setting a NULL pixbuf * gtk/gtktreedatalist.c (_gtk_tree_data_list_node_to_value): handle any G_TYPE_OBJECT subclass, not just the base class, and also boxed types. (_gtk_tree_data_list_value_to_node): ditto * gtk/gtkrbtree.c: Run _gtk_rbtree_test at strategic points if --gtk-debug=tree * gtk/gtkmain.c: add GTK_DEBUG_TREE * gtk/gtkdebug.h: add GTK_DEBUG_TREE
2001-01-09 17:45:34 +00:00
/* Convenience enum to use for response_id's. Positive values are
create some stock buttons with the default accel group (create_image): 2000-10-04 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c (create_buttons): create some stock buttons with the default accel group (create_image): test some new GtkImage features (make_message_dialog): test GtkMessageDialog (create_modal_window): fix someone's bizzarro indentation * gtk/gtkwindow.h, gtk/gtkwindow.c: Implement GTK_WIN_POS_CENTER_ON_PARENT. Add "destroy with parent" setting, which means the window goes away with its transient parent. (gtk_window_get_default_accel_group): get the default accel group for the window. (gtk_window_set_destroy_with_parent): set/unset destroy with parent flag (gtk_window_read_rcfiles): invalidate icon set caches after reloading rcfiles * gtk/gtkenums.h (GtkWindowPosition): add GTK_WIN_POS_CENTER_ON_PARENT, which centers a dialog on its parent window when the dialog is mapped for the first time. * gtk/gtkmessagedialog.h, gtk/gtkmessagedialog.c: Add a simple message dialog class * gtk/gtkdialog.c (gtk_dialog_init): Connect delete event handler to emit response signal, and maybe later it would honor a hide_on_delete flag - though that isn't there yet. Set border width on the vbox to 2, so we get some padding. Use a button box for the action area. (gtk_dialog_key_press): synthesize a delete event if Esc is pressed and the GtkWidget key press handler didn't handle the escape key. (gtk_dialog_new_with_buttons): new function creates a dialog with some default buttons in it. (gtk_dialog_add_action_widget): add an activatable widget as a button in the dialog - you can also add a non-activatable widget by accessing the action area directly. (gtk_dialog_add_button): add a simple button - stock ID or label - to the action area (gtk_dialog_response): emit response signal (gtk_dialog_run): block waiting for the dialog, return the response. Override normal delete_event behavior, so that delete_event does nothing inside gtk_dialog_run(). * gtk/gtkdialog.h, gtk/gtkdialog.c: Add "response" signal emitted when an action widget is clicked or the dialog gets delete_event * gtk/gtk.h: add gtkmessagedialog.h * gtk/Makefile.am: add gtkmessagedialog.[hc] 2000-10-20 Havoc Pennington <hp@redhat.com> * gtk/gtk-sections.txt: Add dialog docs
2000-10-20 23:14:41 +00:00
* totally user-interpreted. GTK will sometimes return
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
2000-11-06 16:44:01 +00:00
* GTK_RESPONSE_NONE if no response_id is available.
create some stock buttons with the default accel group (create_image): 2000-10-04 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c (create_buttons): create some stock buttons with the default accel group (create_image): test some new GtkImage features (make_message_dialog): test GtkMessageDialog (create_modal_window): fix someone's bizzarro indentation * gtk/gtkwindow.h, gtk/gtkwindow.c: Implement GTK_WIN_POS_CENTER_ON_PARENT. Add "destroy with parent" setting, which means the window goes away with its transient parent. (gtk_window_get_default_accel_group): get the default accel group for the window. (gtk_window_set_destroy_with_parent): set/unset destroy with parent flag (gtk_window_read_rcfiles): invalidate icon set caches after reloading rcfiles * gtk/gtkenums.h (GtkWindowPosition): add GTK_WIN_POS_CENTER_ON_PARENT, which centers a dialog on its parent window when the dialog is mapped for the first time. * gtk/gtkmessagedialog.h, gtk/gtkmessagedialog.c: Add a simple message dialog class * gtk/gtkdialog.c (gtk_dialog_init): Connect delete event handler to emit response signal, and maybe later it would honor a hide_on_delete flag - though that isn't there yet. Set border width on the vbox to 2, so we get some padding. Use a button box for the action area. (gtk_dialog_key_press): synthesize a delete event if Esc is pressed and the GtkWidget key press handler didn't handle the escape key. (gtk_dialog_new_with_buttons): new function creates a dialog with some default buttons in it. (gtk_dialog_add_action_widget): add an activatable widget as a button in the dialog - you can also add a non-activatable widget by accessing the action area directly. (gtk_dialog_add_button): add a simple button - stock ID or label - to the action area (gtk_dialog_response): emit response signal (gtk_dialog_run): block waiting for the dialog, return the response. Override normal delete_event behavior, so that delete_event does nothing inside gtk_dialog_run(). * gtk/gtkdialog.h, gtk/gtkdialog.c: Add "response" signal emitted when an action widget is clicked or the dialog gets delete_event * gtk/gtk.h: add gtkmessagedialog.h * gtk/Makefile.am: add gtkmessagedialog.[hc] 2000-10-20 Havoc Pennington <hp@redhat.com> * gtk/gtk-sections.txt: Add dialog docs
2000-10-20 23:14:41 +00:00
*
* Typical usage is:
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
2000-11-06 16:44:01 +00:00
* if (gtk_dialog_run(dialog) == GTK_RESPONSE_ACCEPT)
create some stock buttons with the default accel group (create_image): 2000-10-04 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c (create_buttons): create some stock buttons with the default accel group (create_image): test some new GtkImage features (make_message_dialog): test GtkMessageDialog (create_modal_window): fix someone's bizzarro indentation * gtk/gtkwindow.h, gtk/gtkwindow.c: Implement GTK_WIN_POS_CENTER_ON_PARENT. Add "destroy with parent" setting, which means the window goes away with its transient parent. (gtk_window_get_default_accel_group): get the default accel group for the window. (gtk_window_set_destroy_with_parent): set/unset destroy with parent flag (gtk_window_read_rcfiles): invalidate icon set caches after reloading rcfiles * gtk/gtkenums.h (GtkWindowPosition): add GTK_WIN_POS_CENTER_ON_PARENT, which centers a dialog on its parent window when the dialog is mapped for the first time. * gtk/gtkmessagedialog.h, gtk/gtkmessagedialog.c: Add a simple message dialog class * gtk/gtkdialog.c (gtk_dialog_init): Connect delete event handler to emit response signal, and maybe later it would honor a hide_on_delete flag - though that isn't there yet. Set border width on the vbox to 2, so we get some padding. Use a button box for the action area. (gtk_dialog_key_press): synthesize a delete event if Esc is pressed and the GtkWidget key press handler didn't handle the escape key. (gtk_dialog_new_with_buttons): new function creates a dialog with some default buttons in it. (gtk_dialog_add_action_widget): add an activatable widget as a button in the dialog - you can also add a non-activatable widget by accessing the action area directly. (gtk_dialog_add_button): add a simple button - stock ID or label - to the action area (gtk_dialog_response): emit response signal (gtk_dialog_run): block waiting for the dialog, return the response. Override normal delete_event behavior, so that delete_event does nothing inside gtk_dialog_run(). * gtk/gtkdialog.h, gtk/gtkdialog.c: Add "response" signal emitted when an action widget is clicked or the dialog gets delete_event * gtk/gtk.h: add gtkmessagedialog.h * gtk/Makefile.am: add gtkmessagedialog.[hc] 2000-10-20 Havoc Pennington <hp@redhat.com> * gtk/gtk-sections.txt: Add dialog docs
2000-10-20 23:14:41 +00:00
* blah();
*/
typedef enum
{
/* GTK returns this if a response widget has no response_id,
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
2000-11-06 16:44:01 +00:00
* or if the dialog gets programmatically hidden or destroyed.
create some stock buttons with the default accel group (create_image): 2000-10-04 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c (create_buttons): create some stock buttons with the default accel group (create_image): test some new GtkImage features (make_message_dialog): test GtkMessageDialog (create_modal_window): fix someone's bizzarro indentation * gtk/gtkwindow.h, gtk/gtkwindow.c: Implement GTK_WIN_POS_CENTER_ON_PARENT. Add "destroy with parent" setting, which means the window goes away with its transient parent. (gtk_window_get_default_accel_group): get the default accel group for the window. (gtk_window_set_destroy_with_parent): set/unset destroy with parent flag (gtk_window_read_rcfiles): invalidate icon set caches after reloading rcfiles * gtk/gtkenums.h (GtkWindowPosition): add GTK_WIN_POS_CENTER_ON_PARENT, which centers a dialog on its parent window when the dialog is mapped for the first time. * gtk/gtkmessagedialog.h, gtk/gtkmessagedialog.c: Add a simple message dialog class * gtk/gtkdialog.c (gtk_dialog_init): Connect delete event handler to emit response signal, and maybe later it would honor a hide_on_delete flag - though that isn't there yet. Set border width on the vbox to 2, so we get some padding. Use a button box for the action area. (gtk_dialog_key_press): synthesize a delete event if Esc is pressed and the GtkWidget key press handler didn't handle the escape key. (gtk_dialog_new_with_buttons): new function creates a dialog with some default buttons in it. (gtk_dialog_add_action_widget): add an activatable widget as a button in the dialog - you can also add a non-activatable widget by accessing the action area directly. (gtk_dialog_add_button): add a simple button - stock ID or label - to the action area (gtk_dialog_response): emit response signal (gtk_dialog_run): block waiting for the dialog, return the response. Override normal delete_event behavior, so that delete_event does nothing inside gtk_dialog_run(). * gtk/gtkdialog.h, gtk/gtkdialog.c: Add "response" signal emitted when an action widget is clicked or the dialog gets delete_event * gtk/gtk.h: add gtkmessagedialog.h * gtk/Makefile.am: add gtkmessagedialog.[hc] 2000-10-20 Havoc Pennington <hp@redhat.com> * gtk/gtk-sections.txt: Add dialog docs
2000-10-20 23:14:41 +00:00
*/
GTK_RESPONSE_NONE = -1,
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
2000-11-06 16:44:01 +00:00
create some stock buttons with the default accel group (create_image): 2000-10-04 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c (create_buttons): create some stock buttons with the default accel group (create_image): test some new GtkImage features (make_message_dialog): test GtkMessageDialog (create_modal_window): fix someone's bizzarro indentation * gtk/gtkwindow.h, gtk/gtkwindow.c: Implement GTK_WIN_POS_CENTER_ON_PARENT. Add "destroy with parent" setting, which means the window goes away with its transient parent. (gtk_window_get_default_accel_group): get the default accel group for the window. (gtk_window_set_destroy_with_parent): set/unset destroy with parent flag (gtk_window_read_rcfiles): invalidate icon set caches after reloading rcfiles * gtk/gtkenums.h (GtkWindowPosition): add GTK_WIN_POS_CENTER_ON_PARENT, which centers a dialog on its parent window when the dialog is mapped for the first time. * gtk/gtkmessagedialog.h, gtk/gtkmessagedialog.c: Add a simple message dialog class * gtk/gtkdialog.c (gtk_dialog_init): Connect delete event handler to emit response signal, and maybe later it would honor a hide_on_delete flag - though that isn't there yet. Set border width on the vbox to 2, so we get some padding. Use a button box for the action area. (gtk_dialog_key_press): synthesize a delete event if Esc is pressed and the GtkWidget key press handler didn't handle the escape key. (gtk_dialog_new_with_buttons): new function creates a dialog with some default buttons in it. (gtk_dialog_add_action_widget): add an activatable widget as a button in the dialog - you can also add a non-activatable widget by accessing the action area directly. (gtk_dialog_add_button): add a simple button - stock ID or label - to the action area (gtk_dialog_response): emit response signal (gtk_dialog_run): block waiting for the dialog, return the response. Override normal delete_event behavior, so that delete_event does nothing inside gtk_dialog_run(). * gtk/gtkdialog.h, gtk/gtkdialog.c: Add "response" signal emitted when an action widget is clicked or the dialog gets delete_event * gtk/gtk.h: add gtkmessagedialog.h * gtk/Makefile.am: add gtkmessagedialog.[hc] 2000-10-20 Havoc Pennington <hp@redhat.com> * gtk/gtk-sections.txt: Add dialog docs
2000-10-20 23:14:41 +00:00
/* GTK won't return these unless you pass them in
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
2000-11-06 16:44:01 +00:00
* as the response for an action widget. They are
* for your convenience.
create some stock buttons with the default accel group (create_image): 2000-10-04 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c (create_buttons): create some stock buttons with the default accel group (create_image): test some new GtkImage features (make_message_dialog): test GtkMessageDialog (create_modal_window): fix someone's bizzarro indentation * gtk/gtkwindow.h, gtk/gtkwindow.c: Implement GTK_WIN_POS_CENTER_ON_PARENT. Add "destroy with parent" setting, which means the window goes away with its transient parent. (gtk_window_get_default_accel_group): get the default accel group for the window. (gtk_window_set_destroy_with_parent): set/unset destroy with parent flag (gtk_window_read_rcfiles): invalidate icon set caches after reloading rcfiles * gtk/gtkenums.h (GtkWindowPosition): add GTK_WIN_POS_CENTER_ON_PARENT, which centers a dialog on its parent window when the dialog is mapped for the first time. * gtk/gtkmessagedialog.h, gtk/gtkmessagedialog.c: Add a simple message dialog class * gtk/gtkdialog.c (gtk_dialog_init): Connect delete event handler to emit response signal, and maybe later it would honor a hide_on_delete flag - though that isn't there yet. Set border width on the vbox to 2, so we get some padding. Use a button box for the action area. (gtk_dialog_key_press): synthesize a delete event if Esc is pressed and the GtkWidget key press handler didn't handle the escape key. (gtk_dialog_new_with_buttons): new function creates a dialog with some default buttons in it. (gtk_dialog_add_action_widget): add an activatable widget as a button in the dialog - you can also add a non-activatable widget by accessing the action area directly. (gtk_dialog_add_button): add a simple button - stock ID or label - to the action area (gtk_dialog_response): emit response signal (gtk_dialog_run): block waiting for the dialog, return the response. Override normal delete_event behavior, so that delete_event does nothing inside gtk_dialog_run(). * gtk/gtkdialog.h, gtk/gtkdialog.c: Add "response" signal emitted when an action widget is clicked or the dialog gets delete_event * gtk/gtk.h: add gtkmessagedialog.h * gtk/Makefile.am: add gtkmessagedialog.[hc] 2000-10-20 Havoc Pennington <hp@redhat.com> * gtk/gtk-sections.txt: Add dialog docs
2000-10-20 23:14:41 +00:00
*/
GTK_RESPONSE_REJECT = -2,
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
2000-11-06 16:44:01 +00:00
GTK_RESPONSE_ACCEPT = -3,
/* If the dialog is deleted. */
GTK_RESPONSE_DELETE_EVENT = -4,
/* These are returned from GTK dialogs, and you can also use them
* yourself if you like.
*/
GTK_RESPONSE_OK = -5,
GTK_RESPONSE_CANCEL = -6,
GTK_RESPONSE_CLOSE = -7,
GTK_RESPONSE_YES = -8,
GTK_RESPONSE_NO = -9,
GTK_RESPONSE_APPLY = -10,
GTK_RESPONSE_HELP = -11
create some stock buttons with the default accel group (create_image): 2000-10-04 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c (create_buttons): create some stock buttons with the default accel group (create_image): test some new GtkImage features (make_message_dialog): test GtkMessageDialog (create_modal_window): fix someone's bizzarro indentation * gtk/gtkwindow.h, gtk/gtkwindow.c: Implement GTK_WIN_POS_CENTER_ON_PARENT. Add "destroy with parent" setting, which means the window goes away with its transient parent. (gtk_window_get_default_accel_group): get the default accel group for the window. (gtk_window_set_destroy_with_parent): set/unset destroy with parent flag (gtk_window_read_rcfiles): invalidate icon set caches after reloading rcfiles * gtk/gtkenums.h (GtkWindowPosition): add GTK_WIN_POS_CENTER_ON_PARENT, which centers a dialog on its parent window when the dialog is mapped for the first time. * gtk/gtkmessagedialog.h, gtk/gtkmessagedialog.c: Add a simple message dialog class * gtk/gtkdialog.c (gtk_dialog_init): Connect delete event handler to emit response signal, and maybe later it would honor a hide_on_delete flag - though that isn't there yet. Set border width on the vbox to 2, so we get some padding. Use a button box for the action area. (gtk_dialog_key_press): synthesize a delete event if Esc is pressed and the GtkWidget key press handler didn't handle the escape key. (gtk_dialog_new_with_buttons): new function creates a dialog with some default buttons in it. (gtk_dialog_add_action_widget): add an activatable widget as a button in the dialog - you can also add a non-activatable widget by accessing the action area directly. (gtk_dialog_add_button): add a simple button - stock ID or label - to the action area (gtk_dialog_response): emit response signal (gtk_dialog_run): block waiting for the dialog, return the response. Override normal delete_event behavior, so that delete_event does nothing inside gtk_dialog_run(). * gtk/gtkdialog.h, gtk/gtkdialog.c: Add "response" signal emitted when an action widget is clicked or the dialog gets delete_event * gtk/gtk.h: add gtkmessagedialog.h * gtk/Makefile.am: add gtkmessagedialog.[hc] 2000-10-20 Havoc Pennington <hp@redhat.com> * gtk/gtk-sections.txt: Add dialog docs
2000-10-20 23:14:41 +00:00
} GtkResponseType;
1997-11-24 22:37:52 +00:00
#define GTK_TYPE_DIALOG (gtk_dialog_get_type ())
#define GTK_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_DIALOG, GtkDialog))
#define GTK_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_DIALOG, GtkDialogClass))
#define GTK_IS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DIALOG))
#define GTK_IS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DIALOG))
#define GTK_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_DIALOG, GtkDialogClass))
1997-11-24 22:37:52 +00:00
typedef struct _GtkDialog GtkDialog;
typedef struct _GtkDialogClass GtkDialogClass;
struct _GtkDialog
{
GtkWindow window;
Minor documentation fixes 2002-08-10 Soren Sandmann <sandmann@daimi.au.dk> * docs/reference/gtk/tree_widget.sgml, docs/reference/gtk/tmpl/gtkdialog.sgml, docs/reference/gtk/tmpl/gtkentry.sgml, docs/reference/gtk/tmpl/gtkfilesel.sgml, docs/reference/gtk/tmpl/gtkfontsel.sgml, docs/reference/gtk/tmpl/gtkfontseldlg.sgml, docs/reference/gtk/tmpl/gtktreemodel.sgml, docs/reference/gtk/tmpl/gtkwidget.sgml, gdk/x11/gdkdisplay-x11.c, gtk/gtkbbox.c, gtk/gtkbox.c, gtk/gtkbutton.c, gtk/gtkcellrenderer.c, gtk/gtkcellrendererpixbuf.c, gtk/gtkcellrenderertext.c, gtk/gtkcheckmenuitem.c, gtk/gtkcontainer.c, gtk/gtkcurve.c, gtk/gtkdialog.h, gtk/gtkentry.c, gtk/gtkfilesel.c, gtk/gtkfontsel.c, gtk/gtkframe.c, gtk/gtkhandlebox.c, gtk/gtkiconfactory.c, gtk/gtkimage.c, gtk/gtkinvisible.c, gtk/gtkitemfactory.c, gtk/gtklabel.c, gtk/gtklayout.c, gtk/gtkmenu.c, gtk/gtkprogress.c, gtk/gtkprogressbar.c, gtk/gtkscrolledwindow.c, gtk/gtksizegroup.c, gtk/gtktable.c, gtk/gtktextiter.c, gtk/gtktexttag.c, gtk/gtktexttag.h, gtk/gtktextview.c, gtk/gtktogglebutton.c, gtk/gtktoolbar.c, gtk/gtktreemodel.c, gtk/gtktreeselection.c, gtk/gtktreestore.c, gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c, gtk/gtkviewport.c, gtk/gtkwidget.c, gtk/gtkwidget.h, gtk/gtkwindow.c: Minor documentation fixes (#89254, patch from Brett Nash; #85809, patch from daten@dnetc.org; #76391, patch from Ross Burton; #74559, Manuel Clos; #73569, #72005, Alexey A. Malyshev; #70061, patch from Dennis Bj"orklund; #64566, #63388, #58328, #57499, #81007, #77349, Vitaly Tishkov; #78932, Vitaly Tishkov, patch from Ross Burton; #73306)
2002-08-10 09:55:41 +00:00
/*< public >*/
GtkWidget *vbox;
GtkWidget *action_area;
/*< private >*/
GtkWidget *separator;
1997-11-24 22:37:52 +00:00
};
struct _GtkDialogClass
{
GtkWindowClass parent_class;
create some stock buttons with the default accel group (create_image): 2000-10-04 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c (create_buttons): create some stock buttons with the default accel group (create_image): test some new GtkImage features (make_message_dialog): test GtkMessageDialog (create_modal_window): fix someone's bizzarro indentation * gtk/gtkwindow.h, gtk/gtkwindow.c: Implement GTK_WIN_POS_CENTER_ON_PARENT. Add "destroy with parent" setting, which means the window goes away with its transient parent. (gtk_window_get_default_accel_group): get the default accel group for the window. (gtk_window_set_destroy_with_parent): set/unset destroy with parent flag (gtk_window_read_rcfiles): invalidate icon set caches after reloading rcfiles * gtk/gtkenums.h (GtkWindowPosition): add GTK_WIN_POS_CENTER_ON_PARENT, which centers a dialog on its parent window when the dialog is mapped for the first time. * gtk/gtkmessagedialog.h, gtk/gtkmessagedialog.c: Add a simple message dialog class * gtk/gtkdialog.c (gtk_dialog_init): Connect delete event handler to emit response signal, and maybe later it would honor a hide_on_delete flag - though that isn't there yet. Set border width on the vbox to 2, so we get some padding. Use a button box for the action area. (gtk_dialog_key_press): synthesize a delete event if Esc is pressed and the GtkWidget key press handler didn't handle the escape key. (gtk_dialog_new_with_buttons): new function creates a dialog with some default buttons in it. (gtk_dialog_add_action_widget): add an activatable widget as a button in the dialog - you can also add a non-activatable widget by accessing the action area directly. (gtk_dialog_add_button): add a simple button - stock ID or label - to the action area (gtk_dialog_response): emit response signal (gtk_dialog_run): block waiting for the dialog, return the response. Override normal delete_event behavior, so that delete_event does nothing inside gtk_dialog_run(). * gtk/gtkdialog.h, gtk/gtkdialog.c: Add "response" signal emitted when an action widget is clicked or the dialog gets delete_event * gtk/gtk.h: add gtkmessagedialog.h * gtk/Makefile.am: add gtkmessagedialog.[hc] 2000-10-20 Havoc Pennington <hp@redhat.com> * gtk/gtk-sections.txt: Add dialog docs
2000-10-20 23:14:41 +00:00
void (* response) (GtkDialog *dialog, gint response_id);
Clip the retrieved image data to the screen, using a server grab to avoid 2001-06-28 Havoc Pennington <hp@pobox.com> * gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved image data to the screen, using a server grab to avoid race conditions. * gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove check for NULL return from gtk_image_new_from_stock(), it never returns NULL. (gtk_item_factory_create_item): fix bug where we parsed the stock ID as an inline pixbuf * gtk/gtktext.c (gtk_text_key_press): numeric keypad support * gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad support (should be using binding set here) * gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad support (should be using binding set here) * gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad support * gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support * gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad * gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad * gtk/gtkimcontextsimple.c (gtk_im_context_simple_filter_keypress): keypad * gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad * gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes * gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support * gtk/gtkcolorsel.c (palette_activate): keypad support (of course, should be binding-setted) * gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes * gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes * gtk/gtkcalendar.c: numeric keypad fixes * gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad support * gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop screwup * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha): clip the render area to the drawable's clip region in advance, so we don't get data from the server that we don't need. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha): check return value of gdk_pixbuf_get_from_drawable(), fall back to bilevel alpha if we can't get the pixbuf to composite against. * gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap * gdk/gdkimage.c (gdk_image_get_colormap): add gdk_image_set_colormap, gdk_image_get_colormap * gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to take a region of the image, instead of converting the entire image. * gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help keybinding signal. Add default bindings for it. Add default handler for show_help that shows the tooltip for the widget. * gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and "close" keybinding signal, remove key press handler. * gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this, it's not our usual practice to leave a deprecated function around with a runtime warning, plus we don't want it to appear in docs, plus if we make them yellow no one will want to change them anyhow.
2001-06-29 01:59:02 +00:00
/* Keybinding signals */
void (* close) (GtkDialog *dialog);
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
1997-11-24 22:37:52 +00:00
};
GType gtk_dialog_get_type (void) G_GNUC_CONST;
1997-11-24 22:37:52 +00:00
GtkWidget* gtk_dialog_new (void);
create some stock buttons with the default accel group (create_image): 2000-10-04 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c (create_buttons): create some stock buttons with the default accel group (create_image): test some new GtkImage features (make_message_dialog): test GtkMessageDialog (create_modal_window): fix someone's bizzarro indentation * gtk/gtkwindow.h, gtk/gtkwindow.c: Implement GTK_WIN_POS_CENTER_ON_PARENT. Add "destroy with parent" setting, which means the window goes away with its transient parent. (gtk_window_get_default_accel_group): get the default accel group for the window. (gtk_window_set_destroy_with_parent): set/unset destroy with parent flag (gtk_window_read_rcfiles): invalidate icon set caches after reloading rcfiles * gtk/gtkenums.h (GtkWindowPosition): add GTK_WIN_POS_CENTER_ON_PARENT, which centers a dialog on its parent window when the dialog is mapped for the first time. * gtk/gtkmessagedialog.h, gtk/gtkmessagedialog.c: Add a simple message dialog class * gtk/gtkdialog.c (gtk_dialog_init): Connect delete event handler to emit response signal, and maybe later it would honor a hide_on_delete flag - though that isn't there yet. Set border width on the vbox to 2, so we get some padding. Use a button box for the action area. (gtk_dialog_key_press): synthesize a delete event if Esc is pressed and the GtkWidget key press handler didn't handle the escape key. (gtk_dialog_new_with_buttons): new function creates a dialog with some default buttons in it. (gtk_dialog_add_action_widget): add an activatable widget as a button in the dialog - you can also add a non-activatable widget by accessing the action area directly. (gtk_dialog_add_button): add a simple button - stock ID or label - to the action area (gtk_dialog_response): emit response signal (gtk_dialog_run): block waiting for the dialog, return the response. Override normal delete_event behavior, so that delete_event does nothing inside gtk_dialog_run(). * gtk/gtkdialog.h, gtk/gtkdialog.c: Add "response" signal emitted when an action widget is clicked or the dialog gets delete_event * gtk/gtk.h: add gtkmessagedialog.h * gtk/Makefile.am: add gtkmessagedialog.[hc] 2000-10-20 Havoc Pennington <hp@redhat.com> * gtk/gtk-sections.txt: Add dialog docs
2000-10-20 23:14:41 +00:00
GtkWidget* gtk_dialog_new_with_buttons (const gchar *title,
GtkWindow *parent,
GtkDialogFlags flags,
const gchar *first_button_text,
...) G_GNUC_NULL_TERMINATED;
create some stock buttons with the default accel group (create_image): 2000-10-04 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c (create_buttons): create some stock buttons with the default accel group (create_image): test some new GtkImage features (make_message_dialog): test GtkMessageDialog (create_modal_window): fix someone's bizzarro indentation * gtk/gtkwindow.h, gtk/gtkwindow.c: Implement GTK_WIN_POS_CENTER_ON_PARENT. Add "destroy with parent" setting, which means the window goes away with its transient parent. (gtk_window_get_default_accel_group): get the default accel group for the window. (gtk_window_set_destroy_with_parent): set/unset destroy with parent flag (gtk_window_read_rcfiles): invalidate icon set caches after reloading rcfiles * gtk/gtkenums.h (GtkWindowPosition): add GTK_WIN_POS_CENTER_ON_PARENT, which centers a dialog on its parent window when the dialog is mapped for the first time. * gtk/gtkmessagedialog.h, gtk/gtkmessagedialog.c: Add a simple message dialog class * gtk/gtkdialog.c (gtk_dialog_init): Connect delete event handler to emit response signal, and maybe later it would honor a hide_on_delete flag - though that isn't there yet. Set border width on the vbox to 2, so we get some padding. Use a button box for the action area. (gtk_dialog_key_press): synthesize a delete event if Esc is pressed and the GtkWidget key press handler didn't handle the escape key. (gtk_dialog_new_with_buttons): new function creates a dialog with some default buttons in it. (gtk_dialog_add_action_widget): add an activatable widget as a button in the dialog - you can also add a non-activatable widget by accessing the action area directly. (gtk_dialog_add_button): add a simple button - stock ID or label - to the action area (gtk_dialog_response): emit response signal (gtk_dialog_run): block waiting for the dialog, return the response. Override normal delete_event behavior, so that delete_event does nothing inside gtk_dialog_run(). * gtk/gtkdialog.h, gtk/gtkdialog.c: Add "response" signal emitted when an action widget is clicked or the dialog gets delete_event * gtk/gtk.h: add gtkmessagedialog.h * gtk/Makefile.am: add gtkmessagedialog.[hc] 2000-10-20 Havoc Pennington <hp@redhat.com> * gtk/gtk-sections.txt: Add dialog docs
2000-10-20 23:14:41 +00:00
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
2000-11-06 16:44:01 +00:00
void gtk_dialog_add_action_widget (GtkDialog *dialog,
GtkWidget *child,
gint response_id);
GtkWidget* gtk_dialog_add_button (GtkDialog *dialog,
const gchar *button_text,
gint response_id);
void gtk_dialog_add_buttons (GtkDialog *dialog,
const gchar *first_button_text,
...) G_GNUC_NULL_TERMINATED;
create some stock buttons with the default accel group (create_image): 2000-10-04 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c (create_buttons): create some stock buttons with the default accel group (create_image): test some new GtkImage features (make_message_dialog): test GtkMessageDialog (create_modal_window): fix someone's bizzarro indentation * gtk/gtkwindow.h, gtk/gtkwindow.c: Implement GTK_WIN_POS_CENTER_ON_PARENT. Add "destroy with parent" setting, which means the window goes away with its transient parent. (gtk_window_get_default_accel_group): get the default accel group for the window. (gtk_window_set_destroy_with_parent): set/unset destroy with parent flag (gtk_window_read_rcfiles): invalidate icon set caches after reloading rcfiles * gtk/gtkenums.h (GtkWindowPosition): add GTK_WIN_POS_CENTER_ON_PARENT, which centers a dialog on its parent window when the dialog is mapped for the first time. * gtk/gtkmessagedialog.h, gtk/gtkmessagedialog.c: Add a simple message dialog class * gtk/gtkdialog.c (gtk_dialog_init): Connect delete event handler to emit response signal, and maybe later it would honor a hide_on_delete flag - though that isn't there yet. Set border width on the vbox to 2, so we get some padding. Use a button box for the action area. (gtk_dialog_key_press): synthesize a delete event if Esc is pressed and the GtkWidget key press handler didn't handle the escape key. (gtk_dialog_new_with_buttons): new function creates a dialog with some default buttons in it. (gtk_dialog_add_action_widget): add an activatable widget as a button in the dialog - you can also add a non-activatable widget by accessing the action area directly. (gtk_dialog_add_button): add a simple button - stock ID or label - to the action area (gtk_dialog_response): emit response signal (gtk_dialog_run): block waiting for the dialog, return the response. Override normal delete_event behavior, so that delete_event does nothing inside gtk_dialog_run(). * gtk/gtkdialog.h, gtk/gtkdialog.c: Add "response" signal emitted when an action widget is clicked or the dialog gets delete_event * gtk/gtk.h: add gtkmessagedialog.h * gtk/Makefile.am: add gtkmessagedialog.[hc] 2000-10-20 Havoc Pennington <hp@redhat.com> * gtk/gtk-sections.txt: Add dialog docs
2000-10-20 23:14:41 +00:00
handle case where there are no rows in the model 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where there are no rows in the model * gtk/gtkliststore.c (gtk_list_store_iter_children): if parent is NULL, then return the start of the list * gtk/gtktreeview.c (gtk_tree_view_setup_model): don't build tree if we can't get any rows from an empty model * gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): remove extraneous * after function pointer typedef usage * Makefile.am: don't specify full path to cp and rm * gtk/gtkcellrenderertextpixbuf.c (gtk_cell_renderer_text_pixbuf_get_size): check width/height != NULL before dereferencing, fixes a segfault that happened from time to time * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_render): use gdk_pixbuf_render_to_drawable_alpha() to get alpha channel, and reindent the function (gtk_cell_renderer_pixbuf_get_size): indentation * gtk/gtkdialog.c (gtk_dialog_run): destroy main loop only after we quit it (gtk_dialog_add_buttons_valist): add g_return_if_fail (gtk_dialog_set_default_response): New function, to set default button (gtk_dialog_set_response_sensitive): New function, to set sensitivity of buttons * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_property): allow getting a NULL pixbuf (gtk_cell_renderer_pixbuf_set_property): allow setting a NULL pixbuf * gtk/gtktreedatalist.c (_gtk_tree_data_list_node_to_value): handle any G_TYPE_OBJECT subclass, not just the base class, and also boxed types. (_gtk_tree_data_list_value_to_node): ditto * gtk/gtkrbtree.c: Run _gtk_rbtree_test at strategic points if --gtk-debug=tree * gtk/gtkmain.c: add GTK_DEBUG_TREE * gtk/gtkdebug.h: add GTK_DEBUG_TREE
2001-01-09 17:45:34 +00:00
void gtk_dialog_set_response_sensitive (GtkDialog *dialog,
gint response_id,
gboolean setting);
void gtk_dialog_set_default_response (GtkDialog *dialog,
gint response_id);
gint gtk_dialog_get_response_for_widget (GtkDialog *dialog,
GtkWidget *widget);
handle case where there are no rows in the model 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where there are no rows in the model * gtk/gtkliststore.c (gtk_list_store_iter_children): if parent is NULL, then return the start of the list * gtk/gtktreeview.c (gtk_tree_view_setup_model): don't build tree if we can't get any rows from an empty model * gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): remove extraneous * after function pointer typedef usage * Makefile.am: don't specify full path to cp and rm * gtk/gtkcellrenderertextpixbuf.c (gtk_cell_renderer_text_pixbuf_get_size): check width/height != NULL before dereferencing, fixes a segfault that happened from time to time * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_render): use gdk_pixbuf_render_to_drawable_alpha() to get alpha channel, and reindent the function (gtk_cell_renderer_pixbuf_get_size): indentation * gtk/gtkdialog.c (gtk_dialog_run): destroy main loop only after we quit it (gtk_dialog_add_buttons_valist): add g_return_if_fail (gtk_dialog_set_default_response): New function, to set default button (gtk_dialog_set_response_sensitive): New function, to set sensitivity of buttons * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_property): allow getting a NULL pixbuf (gtk_cell_renderer_pixbuf_set_property): allow setting a NULL pixbuf * gtk/gtktreedatalist.c (_gtk_tree_data_list_node_to_value): handle any G_TYPE_OBJECT subclass, not just the base class, and also boxed types. (_gtk_tree_data_list_value_to_node): ditto * gtk/gtkrbtree.c: Run _gtk_rbtree_test at strategic points if --gtk-debug=tree * gtk/gtkmain.c: add GTK_DEBUG_TREE * gtk/gtkdebug.h: add GTK_DEBUG_TREE
2001-01-09 17:45:34 +00:00
void gtk_dialog_set_has_separator (GtkDialog *dialog,
gboolean setting);
gboolean gtk_dialog_get_has_separator (GtkDialog *dialog);
gboolean gtk_alternative_dialog_button_order (GdkScreen *screen);
void gtk_dialog_set_alternative_button_order (GtkDialog *dialog,
gint first_response_id,
...);
void gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
gint n_params,
gint *new_order);
create some stock buttons with the default accel group (create_image): 2000-10-04 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c (create_buttons): create some stock buttons with the default accel group (create_image): test some new GtkImage features (make_message_dialog): test GtkMessageDialog (create_modal_window): fix someone's bizzarro indentation * gtk/gtkwindow.h, gtk/gtkwindow.c: Implement GTK_WIN_POS_CENTER_ON_PARENT. Add "destroy with parent" setting, which means the window goes away with its transient parent. (gtk_window_get_default_accel_group): get the default accel group for the window. (gtk_window_set_destroy_with_parent): set/unset destroy with parent flag (gtk_window_read_rcfiles): invalidate icon set caches after reloading rcfiles * gtk/gtkenums.h (GtkWindowPosition): add GTK_WIN_POS_CENTER_ON_PARENT, which centers a dialog on its parent window when the dialog is mapped for the first time. * gtk/gtkmessagedialog.h, gtk/gtkmessagedialog.c: Add a simple message dialog class * gtk/gtkdialog.c (gtk_dialog_init): Connect delete event handler to emit response signal, and maybe later it would honor a hide_on_delete flag - though that isn't there yet. Set border width on the vbox to 2, so we get some padding. Use a button box for the action area. (gtk_dialog_key_press): synthesize a delete event if Esc is pressed and the GtkWidget key press handler didn't handle the escape key. (gtk_dialog_new_with_buttons): new function creates a dialog with some default buttons in it. (gtk_dialog_add_action_widget): add an activatable widget as a button in the dialog - you can also add a non-activatable widget by accessing the action area directly. (gtk_dialog_add_button): add a simple button - stock ID or label - to the action area (gtk_dialog_response): emit response signal (gtk_dialog_run): block waiting for the dialog, return the response. Override normal delete_event behavior, so that delete_event does nothing inside gtk_dialog_run(). * gtk/gtkdialog.h, gtk/gtkdialog.c: Add "response" signal emitted when an action widget is clicked or the dialog gets delete_event * gtk/gtk.h: add gtkmessagedialog.h * gtk/Makefile.am: add gtkmessagedialog.[hc] 2000-10-20 Havoc Pennington <hp@redhat.com> * gtk/gtk-sections.txt: Add dialog docs
2000-10-20 23:14:41 +00:00
/* Emit response signal */
void gtk_dialog_response (GtkDialog *dialog,
gint response_id);
/* Returns response_id */
gint gtk_dialog_run (GtkDialog *dialog);
1997-11-24 22:37:52 +00:00
/* For private use only */
void _gtk_dialog_set_ignore_separator (GtkDialog *dialog,
gboolean ignore_separator);
gint _gtk_dialog_get_response_for_widget (GtkDialog *dialog,
GtkWidget *widget);
G_END_DECLS
1997-11-24 22:37:52 +00:00
#endif /* __GTK_DIALOG_H__ */