Something being either "screen cell1"(just a solid) or "screen cell2" (an imagebutton)
Using the up/down textbuttons to resize the grid works great for cell1 (solids) but not at all for cell2 (imagebutton)
To make it even stranger - The style inspector actually reports that the imagebuttons have increased in size (after hitting the up button a ton)
Anyone have any clue what's going on - and importantly how to fix it....
The idea is to end up with a board game where the user can increase/decrease the tile size - Hence the need for clickable imagebuttons in the grid
code: line 32/33 - switch between cell1 and cell2
Code: Select all
screen heading(val = None):
if val == None:
null
else:
text val
screen cell(arc):
add Solid("F00", xysize=(arc.size, arc.size))
screen cell2(arc2):
imagebutton:
idle Solid("F00", xysize=(arc2.size, arc2.size))
action NullAction()
at transform:
xsize arc2.size
ysize arc2.size
screen test_grid(arc):
vbox:
textbutton "up" action Function(arc.increase_size, 8)
textbutton "down" action Function(arc.decrease_size, 8)
grid 3 3:
spacing 5
use heading(None)
use heading("x0")
use heading("x1")
for y, row in enumerate(arc.thear):
use heading("y" + str(y))
for x, val in enumerate(row):
use cell(arc)
#use cell2(arc)
label start:
$ ac = Arclass()
show screen test_grid(ac)
"testing"
return
init python:
class Arclass:
def __init__(self):
self.thear = [[1,2],[3,4]]
self.size = 64
def increase_size(self, num):
self.size = self.size + num
def decrease_size(self, num):
self.size = self.size - num