X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bbd006c0cef461b829f51db586880c380c8785a2..695c21b11876abafeb68195e34f9f55816f92949:/src/gtk1/window.cpp diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index feb8f2ffce..a18db75fb5 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -1511,12 +1511,12 @@ wxWindowGTK *FindWindowForMouseEvent(wxWindowGTK *win, wxCoord& x, wxCoord& y) yy += pizza->yoffset; } - wxNode *node = win->GetChildren().First(); + wxWindowList::Node *node = win->GetChildren().GetFirst(); while (node) { - wxWindowGTK *child = (wxWindowGTK*)node->Data(); + wxWindowGTK *child = node->GetData(); - node = node->Next(); + node = node->GetNext(); if (!child->IsShown()) continue; @@ -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 ); @@ -4147,7 +4129,13 @@ void wxWindowGTK::SetWidgetStyle() 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())