]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/notebook.cpp
More for wxPython 2.0b9 (hopefully the last...)
[wxWidgets.git] / src / gtk / notebook.cpp
index eb13d01f4646f2f0562ee20ba90dacd0bc683fe5..60df767b8f74f0fead9e955d680801734cd69f62 100644 (file)
 #include "wx/gtk/win_gtk.h"
 #include "gdk/gdkkeysyms.h"
 
+//-----------------------------------------------------------------------------
+// idle system
+//-----------------------------------------------------------------------------
+
+extern void wxapp_install_idle_handler();
+extern bool g_isIdle;
+
 //-----------------------------------------------------------------------------
 // data
 //-----------------------------------------------------------------------------
 
 extern bool   g_blockEventsOnDrag;
 
+//-----------------------------------------------------------------------------
+// debug
+//-----------------------------------------------------------------------------
+
+#ifdef __WXDEBUG__
+
+extern void debug_focus_in( GtkWidget* widget, const wxChar* name, const wxChar *window );
+
+#endif
+
 //-----------------------------------------------------------------------------
 // wxNotebookPage
 //-----------------------------------------------------------------------------
@@ -86,6 +103,8 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
                                               gint nPage,
                                               gpointer data)
 {
+    if (g_isIdle) wxapp_install_idle_handler();
+
     wxNotebook *notebook = (wxNotebook *)data;
 
     int old = notebook->GetSelection();
@@ -104,12 +123,14 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
 
 static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
 {
+    if (g_isIdle) wxapp_install_idle_handler();
+
     if ((win->m_x == alloc->x) &&
         (win->m_y == alloc->y) &&
         (win->m_width == alloc->width) &&
         (win->m_height == alloc->height))
     {
-//        return;
+        return;
     }
     
     win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
@@ -124,6 +145,8 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
 static gint
 gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxNotebook *notebook )
 {
+    if (g_isIdle) wxapp_install_idle_handler();
+
     if (g_blockEventsOnDrag) return FALSE;
 
     if (!notebook->HasVMT()) return FALSE;
@@ -233,6 +256,10 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
 
     m_widget = gtk_notebook_new();
 
+#ifdef __WXDEBUG__
+    debug_focus_in( m_widget, _T("wxNotebook::m_widget"), name );
+#endif
+
     gtk_notebook_set_scrollable( GTK_NOTEBOOK(m_widget), 1 );
 
     m_idHandler = gtk_signal_connect (