fixed crash when return is pressed in a spinctrl inside a parent which is not a GtkWindow
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
9f14a81890
commit
fa8a793a6f
@ -259,12 +259,20 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event )
|
||||
wxWindow *top_frame = m_parent;
|
||||
while (top_frame->GetParent() && !(top_frame->GetParent()->IsTopLevel()))
|
||||
top_frame = top_frame->GetParent();
|
||||
GtkWindow *window = GTK_WINDOW(top_frame->m_widget);
|
||||
|
||||
if (window->default_widget)
|
||||
if ( GTK_IS_WINDOW(top_frame->m_widget) )
|
||||
{
|
||||
gtk_widget_activate (window->default_widget);
|
||||
return;
|
||||
GtkWindow *window = GTK_WINDOW(top_frame->m_widget);
|
||||
if ( window )
|
||||
{
|
||||
GtkWidget *widgetDef = window->default_widget;
|
||||
|
||||
if ( widgetDef && GTK_IS_WINDOW(widgetDef) )
|
||||
{
|
||||
gtk_widget_activate(widgetDef);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -259,12 +259,20 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event )
|
||||
wxWindow *top_frame = m_parent;
|
||||
while (top_frame->GetParent() && !(top_frame->GetParent()->IsTopLevel()))
|
||||
top_frame = top_frame->GetParent();
|
||||
GtkWindow *window = GTK_WINDOW(top_frame->m_widget);
|
||||
|
||||
if (window->default_widget)
|
||||
if ( GTK_IS_WINDOW(top_frame->m_widget) )
|
||||
{
|
||||
gtk_widget_activate (window->default_widget);
|
||||
return;
|
||||
GtkWindow *window = GTK_WINDOW(top_frame->m_widget);
|
||||
if ( window )
|
||||
{
|
||||
GtkWidget *widgetDef = window->default_widget;
|
||||
|
||||
if ( widgetDef && GTK_IS_WINDOW(widgetDef) )
|
||||
{
|
||||
gtk_widget_activate(widgetDef);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user