proper destruct at the end of gtk_main(). (layer_widget_delete):

Fri Mar 13 12:53:22 1998  Tim Janik  <timj@gimp.org>


        * app/layers_dialog.c: proper destruct at the end of gtk_main().
        (layer_widget_delete): unreference the layer widget's list item.
        (layers_dialog_free): instead of destroying the menu, sink it since
        it is still floating because we didn't attach it to some other widget.
        (layers_dialog_free): sink the preview, destroy doesn't work since it's
        still floating. wonder what the preview is created for if it is never
        used?.

        * app/channels_dialog.c (channel_widget_delete): unreference the channel
        widget's list item.
        * app/channels_dialog.c (channels_dialog_free): sink the menu.
        * app/channels_dialog.c (channels_dialog_free): sink the preview.

        * app/indexed_palette.c (indexed_palette_create): update the image list
        even on initial creation. fixed the option menu warning.

        * plug-ins/script-fu/script-fu-console.c (script_fu_browse_callback):
        properly destroy the browser when gtk_main() quits.

        * plug-ins/dbbrowser/dbbrowser_utils.c (gimp_db_browser): pass a widget
        pointer back to our caller, for enabling proper destruction.

        * plug-ins/script-fu/script-fu-console.c (script_fu_console_interface):
        only destroy the dialog on exit if it is still existing.
This commit is contained in:
Tim Janik 1998-03-13 17:46:40 +00:00 committed by Tim Janik
parent 7672259604
commit e227edb040
17 changed files with 122 additions and 108 deletions

View File

@ -1,3 +1,31 @@
Fri Mar 13 12:53:22 1998 Tim Janik <timj@gimp.org>
* app/layers_dialog.c: proper destruct at the end of gtk_main().
(layer_widget_delete): unreference the layer widget's list item.
(layers_dialog_free): instead of destroying the menu, sink it since
it is still floating because we didn't attach it to some other widget.
(layers_dialog_free): sink the preview, destroy doesn't work since it's
still floating. wonder what the preview is created for if it is never
used?.
* app/channels_dialog.c (channel_widget_delete): unreference the channel
widget's list item.
* app/channels_dialog.c (channels_dialog_free): sink the menu.
* app/channels_dialog.c (channels_dialog_free): sink the preview.
* app/indexed_palette.c (indexed_palette_create): update the image list
even on initial creation. fixed the option menu warning.
* plug-ins/script-fu/script-fu-console.c (script_fu_browse_callback):
properly destroy the browser when gtk_main() quits.
* plug-ins/dbbrowser/dbbrowser_utils.c (gimp_db_browser): pass a widget
pointer back to our caller, for enabling proper destruction.
* plug-ins/script-fu/script-fu-console.c (script_fu_console_interface):
only destroy the dialog on exit if it is still existing.
Fri Mar 13 17:22:46 MET 1998 Sven Neumann <sven@gimp.org>
* docs/gimp.1: fixed some typos in the man-page

View File

@ -454,10 +454,10 @@ channels_dialog_free ()
channelsD->floating_sel = NULL;
if (channelsD->preview)
gtk_widget_destroy (channelsD->preview);
gtk_object_sink (GTK_OBJECT (channelsD->preview));
if (channelsD->ops_menu)
gtk_widget_destroy (channelsD->ops_menu);
gtk_object_sink (GTK_OBJECT (channelsD->ops_menu));
g_free (channelsD);
channelsD = NULL;
@ -700,13 +700,10 @@ channels_dialog_remove_channel (ChannelWidget *channel_widget)
list = g_list_append (list, channel_widget->list_item);
gtk_list_remove_items (GTK_LIST (channelsD->channel_list), list);
gtk_widget_destroy (channel_widget->list_item);
gtk_widget_unref (channel_widget->list_item);
suspend_gimage_notify--;
/* Delete the channel_widget */
channel_widget_delete (channel_widget);
suspend_gimage_notify--;
}
@ -954,7 +951,6 @@ create_channel_widget (GImage *gimage,
GtkWidget *alignment;
list_item = gtk_list_item_new ();
gtk_widget_ref (GTK_WIDGET (list_item));
/* create the channel widget and add it to the list */
channel_widget = (ChannelWidget *) g_malloc (sizeof (ChannelWidget));
@ -1034,6 +1030,8 @@ create_channel_widget (GImage *gimage,
gtk_widget_show (vbox);
gtk_widget_show (list_item);
gtk_widget_ref (GTK_WIDGET (channel_widget->list_item));
return channel_widget;
}
@ -1048,6 +1046,7 @@ channel_widget_delete (ChannelWidget *channel_widget)
channelsD->channel_widgets = g_slist_remove (channelsD->channel_widgets, channel_widget);
/* Free the widget */
gtk_widget_unref (channel_widget->list_item);
g_free (channel_widget);
}

View File

@ -478,7 +478,7 @@ file_open_callback (GtkWidget *w,
GTK_OBJECT (fileload));
gtk_signal_connect (GTK_OBJECT (fileload),
"delete_event",
GTK_SIGNAL_FUNC (gtk_widget_delete_hides),
GTK_SIGNAL_FUNC (gtk_widget_hide_on_delete),
NULL);
gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (fileload)->ok_button), "clicked", (GtkSignalFunc) file_open_ok_callback, fileload);
}
@ -567,7 +567,7 @@ file_save_as_callback (GtkWidget *w,
GTK_OBJECT (filesave));
gtk_signal_connect (GTK_OBJECT (filesave),
"delete_event",
GTK_SIGNAL_FUNC (gtk_widget_delete_hides),
GTK_SIGNAL_FUNC (gtk_widget_hide_on_delete),
NULL);
gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filesave)->ok_button), "clicked", (GtkSignalFunc) file_save_ok_callback, filesave);
}

View File

@ -454,10 +454,10 @@ channels_dialog_free ()
channelsD->floating_sel = NULL;
if (channelsD->preview)
gtk_widget_destroy (channelsD->preview);
gtk_object_sink (GTK_OBJECT (channelsD->preview));
if (channelsD->ops_menu)
gtk_widget_destroy (channelsD->ops_menu);
gtk_object_sink (GTK_OBJECT (channelsD->ops_menu));
g_free (channelsD);
channelsD = NULL;
@ -700,13 +700,10 @@ channels_dialog_remove_channel (ChannelWidget *channel_widget)
list = g_list_append (list, channel_widget->list_item);
gtk_list_remove_items (GTK_LIST (channelsD->channel_list), list);
gtk_widget_destroy (channel_widget->list_item);
gtk_widget_unref (channel_widget->list_item);
suspend_gimage_notify--;
/* Delete the channel_widget */
channel_widget_delete (channel_widget);
suspend_gimage_notify--;
}
@ -954,7 +951,6 @@ create_channel_widget (GImage *gimage,
GtkWidget *alignment;
list_item = gtk_list_item_new ();
gtk_widget_ref (GTK_WIDGET (list_item));
/* create the channel widget and add it to the list */
channel_widget = (ChannelWidget *) g_malloc (sizeof (ChannelWidget));
@ -1034,6 +1030,8 @@ create_channel_widget (GImage *gimage,
gtk_widget_show (vbox);
gtk_widget_show (list_item);
gtk_widget_ref (GTK_WIDGET (channel_widget->list_item));
return channel_widget;
}
@ -1048,6 +1046,7 @@ channel_widget_delete (ChannelWidget *channel_widget)
channelsD->channel_widgets = g_slist_remove (channelsD->channel_widgets, channel_widget);
/* Free the widget */
gtk_widget_unref (channel_widget->list_item);
g_free (channel_widget);
}

View File

@ -272,14 +272,19 @@ lc_dialog_create (int gimage_id)
if (lc_shell == NULL)
{
lc_shell = gtk_dialog_new ();
gtk_widget_ref (lc_shell);
gtk_window_set_title (GTK_WINDOW (lc_shell), "Layers & Channels");
gtk_window_set_wmclass (GTK_WINDOW (lc_shell), "layers_and_channels", "Gimp");
gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (lc_shell)->vbox), 2);
gtk_signal_connect (GTK_OBJECT (lc_shell), "delete_event",
gtk_signal_connect (GTK_OBJECT (lc_shell),
"delete_event",
GTK_SIGNAL_FUNC (lc_dialog_close_callback),
NULL);
gtk_signal_connect (GTK_OBJECT (lc_shell),
"destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
&lc_shell);
gtk_quit_add_destroy (1, GTK_OBJECT (lc_shell));
lc_subshell = gtk_vbox_new(FALSE, 1);
gtk_box_pack_start (GTK_BOX(GTK_DIALOG(lc_shell)->vbox), lc_subshell, TRUE, TRUE, 0);
@ -337,8 +342,7 @@ lc_dialog_create (int gimage_id)
gtk_widget_hide (GTK_DIALOG(lc_shell)->action_area);
if (!GTK_WIDGET_VISIBLE (lc_shell))
gtk_widget_show (lc_shell);
gtk_widget_show (lc_shell);
/* Make sure the channels page is realized */
gtk_notebook_set_page (GTK_NOTEBOOK (notebook), 1);
@ -353,7 +357,7 @@ lc_dialog_create (int gimage_id)
if (!GTK_WIDGET_VISIBLE (lc_shell))
gtk_widget_show (lc_shell);
else
gdk_window_raise (lc_shell->window); /* ??? */
gdk_window_raise (lc_shell->window);
layers_dialog_update (gimage_id);
channels_dialog_update (gimage_id);
@ -371,9 +375,6 @@ lc_dialog_update_image_list ()
if (lc_shell == NULL)
return;
gtk_option_menu_remove_menu (GTK_OPTION_MENU (image_option_menu));
/* gtk_widget_destroy (image_menu); */
default_id = layersD->gimage_id;
layersD->gimage_id = -1; /* ??? */
image_menu = create_image_menu (&default_id, &default_index, image_menu_callback);
@ -413,9 +414,6 @@ lc_dialog_free ()
channels_dialog_free ();
gtk_widget_destroy (lc_shell);
gtk_widget_unref (lc_shell);
lc_shell = NULL;
}
void
@ -427,12 +425,10 @@ lc_dialog_rebuild (int new_preview_size)
gimage_id = -1;
flag = 0;
if (lc_shell!=NULL)
if (lc_shell)
{
flag = 1;
gimage_id = layersD->gimage_id;
if (GTK_WIDGET_VISIBLE (lc_shell))
gtk_widget_hide (lc_shell);
lc_dialog_free ();
}
preview_size = new_preview_size;
@ -566,14 +562,14 @@ layers_dialog_free ()
layersD->floating_sel = NULL;
if (layersD->layer_preview)
gtk_widget_destroy (layersD->layer_preview);
gtk_object_sink (GTK_OBJECT (layersD->layer_preview));
if (layersD->green_gc)
gdk_gc_destroy (layersD->green_gc);
if (layersD->red_gc)
gdk_gc_destroy (layersD->red_gc);
if (layersD->ops_menu)
gtk_widget_destroy (layersD->ops_menu);
gtk_object_sink (GTK_OBJECT (layersD->ops_menu));
g_free (layersD);
layersD = NULL;
@ -789,7 +785,8 @@ layers_dialog_update (int gimage_id)
list = g_slist_next(list);
layer_widget_delete (lw);
}
g_slist_free (layersD->layer_widgets);
if (layersD->layer_widgets)
g_warning ("layersD->layer_widgets not empty!");
layersD->layer_widgets = NULL;
if (! (gimage = gimage_get_ID (layersD->gimage_id)))
@ -1288,14 +1285,10 @@ layers_dialog_remove_layer (Layer * layer)
list = g_list_append (list, layer_widget->list_item);
gtk_list_remove_items (GTK_LIST (layersD->layer_list), list);
/* Delete the list item */
gtk_widget_destroy (layer_widget->list_item);
gtk_widget_unref (layer_widget->list_item);
suspend_gimage_notify--;
/* Delete layer widget */
layer_widget_delete (layer_widget);
suspend_gimage_notify--;
}
@ -1808,15 +1801,11 @@ static gint
lc_dialog_close_callback (GtkWidget *w,
gpointer client_data)
{
if (!lc_shell)
return FALSE;
if (GTK_WIDGET_VISIBLE (lc_shell))
gtk_widget_hide (lc_shell);
if (layersD)
layersD->gimage_id = -1;
gtk_widget_hide (lc_shell);
return TRUE;
}
@ -1860,7 +1849,6 @@ create_layer_widget (GImage *gimage,
GtkWidget *alignment;
list_item = gtk_list_item_new ();
gtk_widget_ref (GTK_WIDGET (list_item));
/* create the layer widget and add it to the list */
layer_widget = (LayerWidget *) g_malloc (sizeof (LayerWidget));
@ -1981,6 +1969,8 @@ create_layer_widget (GImage *gimage,
gtk_widget_show (hbox);
gtk_widget_show (vbox);
gtk_widget_show (list_item);
gtk_widget_ref (layer_widget->list_item);
return layer_widget;
}
@ -1998,6 +1988,7 @@ layer_widget_delete (LayerWidget *layer_widget)
layersD->layer_widgets = g_slist_remove (layersD->layer_widgets, layer_widget);
/* Free the widget */
gtk_widget_unref (layer_widget->list_item);
g_free (layer_widget);
}

View File

@ -134,10 +134,10 @@ indexed_palette_create (int gimage_id)
gtk_window_set_wmclass (GTK_WINDOW (indexedP->shell), "indexed_color_palette", "Gimp");
gtk_window_set_title (GTK_WINDOW (indexedP->shell), "Indexed Color Palette");
gtk_window_add_accelerator_table (GTK_WINDOW (indexedP->shell), table);
gtk_signal_connect (GTK_OBJECT (indexedP->shell), "delete_event",
GTK_SIGNAL_FUNC (gtk_widget_delete_hides),
GTK_SIGNAL_FUNC (gtk_widget_hide_on_delete),
NULL);
gtk_quit_add (1, (GtkFunction) gtk_widget_destroy, indexedP->shell);
indexedP->vbox = vbox = gtk_vbox_new (FALSE, 1);
gtk_container_border_width (GTK_CONTAINER (vbox), 1);
@ -151,14 +151,9 @@ indexed_palette_create (int gimage_id)
label = gtk_label_new ("Image:");
gtk_box_pack_start (GTK_BOX (util_box), label, FALSE, FALSE, 2);
indexedP->image_option_menu = gtk_option_menu_new ();
indexedP->image_menu = create_image_menu (&gimage_id, &default_index, image_menu_callback);
gtk_signal_connect (GTK_OBJECT (indexedP->image_menu),
"destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
&indexedP->image_menu);
gtk_box_pack_start (GTK_BOX (util_box), indexedP->image_option_menu, TRUE, TRUE, 2);
gtk_widget_show (indexedP->image_option_menu);
indexedP->image_menu = create_image_menu (&gimage_id, &default_index, image_menu_callback);
gtk_option_menu_set_menu (GTK_OPTION_MENU (indexedP->image_option_menu), indexedP->image_menu);
if (default_index != -1)
gtk_option_menu_set_history (GTK_OPTION_MENU (indexedP->image_option_menu), default_index);
@ -219,6 +214,7 @@ indexed_palette_create (int gimage_id)
gtk_widget_show (indexedP->shell);
indexed_palette_update (gimage_id);
indexed_palette_update_image_list ();
}
else
{
@ -239,10 +235,6 @@ indexed_palette_update_image_list ()
if (! indexedP)
return;
gtk_option_menu_remove_menu (GTK_OPTION_MENU (indexedP->image_option_menu));
if (indexedP->image_menu)
g_warning ("indexedP->image_menu still exists?");
default_id = indexedP->gimage_id;
indexedP->image_menu = create_image_menu (&default_id, &default_index, image_menu_callback);
gtk_option_menu_set_menu (GTK_OPTION_MENU (indexedP->image_option_menu), indexedP->image_menu);
@ -354,8 +346,7 @@ indexed_palette_close_callback (GtkWidget *w,
if (!indexedP)
return;
if (GTK_WIDGET_VISIBLE (indexedP->shell))
gtk_widget_hide (indexedP->shell);
gtk_widget_hide (indexedP->shell);
}
static void

View File

@ -272,14 +272,19 @@ lc_dialog_create (int gimage_id)
if (lc_shell == NULL)
{
lc_shell = gtk_dialog_new ();
gtk_widget_ref (lc_shell);
gtk_window_set_title (GTK_WINDOW (lc_shell), "Layers & Channels");
gtk_window_set_wmclass (GTK_WINDOW (lc_shell), "layers_and_channels", "Gimp");
gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (lc_shell)->vbox), 2);
gtk_signal_connect (GTK_OBJECT (lc_shell), "delete_event",
gtk_signal_connect (GTK_OBJECT (lc_shell),
"delete_event",
GTK_SIGNAL_FUNC (lc_dialog_close_callback),
NULL);
gtk_signal_connect (GTK_OBJECT (lc_shell),
"destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
&lc_shell);
gtk_quit_add_destroy (1, GTK_OBJECT (lc_shell));
lc_subshell = gtk_vbox_new(FALSE, 1);
gtk_box_pack_start (GTK_BOX(GTK_DIALOG(lc_shell)->vbox), lc_subshell, TRUE, TRUE, 0);
@ -337,8 +342,7 @@ lc_dialog_create (int gimage_id)
gtk_widget_hide (GTK_DIALOG(lc_shell)->action_area);
if (!GTK_WIDGET_VISIBLE (lc_shell))
gtk_widget_show (lc_shell);
gtk_widget_show (lc_shell);
/* Make sure the channels page is realized */
gtk_notebook_set_page (GTK_NOTEBOOK (notebook), 1);
@ -353,7 +357,7 @@ lc_dialog_create (int gimage_id)
if (!GTK_WIDGET_VISIBLE (lc_shell))
gtk_widget_show (lc_shell);
else
gdk_window_raise (lc_shell->window); /* ??? */
gdk_window_raise (lc_shell->window);
layers_dialog_update (gimage_id);
channels_dialog_update (gimage_id);
@ -371,9 +375,6 @@ lc_dialog_update_image_list ()
if (lc_shell == NULL)
return;
gtk_option_menu_remove_menu (GTK_OPTION_MENU (image_option_menu));
/* gtk_widget_destroy (image_menu); */
default_id = layersD->gimage_id;
layersD->gimage_id = -1; /* ??? */
image_menu = create_image_menu (&default_id, &default_index, image_menu_callback);
@ -413,9 +414,6 @@ lc_dialog_free ()
channels_dialog_free ();
gtk_widget_destroy (lc_shell);
gtk_widget_unref (lc_shell);
lc_shell = NULL;
}
void
@ -427,12 +425,10 @@ lc_dialog_rebuild (int new_preview_size)
gimage_id = -1;
flag = 0;
if (lc_shell!=NULL)
if (lc_shell)
{
flag = 1;
gimage_id = layersD->gimage_id;
if (GTK_WIDGET_VISIBLE (lc_shell))
gtk_widget_hide (lc_shell);
lc_dialog_free ();
}
preview_size = new_preview_size;
@ -566,14 +562,14 @@ layers_dialog_free ()
layersD->floating_sel = NULL;
if (layersD->layer_preview)
gtk_widget_destroy (layersD->layer_preview);
gtk_object_sink (GTK_OBJECT (layersD->layer_preview));
if (layersD->green_gc)
gdk_gc_destroy (layersD->green_gc);
if (layersD->red_gc)
gdk_gc_destroy (layersD->red_gc);
if (layersD->ops_menu)
gtk_widget_destroy (layersD->ops_menu);
gtk_object_sink (GTK_OBJECT (layersD->ops_menu));
g_free (layersD);
layersD = NULL;
@ -789,7 +785,8 @@ layers_dialog_update (int gimage_id)
list = g_slist_next(list);
layer_widget_delete (lw);
}
g_slist_free (layersD->layer_widgets);
if (layersD->layer_widgets)
g_warning ("layersD->layer_widgets not empty!");
layersD->layer_widgets = NULL;
if (! (gimage = gimage_get_ID (layersD->gimage_id)))
@ -1288,14 +1285,10 @@ layers_dialog_remove_layer (Layer * layer)
list = g_list_append (list, layer_widget->list_item);
gtk_list_remove_items (GTK_LIST (layersD->layer_list), list);
/* Delete the list item */
gtk_widget_destroy (layer_widget->list_item);
gtk_widget_unref (layer_widget->list_item);
suspend_gimage_notify--;
/* Delete layer widget */
layer_widget_delete (layer_widget);
suspend_gimage_notify--;
}
@ -1808,15 +1801,11 @@ static gint
lc_dialog_close_callback (GtkWidget *w,
gpointer client_data)
{
if (!lc_shell)
return FALSE;
if (GTK_WIDGET_VISIBLE (lc_shell))
gtk_widget_hide (lc_shell);
if (layersD)
layersD->gimage_id = -1;
gtk_widget_hide (lc_shell);
return TRUE;
}
@ -1860,7 +1849,6 @@ create_layer_widget (GImage *gimage,
GtkWidget *alignment;
list_item = gtk_list_item_new ();
gtk_widget_ref (GTK_WIDGET (list_item));
/* create the layer widget and add it to the list */
layer_widget = (LayerWidget *) g_malloc (sizeof (LayerWidget));
@ -1981,6 +1969,8 @@ create_layer_widget (GImage *gimage,
gtk_widget_show (hbox);
gtk_widget_show (vbox);
gtk_widget_show (list_item);
gtk_widget_ref (layer_widget->list_item);
return layer_widget;
}
@ -1998,6 +1988,7 @@ layer_widget_delete (LayerWidget *layer_widget)
layersD->layer_widgets = g_slist_remove (layersD->layer_widgets, layer_widget);
/* Free the widget */
gtk_widget_unref (layer_widget->list_item);
g_free (layer_widget);
}

View File

@ -24,7 +24,7 @@
#include "dbbrowser_utils.h"
void
GtkWidget*
gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
gchar *selected_scheme_proc_name,
gchar *selected_proc_blurb,
@ -54,7 +54,7 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
dbbrowser->apply_callback = apply_callback;
/* the dialog box */
dbbrowser->dlg = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dbbrowser->dlg), "DB Browser (init)");
@ -189,6 +189,8 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
/* first search (all procedures) */
dialog_search_callback( NULL, (gpointer)dbbrowser );
return dbbrowser->dlg;
}

View File

@ -24,7 +24,7 @@
#include "dbbrowser_utils.h"
void
GtkWidget*
gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
gchar *selected_scheme_proc_name,
gchar *selected_proc_blurb,
@ -54,7 +54,7 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
dbbrowser->apply_callback = apply_callback;
/* the dialog box */
dbbrowser->dlg = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dbbrowser->dlg), "DB Browser (init)");
@ -189,6 +189,8 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
/* first search (all procedures) */
dialog_search_callback( NULL, (gpointer)dbbrowser );
return dbbrowser->dlg;
}

View File

@ -118,7 +118,7 @@ run (char *name,
gtk_init (&argc, &argv);
gtk_rc_parse (gimp_gtkrc ());
gimp_db_browser(NULL);
gtk_quit_add_destroy (1, (GtkObject*) gimp_db_browser (NULL));
gtk_main ();
gdk_flush ();

View File

@ -118,7 +118,7 @@ run (char *name,
gtk_init (&argc, &argv);
gtk_rc_parse (gimp_gtkrc ());
gimp_db_browser(NULL);
gtk_quit_add_destroy (1, (GtkObject*) gimp_db_browser (NULL));
gtk_main ();
gdk_flush ();

View File

@ -25,7 +25,7 @@
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
void
GtkWidget*
gimp_db_browser (void (* apply_callback)
( gchar *selected_proc_name,
gchar *selected_scheme_proc_name,

View File

@ -24,7 +24,7 @@
#include "dbbrowser_utils.h"
void
GtkWidget*
gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
gchar *selected_scheme_proc_name,
gchar *selected_proc_blurb,
@ -54,7 +54,7 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
dbbrowser->apply_callback = apply_callback;
/* the dialog box */
dbbrowser->dlg = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dbbrowser->dlg), "DB Browser (init)");
@ -189,6 +189,8 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
/* first search (all procedures) */
dialog_search_callback( NULL, (gpointer)dbbrowser );
return dbbrowser->dlg;
}

View File

@ -24,7 +24,7 @@
#include "dbbrowser_utils.h"
void
GtkWidget*
gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
gchar *selected_scheme_proc_name,
gchar *selected_proc_blurb,
@ -54,7 +54,7 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
dbbrowser->apply_callback = apply_callback;
/* the dialog box */
dbbrowser->dlg = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dbbrowser->dlg), "DB Browser (init)");
@ -189,6 +189,8 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
/* first search (all procedures) */
dialog_search_callback( NULL, (gpointer)dbbrowser );
return dbbrowser->dlg;
}

View File

@ -24,7 +24,7 @@
#include "dbbrowser_utils.h"
void
GtkWidget*
gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
gchar *selected_scheme_proc_name,
gchar *selected_proc_blurb,
@ -54,7 +54,7 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
dbbrowser->apply_callback = apply_callback;
/* the dialog box */
dbbrowser->dlg = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dbbrowser->dlg), "DB Browser (init)");
@ -189,6 +189,8 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
/* first search (all procedures) */
dialog_search_callback( NULL, (gpointer)dbbrowser );
return dbbrowser->dlg;
}

View File

@ -118,7 +118,7 @@ run (char *name,
gtk_init (&argc, &argv);
gtk_rc_parse (gimp_gtkrc ());
gimp_db_browser(NULL);
gtk_quit_add_destroy (1, (GtkObject*) gimp_db_browser (NULL));
gtk_main ();
gdk_flush ();

View File

@ -181,6 +181,10 @@ script_fu_console_interface ()
gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
(GtkSignalFunc) script_fu_close_callback,
NULL);
gtk_signal_connect (GTK_OBJECT (dlg),
"destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
&dlg);
gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (dlg)->vbox), 2);
gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (dlg)->action_area), 2);
@ -315,7 +319,8 @@ script_fu_console_interface ()
gtk_main ();
gdk_input_remove (cint.input_id);
gtk_widget_destroy (dlg);
if (dlg)
gtk_widget_destroy (dlg);
gdk_flush ();
}
@ -358,7 +363,7 @@ static void
script_fu_browse_callback(GtkWidget *widget,
gpointer data)
{
gimp_db_browser(apply_callback);
gtk_quit_add_destroy (1, (GtkObject*) gimp_db_browser (apply_callback));
}
static void