On 6/20/07, Lars Clausen <[EMAIL PROTECTED]> wrote:

On Wed, 2007-06-20 at 13:05 -0500, Patrick Hallinan wrote:
>
>
> On 6/20/07, Lars Clausen <[EMAIL PROTECTED]> wrote:
>         On Tue, 2007-06-12 at 00:04 -0500, Patrick Hallinan wrote:
>         >
>         >
>         >         On 6/7/07, Lars Clausen < [EMAIL PROTECTED]> wrote:
>         >
>         >                 Committed.  It's missing the middle button
>         drag that's
>         >                 normally there
>         >                 when right-mouse is the object menu.
>         >
>         > Hopefully we'll eventually make all of this beautiful.
>
>         Hopefully, but first I want to make it work.  The diagram
>         still doesn't
>         show at first open, there's still a double-close thing, and
>         the zoom
>         widget in the toolbar is less useful than the old one.
>
> The zoom thing is on my todo but the diagram not showing on first open
> is news.  I think I have seen the double-close thing.  I was hoping
> that it wasn't me :).

The no-show is consistent for me, no matter which way the diagram is
created.  Looks like a signal either is not fired or not received (maybe
the receiver is not set when the signal is fired?).

I have GTK 2.8.20 and GLib 2.10.3 on an Ubuntu Dapper Drake x86 box.


I think I saw the same problem with Debian Etch.  GTK 2.8.20 and GLib 2.12.4.
The attached patch fixes the problem on Etch.  I don't really know why.  I
played around with the order of things.

Pat.
Index: interface.c
===================================================================
--- interface.c	(revision 3703)
+++ interface.c	(working copy)
@@ -455,6 +455,7 @@
   GtkWidget *close_button;         /* Close button for the notebook page */
   GtkWidget *widget;
   GtkRcStyle *rcstyle;
+  gint       notebook_page_index;
 	
   ddisp->is_standalone_window = FALSE;
 
@@ -463,13 +464,6 @@
   /* Statusbar */
   ddisp->modified_status = GTK_WIDGET (ui.statusbar);
  
-  /* Create a new tab page */
-  ddisp->container = gtk_vbox_new(FALSE, 0);
-  gtk_widget_set_events (ddisp->container,
-                         GDK_POINTER_MOTION_MASK |
-                         GDK_POINTER_MOTION_HINT_MASK |
-                         GDK_FOCUS_CHANGE_MASK);
-
   tab_label_container = gtk_hbox_new(FALSE,3);
   
   label = gtk_label_new( title );
@@ -500,6 +494,17 @@
   gtk_widget_show (close_button);
   gtk_widget_show (image);
 
+  /* Create a new tab page */
+  ddisp->container = gtk_vbox_new(FALSE, 0);
+  gtk_widget_set_events (ddisp->container,
+                         GDK_POINTER_MOTION_MASK |
+                         GDK_POINTER_MOTION_HINT_MASK |
+                         GDK_FOCUS_CHANGE_MASK);
+
+  notebook_page_index = gtk_notebook_append_page (GTK_NOTEBOOK(ui.diagram_notebook),
+                                                  ddisp->container,
+                                                  tab_label_container);
+
   g_object_set_data (G_OBJECT (ddisp->container), "DDisplay",  ddisp);
   g_object_set_data (G_OBJECT (ddisp->container), "tab-label", label);
   g_object_set_data (G_OBJECT (ddisp->container), "window",    ui.main_window);
@@ -613,21 +618,13 @@
   display_rulers_show (ddisp);
   gtk_widget_show (ddisp->canvas);
 
-  /* Ensure that the the new page is showing */
-  if (gtk_notebook_get_n_pages (ui.diagram_notebook) > 1)
-  {
-    gtk_notebook_set_current_page (ui.diagram_notebook,
-                                   gtk_notebook_get_n_pages (ui.diagram_notebook)-1);
-  }
+  /* Show new page */
+  gtk_notebook_set_current_page (ui.diagram_notebook, notebook_page_index);
 
   integrated_ui_toolbar_grid_snap_synchronize_to_display (ddisp);
 
   integrated_ui_toolbar_object_snap_synchronize_to_display (ddisp);
 
-  gtk_notebook_append_page (GTK_NOTEBOOK(ui.diagram_notebook),
-                            ddisp->container,
-                            tab_label_container);
-
   /* TODO: Figure out how to detect if anti-aliased renderer was set */
   /** For the distributed display this is called when the ddisp->canvas is shown.
    * The show causes a GDK_CONFIGURE event but this is not happening here.  If this
_______________________________________________
Dia-list mailing list
Dia-list@gnome.org
http://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://live.gnome.org/Dia/Faq
Main page at http://live.gnome.org/Dia

Reply via email to