X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a6aa9b1ee8aaecdf0ca4618c2e6cccfb011f4599..8535af00e277ee89c877e9cb3ac357791119f497:/src/gtk1/notebook.cpp diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp index da7f735b6b..942914458c 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -21,10 +21,10 @@ #include "wx/intl.h" #include "wx/log.h" -#include "gdk/gdk.h" -#include "gtk/gtk.h" +#include +#include #include "wx/gtk/win_gtk.h" -#include "gdk/gdkkeysyms.h" +#include //----------------------------------------------------------------------------- // idle system @@ -124,21 +124,30 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height ); + /* GTK 1.2 up to version 1.2.5 is broken so that we have to call allocate + here in order to make repositioning after resizing to take effect. */ + if ((gtk_major_version == 1) && + (gtk_minor_version == 2) && + (gtk_micro_version < 6) && + (win->m_wxwindow) && + (GTK_WIDGET_REALIZED(win->m_wxwindow))) + { + gtk_widget_size_allocate( win->m_wxwindow, alloc ); + } } //----------------------------------------------------------------------------- // "realize" from m_widget //----------------------------------------------------------------------------- -/* GTK 1.2 up to version 1.2.5 is broken so that we have to call a queue_resize - here in order to take repositioning before showing to take effect. */ - static gint gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win ) { if (g_isIdle) wxapp_install_idle_handler(); + /* GTK 1.2 up to version 1.2.5 is broken so that we have to call a queue_resize + here in order to make repositioning before showing to take effect. */ gtk_widget_queue_resize( win->m_widget ); return FALSE; @@ -204,7 +213,7 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id, !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { wxFAIL_MSG( wxT("wxNoteBook creation failed") ); - return FALSE; + return FALSE; } @@ -221,15 +230,17 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id, m_parent->DoAddChild( this ); - if(m_windowStyle & wxNB_RIGHT) + if (m_windowStyle & wxNB_RIGHT) gtk_notebook_set_tab_pos( GTK_NOTEBOOK(m_widget), GTK_POS_RIGHT ); - if(m_windowStyle & wxNB_LEFT) + if (m_windowStyle & wxNB_LEFT) gtk_notebook_set_tab_pos( GTK_NOTEBOOK(m_widget), GTK_POS_LEFT ); - if(m_windowStyle & wxNB_BOTTOM) + if (m_windowStyle & wxNB_BOTTOM) gtk_notebook_set_tab_pos( GTK_NOTEBOOK(m_widget), GTK_POS_BOTTOM ); PostCreation(); + SetFont( parent->GetFont() ); + gtk_signal_connect( GTK_OBJECT(m_widget), "realize", GTK_SIGNAL_FUNC(gtk_notebook_realized_callback), (gpointer) this ); @@ -616,6 +627,8 @@ bool wxNotebook::DoPhase( int WXUNUSED(nPhase) ) void wxNotebook::ApplyWidgetStyle() { + // TODO, font for labels etc + SetWidgetStyle(); gtk_widget_set_style( m_widget, m_widgetStyle ); }