corrected bug with alignment of static labels with GTK 2 (replaces patch 760066; closes bug 759375)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21883 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-07-10 22:32:52 +00:00
parent 7f0586ef60
commit e1f448eeef
5 changed files with 71 additions and 12 deletions

View File

@@ -22,6 +22,11 @@
#include "gdk/gdk.h"
#include "gtk/gtk.h"
extern "C"
void wxgtk_window_size_request_callback(GtkWidget *widget,
GtkRequisition *requisition,
wxWindow *win);
//-----------------------------------------------------------------------------
// wxStaticText
//-----------------------------------------------------------------------------
@@ -87,6 +92,23 @@ bool wxStaticText::Create(wxWindow *parent,
PostCreation();
// the bug below only happens with GTK 2
#ifdef __WXGTK20__
if ( justify != GTK_JUSTIFY_LEFT )
{
// if we let GTK call wxgtk_window_size_request_callback the label
// always shrinks to its minimal size for some reason and so no
// alignment except the default left doesn't work (in fact it does,
// but you don't see it)
gtk_signal_disconnect_by_func
(
GTK_OBJECT(m_widget),
GTK_SIGNAL_FUNC(wxgtk_window_size_request_callback),
(gpointer) this
);
}
#endif // __WXGTK20__
ApplyWidgetStyle();
wxControl::SetFont( parent->GetFont() );