]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/window.cpp
Removed obsolete ODBC classes.
[wxWidgets.git] / src / gtk1 / window.cpp
index 7d50b4b936ab4d859b4ed342e973586732e14b34..a18db75fb5bc546c8d6aa3480b52a396a907ce31 100644 (file)
@@ -1912,7 +1912,7 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
 
     wxLogTrace(TRACE_FOCUS,
                _T("%s: focus in"), win->GetName().c_str());
-    
+
 #ifdef HAVE_XIM
     if (win->m_ic)
         gdk_im_begin(win->m_ic, win->m_wxwindow->window);
@@ -2275,21 +2275,6 @@ wxWindow *wxWindowBase::FindFocus()
     return (wxWindow *)g_focusWindow;
 }
 
-//-----------------------------------------------------------------------------
-// "destroy" event
-//-----------------------------------------------------------------------------
-
-// VZ: Robert commented the code using out so it generates warnings: should
-//     be either fixed or removed completely
-#if 0
-
-static void gtk_window_destroy_callback( GtkWidget* widget, wxWindow *win )
-{
-    wxWindowDestroyEvent event(win);
-    win->GetEventHandler()->ProcessEvent(event);
-}
-
-#endif // 0
 
 //-----------------------------------------------------------------------------
 // "realize" from m_widget
@@ -2735,6 +2720,8 @@ bool wxWindowGTK::Create( wxWindow *parent,
 
 wxWindowGTK::~wxWindowGTK()
 {
+    SendDestroyEvent();
+
     if (g_focusWindow == this)
         g_focusWindow = NULL;
 
@@ -2940,11 +2927,6 @@ void wxWindowGTK::ConnectWidget( GtkWidget *widget )
 
     gtk_signal_connect( GTK_OBJECT(widget), "leave_notify_event",
       GTK_SIGNAL_FUNC(gtk_window_leave_callback), (gpointer)this );
-
-    // This keeps crashing on me. RR.
-    //
-    // gtk_signal_connect( GTK_OBJECT(widget), "destroy",
-    //  GTK_SIGNAL_FUNC(gtk_window_destroy_callback), (gpointer)this );
 }
 
 bool wxWindowGTK::Destroy()
@@ -3438,7 +3420,7 @@ int wxWindowGTK::GetCharHeight() const
     pango_layout_line_get_extents(line, NULL, &rect);
 
     g_object_unref( G_OBJECT( layout ) );
-    
+
     return (int) (rect.height / PANGO_SCALE);
 #else
     GdkFont *font = m_font.GetInternalFont( 1.0 );
@@ -3471,7 +3453,7 @@ int wxWindowGTK::GetCharWidth() const
     pango_layout_line_get_extents(line, NULL, &rect);
 
     g_object_unref( G_OBJECT( layout ) );
-    
+
     return (int) (rect.width / PANGO_SCALE);
 #else
     GdkFont *font = m_font.GetInternalFont( 1.0 );
@@ -4145,12 +4127,16 @@ void wxWindowGTK::SetWidgetStyle()
 
     GtkStyle *style = GetWidgetStyle();
 
-#ifndef __WXGTK20__
     if (m_font != wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ))
     {
-        SET_STYLE_FONT(style, m_font.GetInternalFont( 1.0 ));
-    }
+#ifdef __WXGTK20__
+        pango_font_description_free( style->font_desc );
+        pango_font_description_copy( m_font.GetNativeFontInfo()->description );
+#else
+        gdk_font_unref( style->font );
+        style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
 #endif
+    }
 
     if (m_foregroundColour.Ok())
     {