GtkComboBoxTextEntry for input of multi-digits numbers



For a small GTK+ application (http://www.ssalewski.de/PetEd.html.en) I
need a way to let the user select some multi-digit integer values from a
discontiguous list with the additional ability to add custom values. For
example the list may have values "100, 50, 25, 10", the user can select
one of these or enter another like 75.

I was going to use
http://developer.gnome.org/gtk3/stable/GtkComboBoxText.html
with text entry. The problem is, that I have to connect to "changed"
signal, which is emitted on every keystroke. So I get "7" followed by
"75" for active text when user input is "75". There seems to be no way
to wait for the enter key pressed. This is really bad, because the input
is for a graphical tool, input value is the grid size, and we will get
unwanted wrong redraws.

Another way may be to use a 
http://developer.gnome.org/gtk3/stable/GtkSpinButton.html
but I have no idea how I can enforce discrete, non equidistant values
like "100, 50, 25, 10" when clicking on the arrows.

I have found some people asking similar questions, but no answer.

Best regards,

Stefan Salewski




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]