]> git.saurik.com Git - wxWidgets.git/commitdiff
Small change to SetFont() logic.
authorRobert Roebling <robert@roebling.de>
Sun, 14 Nov 1999 17:04:36 +0000 (17:04 +0000)
committerRobert Roebling <robert@roebling.de>
Sun, 14 Nov 1999 17:04:36 +0000 (17:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4555 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/stattext.cpp
src/gtk/window.cpp
src/gtk1/stattext.cpp
src/gtk1/window.cpp

index 2055e54fd51de5510f31cdb94a6fd18cd808c2d1..011b4b21a678e42ee5a3e37690acdf289077a082 100644 (file)
@@ -62,6 +62,8 @@ bool wxStaticText::Create(wxWindow *parent,
     wxControl::SetLabel(label);
     m_widget = gtk_label_new( m_label.mbc_str() );
 
+    SetFont( parent->GetFont() );
+
     GtkJustification justify;
     if ( style & wxALIGN_CENTER )
       justify = GTK_JUSTIFY_CENTER;
@@ -89,8 +91,6 @@ bool wxStaticText::Create(wxWindow *parent,
 
     SetBackgroundColour( parent->GetBackgroundColour() );
     SetForegroundColour( parent->GetForegroundColour() );
-    SetFont( parent->GetFont() );
-
     Show( TRUE );
 
     return TRUE;
index fc518a25aba93bfb9798868f027bad39e34b9d2e..3a99320b83ac98f17898c287978e40ec5f62e291 100644 (file)
@@ -2758,7 +2758,7 @@ void wxWindow::SetWidgetStyle()
 
     if (m_foregroundColour.Ok())
     {
-        m_foregroundColour.CalcPixel( gdk_window_get_colormap( m_widget->window ) );
+        m_foregroundColour.CalcPixel( gtk_widget_get_colormap( m_widget ) );
         style->fg[GTK_STATE_NORMAL] = *m_foregroundColour.GetColor();
         style->fg[GTK_STATE_PRELIGHT] = *m_foregroundColour.GetColor();
         style->fg[GTK_STATE_ACTIVE] = *m_foregroundColour.GetColor();
@@ -2766,7 +2766,7 @@ void wxWindow::SetWidgetStyle()
 
     if (m_backgroundColour.Ok())
     {
-        m_backgroundColour.CalcPixel( gdk_window_get_colormap( m_widget->window ) );
+        m_backgroundColour.CalcPixel( gtk_widget_get_colormap( m_widget ) );
         style->bg[GTK_STATE_NORMAL] = *m_backgroundColour.GetColor();
         style->base[GTK_STATE_NORMAL] = *m_backgroundColour.GetColor();
         style->bg[GTK_STATE_PRELIGHT] = *m_backgroundColour.GetColor();
@@ -2896,26 +2896,7 @@ bool wxWindow::SetFont( const wxFont &font )
 
     if (!wxWindowBase::SetFont(font))
     {
-        // don't leave if the GTK widget has just
-        // been realized
-        if (!m_delayedFont) return FALSE;
-    }
-
-    GdkWindow *window = (GdkWindow*) NULL;
-    if (m_wxwindow)
-        window = GTK_PIZZA(m_wxwindow)->bin_window;
-    else
-        window = GetConnectWidget()->window;
-        
-    if (!window)
-    {
-        // indicate that a new style has been set
-        // but it couldn't get applied as the
-        // widget hasn't been realized yet.
-        m_delayedFont = TRUE;
-
-        // pretend we have done something
-        return TRUE;
+        return FALSE;
     }
 
     wxColour sysbg = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE );
index 2055e54fd51de5510f31cdb94a6fd18cd808c2d1..011b4b21a678e42ee5a3e37690acdf289077a082 100644 (file)
@@ -62,6 +62,8 @@ bool wxStaticText::Create(wxWindow *parent,
     wxControl::SetLabel(label);
     m_widget = gtk_label_new( m_label.mbc_str() );
 
+    SetFont( parent->GetFont() );
+
     GtkJustification justify;
     if ( style & wxALIGN_CENTER )
       justify = GTK_JUSTIFY_CENTER;
@@ -89,8 +91,6 @@ bool wxStaticText::Create(wxWindow *parent,
 
     SetBackgroundColour( parent->GetBackgroundColour() );
     SetForegroundColour( parent->GetForegroundColour() );
-    SetFont( parent->GetFont() );
-
     Show( TRUE );
 
     return TRUE;
index fc518a25aba93bfb9798868f027bad39e34b9d2e..3a99320b83ac98f17898c287978e40ec5f62e291 100644 (file)
@@ -2758,7 +2758,7 @@ void wxWindow::SetWidgetStyle()
 
     if (m_foregroundColour.Ok())
     {
-        m_foregroundColour.CalcPixel( gdk_window_get_colormap( m_widget->window ) );
+        m_foregroundColour.CalcPixel( gtk_widget_get_colormap( m_widget ) );
         style->fg[GTK_STATE_NORMAL] = *m_foregroundColour.GetColor();
         style->fg[GTK_STATE_PRELIGHT] = *m_foregroundColour.GetColor();
         style->fg[GTK_STATE_ACTIVE] = *m_foregroundColour.GetColor();
@@ -2766,7 +2766,7 @@ void wxWindow::SetWidgetStyle()
 
     if (m_backgroundColour.Ok())
     {
-        m_backgroundColour.CalcPixel( gdk_window_get_colormap( m_widget->window ) );
+        m_backgroundColour.CalcPixel( gtk_widget_get_colormap( m_widget ) );
         style->bg[GTK_STATE_NORMAL] = *m_backgroundColour.GetColor();
         style->base[GTK_STATE_NORMAL] = *m_backgroundColour.GetColor();
         style->bg[GTK_STATE_PRELIGHT] = *m_backgroundColour.GetColor();
@@ -2896,26 +2896,7 @@ bool wxWindow::SetFont( const wxFont &font )
 
     if (!wxWindowBase::SetFont(font))
     {
-        // don't leave if the GTK widget has just
-        // been realized
-        if (!m_delayedFont) return FALSE;
-    }
-
-    GdkWindow *window = (GdkWindow*) NULL;
-    if (m_wxwindow)
-        window = GTK_PIZZA(m_wxwindow)->bin_window;
-    else
-        window = GetConnectWidget()->window;
-        
-    if (!window)
-    {
-        // indicate that a new style has been set
-        // but it couldn't get applied as the
-        // widget hasn't been realized yet.
-        m_delayedFont = TRUE;
-
-        // pretend we have done something
-        return TRUE;
+        return FALSE;
     }
 
     wxColour sysbg = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE );