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

Re: [pygame] OcempGUI help neede on container



Johan Geldenhuys <johan@xxxxxxxxxxxxxxx>:

[...]
> The next big steps is to put the words in my main playing field and to
> hide the words. I am not sure what to use to populate the field with the
> letters.
> I thought of a image for each letter and the main field to be about 15
> letters down and 15 across.
>
> Any ideas and comments on my code and how I can use OcempGUI to do what
> I want?

This sounds like a job for a Table widget, if I got you right. You want
to have a game field looking like the following, not?

-------------
|A|X|T|F|O|P...
|C|E|D|G|Z|U...
...

If so, the best would be to use a Table with 15 rows and 15 columns and to
place buttons with the given letter in each of its cells:

tbl_words = Table (ROWS, COLUMNS)
...

for i in tbl_words.rows:
    for j in tbl_words.columns:
         table.add_child (i, j, Button (LETTER))

Now you can easily check for the correct button by binding its SIG_CLICKED
signal to your specific actions.

For special issues with the toolkit I recommend you to post to the ocempgui
mailing list[0] as this is not exactly the right place.

[0] http://lists.sourceforge.net/lists/listinfo/ocemp-devel

Regards
Marcus