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

Re: [pygame] Testing for button in a table in OcempGUI



Marcus,

I used table.grid and found:
x = tbl_words.grid(word1_row_pos, word1_col_pos)
TypeError: 'dict' object is not callable

What is the best place to get the docs for OcempGUI?
I have the manual that comes with the installation, but can't find table.grid in there, but found other things with .grid.

Johan

Marcus von Appen wrote:
On, Thu Dec 29, 2005, Johan Geldenhuys wrote:

  
Hi all,

I have a Table(15, 15).
In this table I put specific buttons at random positions and at the rest 
of the positions I want to put random letters.

The way I do it now is to put my specific buttons in first and then the 
random ones.
The problem is that when I get to a position in the table where a 
specific buttons is in, my script stop: "Exception: Cell (7, 13) already 
occupied". I understand this, but how do I test for a position in a 
table and go on to the next available position? Is there a 
    

try:
    ...
except ...:
    ...

may help.

  
'table.have_child()' or something else I can test it with?
    

The table.grid is a dict, that contains key-value pairs of the children
as explained in the docs.

Regards
Marcus