0

I'm trying my luck with Shoes and wanted to create a number input. I know there's list_box but that's a simple dropdown select which would require an array of known numbers. However I don't know how many numbers the array will hold. It could be anything between 1 and 1000 or more. The user will have to decide that. And its methods (on The Shoes Manual website) don't seem to help me with my wish either.

To clarify what I mean with 'number input': In HTML5 we have <input type=number> and OS X has the Date Picker (or the Stepper + Text Field wich does, by my understanding, basically the same thing but consists of 2 objects).

Is there any way that I can create a number input like this with Shoes?

  • Don't try your luck. Shoes is a good gui library, but I don't think it is very useful. Use other gui library such as Tk. Gui library for ruby is kinda lacking. – SwiftMango Aug 04 '12 at 17:42
  • @texasbruce According to TkDocs Tk has the number input (called Spinbox) that I've been looking for. Thank you. – paddykontschak Aug 04 '12 at 19:52

1 Answers1

0

You are looking for the EditLine element. It can accept any text, and you can hook up your own checking algorithm to its change event (which can handle non-digits).

karatedog
  • 2,508
  • 19
  • 29