X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e8e24dfa9322702d56a125586a7d4a37f4a5dfd7..d13ea3aa4f95c30358fcfb8af8b183191779ec81:/src/gtk1/spinctrl.cpp diff --git a/src/gtk1/spinctrl.cpp b/src/gtk1/spinctrl.cpp index e071efbce9..ff4ee9faeb 100644 --- a/src/gtk1/spinctrl.cpp +++ b/src/gtk1/spinctrl.cpp @@ -228,6 +228,19 @@ void wxSpinCtrl::SetValue( int value ) GtkEnableEvents(); } +void wxSpinCtrl::SetSelection(long from, long to) +{ + // translate from wxWindows conventions to GTK+ ones: (-1, -1) means the + // entire range + if ( from == -1 && to == -1 ) + { + from = 0; + to = INT_MAX; + } + + gtk_editable_select_region( GTK_EDITABLE(m_widget), (gint)from, (gint)to ); +} + void wxSpinCtrl::SetRange(int minVal, int maxVal) { wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") );