diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index a03df573b1..986b3279b7 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -209,6 +209,17 @@ wxComboBox::~wxComboBox() m_clientDataList.Clear(); } +void wxComboBox::SetFocus() +{ + if ( m_hasFocus ) + { + // don't do anything if we already have focus + return; + } + + gtk_widget_grab_focus( m_focusWidget ); +} + void wxComboBox::AppendCommon( const wxString &item ) { wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index 474b60b633..4c95d23682 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -207,9 +207,11 @@ int wxDialog::ShowModal() } wxBusyCursorSuspender cs; // temporarily suppress the busy cursor - + Show( TRUE ); + SetFocus(); + m_modalShowing = TRUE; g_openDialogs++; diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 24b1885cee..ba4b2a14da 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -1313,7 +1313,7 @@ static wxString GetHotKey( const wxMenuItem& item ) default: if ( code < 127 ) { - gchar *name = gdk_keyval_name((guint)code); + wxString name = wxGTK_CONV_BACK( gdk_keyval_name((guint)code) ); if ( name ) { hotkey << name; diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp index a03df573b1..986b3279b7 100644 --- a/src/gtk1/combobox.cpp +++ b/src/gtk1/combobox.cpp @@ -209,6 +209,17 @@ wxComboBox::~wxComboBox() m_clientDataList.Clear(); } +void wxComboBox::SetFocus() +{ + if ( m_hasFocus ) + { + // don't do anything if we already have focus + return; + } + + gtk_widget_grab_focus( m_focusWidget ); +} + void wxComboBox::AppendCommon( const wxString &item ) { wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index 474b60b633..4c95d23682 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -207,9 +207,11 @@ int wxDialog::ShowModal() } wxBusyCursorSuspender cs; // temporarily suppress the busy cursor - + Show( TRUE ); + SetFocus(); + m_modalShowing = TRUE; g_openDialogs++; diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index 24b1885cee..ba4b2a14da 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -1313,7 +1313,7 @@ static wxString GetHotKey( const wxMenuItem& item ) default: if ( code < 127 ) { - gchar *name = gdk_keyval_name((guint)code); + wxString name = wxGTK_CONV_BACK( gdk_keyval_name((guint)code) ); if ( name ) { hotkey << name;