From bcb919b457545a7d134749047e2d60278af7b205 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sat, 28 Jul 2001 06:50:02 +0000 Subject: [PATCH] * gtkedit.c (gtk_edit_delete_cb): Handler for "delete_event". (edit): Connect it. --- gtkedit/ChangeLog | 5 +++++ gtkedit/gtkedit.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gtkedit/ChangeLog b/gtkedit/ChangeLog index a9a9a84d1..468f17e8c 100644 --- a/gtkedit/ChangeLog +++ b/gtkedit/ChangeLog @@ -1,3 +1,8 @@ +2001-07-28 Pavel Roskin + + * gtkedit.c (gtk_edit_delete_cb): Handler for "delete_event". + (edit): Connect it. + 2001-07-27 Pavel Roskin * edit.c: Fix include. diff --git a/gtkedit/gtkedit.c b/gtkedit/gtkedit.c index 48b2a75fc..af36d5e10 100644 --- a/gtkedit/gtkedit.c +++ b/gtkedit/gtkedit.c @@ -47,7 +47,6 @@ int column_highlighting = 0; static GtkWidgetClass *parent_class = NULL; WEdit *edit_init (WEdit * edit, int lines, int columns, const char *filename, const char *text, const char *dir, unsigned long text_size); -void edit_destroy_callback (CWidget * w); int edit_translate_key (unsigned int x_keycode, long x_key, int x_state, int *cmd, int *ch); void gtk_edit_alloc_colors (GtkEdit *edit, GdkColormap *colormap); static void gtk_edit_set_position (GtkEditable *editable, gint position); @@ -1202,6 +1201,11 @@ void gtk_edit_move (GtkEdit * widget, void *data) { GtkEdit *edit = (GtkEdit *) void gtk_edit_delete (GtkEdit * widget, void *data) { GtkEdit *edit = (GtkEdit *) data ; gtk_edit_command (edit, CK_Remove); } void gtk_edit_undo (GtkEdit * widget, void *data) { GtkEdit *edit = (GtkEdit *) data ; gtk_edit_command (edit, CK_Undo); } +gint gtk_edit_delete_cb (GtkWidget *widget, GdkEvent *event, GtkWidget *edit) { + gtk_edit_quit (NULL, edit); + return TRUE; +} + #if 0 struct _GnomeUIInfo { GnomeUIInfoType type; @@ -1354,6 +1358,9 @@ int edit (const char *file, int line) GTK_EDIT(edit)->destroy_me = gtk_widget_destroy; GTK_EDIT(edit)->destroy_me_user_data = app; + gtk_signal_connect (GTK_OBJECT (app), "delete_event", + (GtkSignalFunc) gtk_edit_delete_cb, edit); + gtk_widget_show (edit); gtk_widget_realize (edit); if (file)