From 2c65342596e10da4ca0a8219a7885b34cec7a6cc Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Sat, 29 Nov 2003 03:34:01 +0000 Subject: [PATCH] Delay doing a gtk_widget_show on notebook until it is known if any pages are visible or not. Doing the show on a notebook with all hidden pages causes a crash on Fedora Core 1/Gnome 2.4. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@358 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- glabels2/src/object-editor.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/glabels2/src/object-editor.c b/glabels2/src/object-editor.c index e979d4f4..0b28c9e5 100644 --- a/glabels2/src/object-editor.c +++ b/glabels2/src/object-editor.c @@ -154,7 +154,6 @@ gl_object_editor_init (glObjectEditor *editor) /* Hide all notebook pages to start with. */ gtk_widget_hide_all (editor->priv->notebook); - gtk_widget_show (editor->priv->notebook); gl_debug (DEBUG_EDITOR, "END"); } @@ -233,6 +232,7 @@ gl_object_notebook_construct_valist (glObjectEditor *editor, va_list args) { glObjectEditorOption option; + gint pages = 0; gl_debug (DEBUG_EDITOR, "START"); @@ -249,43 +249,53 @@ gl_object_notebook_construct_valist (glObjectEditor *editor, case GL_OBJECT_EDITOR_POSITION_PAGE: gl_object_editor_prepare_position_page (editor); + pages++; break; case GL_OBJECT_EDITOR_SIZE_PAGE: case GL_OBJECT_EDITOR_SIZE_IMAGE_PAGE: gl_object_editor_prepare_size_page (editor, option); + pages++; break; case GL_OBJECT_EDITOR_SIZE_LINE_PAGE: gl_object_editor_prepare_lsize_page (editor); + pages++; break; case GL_OBJECT_EDITOR_FILL_PAGE: gl_object_editor_prepare_fill_page (editor); + pages++; break; case GL_OBJECT_EDITOR_LINE_PAGE: gl_object_editor_prepare_line_page (editor); + pages++; break; case GL_OBJECT_EDITOR_IMAGE_PAGE: gl_object_editor_prepare_image_page (editor); + pages++; break; case GL_OBJECT_EDITOR_TEXT_PAGE: gl_object_editor_prepare_text_page (editor); + pages++; break; case GL_OBJECT_EDITOR_EDIT_PAGE: gl_object_editor_prepare_edit_page (editor); + pages++; break; case GL_OBJECT_EDITOR_BC_PAGE: gl_object_editor_prepare_bc_page (editor); + pages++; break; case GL_OBJECT_EDITOR_DATA_PAGE: gl_object_editor_prepare_data_page (editor); + pages++; break; default: @@ -294,6 +304,9 @@ gl_object_notebook_construct_valist (glObjectEditor *editor, } } + if (pages) { + gtk_widget_show (editor->priv->notebook); + } gl_debug (DEBUG_EDITOR, "END"); } -- 2.39.5