[gcompris-devel] Spinner/Slider/Textbox for Input

Bruno Coudoin bruno.coudoin at gcompris.net
Wed Dec 25 17:26:52 UTC 2013


Le 24/12/2013 23:11, Kesha Shah a écrit :
> I have got winter holidays now. Today, I started working upon making an
> activity to recognize the time from clock.  It is almost 85% done. Made
> three levels- first for introduction and the next two with increasing
> complexity to find the time. I found it pretty interesting and fun to do.
> But, I got stuck at a point, where I need your help.
Hi,

Have you seen that we already have an activity about this:
http://gcompris.net/screenshots-en.html#clockgame

>
> In my activity, I have shown the clock with arms of hour hand and minute
> hand. I need to take as input from the player, the hour and minute he
> reads. I guess a simple spinner with 1-12 for hour and 0-59 values for
> minute would be fine, but didn't get any related GooCanvas API for that. I
> thought of other alternatives as slider or two text-boxes to get value of
> hour and minute from user. What would be best way according to you ? Can
> you please provide some pointers (or example) for implementing it.
In our activity we don't have a level like you propose where the 
children must enter the numeric value following and analog clock.

To implement what you are trying to do there is several choices :

- Use a GtkEntry, you can see an example in guessnumber.py
- Just catch the keyboard and implement your own entry
- create a spinner on your own

Bruno.





More information about the Gcompris-devel mailing list