to toolbar code since that is where the problem
is and it affects other controls, too.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43955
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
-extern "C" {
-static
-void gtkcombobox_size_callback( GtkWidget *widget,
- GtkAllocation *alloc,
- wxWindow *win )
-{
- if (win->GetParent()->m_wxwindow) return;
-
- // we are probably a wxToolBar
-
- wxSize size = win->GetEffectiveMinSize();
- if (size.y != alloc->height)
- {
- GtkAllocation alloc2;
- alloc2.x = alloc->x;
- alloc2.y = (alloc->height - size.y + 3) / 2;
- alloc2.width = alloc->width;
- alloc2.height = size.y;
- gtk_widget_size_allocate( widget, &alloc2 );
- }
-}
-}
-
#endif
//-----------------------------------------------------------------------------
#endif
//-----------------------------------------------------------------------------
g_signal_connect_after (m_widget, "changed",
G_CALLBACK (gtkcombobox_changed_callback), this);
g_signal_connect_after (m_widget, "changed",
G_CALLBACK (gtkcombobox_changed_callback), this);
- // Connect to in order to correct size_allocate events
- g_signal_connect_after (m_widget, "size_allocate",
- G_CALLBACK (gtkcombobox_size_callback), this);
+extern "C" {
+static
+void gtktoolwidget_size_callback( GtkWidget *widget,
+ GtkAllocation *alloc,
+ wxWindow *win )
+{
+ // this shouldn't happen...
+ if (win->GetParent()->m_wxwindow) return;
+
+ wxSize size = win->GetEffectiveMinSize();
+ if (size.y != alloc->height)
+ {
+ GtkAllocation alloc2;
+ alloc2.x = alloc->x;
+ alloc2.y = (alloc->height - size.y + 3) / 2;
+ alloc2.width = alloc->width;
+ alloc2.height = size.y;
+ gtk_widget_size_allocate( widget, &alloc2 );
+ }
+}
+}
//-----------------------------------------------------------------------------
// InsertChild callback for wxToolBar
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// InsertChild callback for wxToolBar
//-----------------------------------------------------------------------------
(const char *) NULL,
posGtk
);
(const char *) NULL,
posGtk
);
+
+ // connect after in order to correct size_allocate events
+ g_signal_connect_after (tool->GetControl()->m_widget, "size_allocate",
+ G_CALLBACK (gtktoolwidget_size_callback), tool->GetControl());
+