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

Re: [pygame] OcempGUI help neede on container



Thanks, Marcus.

I didn't know about that list.
You have the correct idea and I will try out your suggestion.
If I use a table and all the buttons in it is the same colour, I don't need the imagemap anymore? It will not be visible?
Can I change the colour of the button when it was clicked?

Thanks,
Johan

mva@xxxxxxxxxxxx wrote:
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