Carlos, what I was trying to tell you is the following: you have two resize events on canvas before reaching full size. And if you use size() before the last event, it is smaller. You need to handle resize callback. Please, take a look in the following program:
Code:
from appuifw import *
import e32
import graphics
cv = None
f = open('e:\\szcanvas.txt','wt')
def resize_canvas(sz):
global f
global cv
f.write('size: %d,%d\r\n'%sz)
if cv:
f.write('b) canvas size: %d,%d\r\n'%cv.size)
f.flush()
lock = e32.Ao_lock()
app.menu = [(u"Quit", lambda: lock.signal())]
app.screen = "full_max"
cv = Canvas(resize_callback=resize_canvas)
f.write('a) canvas size: %d,%d\r\n'%cv.size)
app.body = cv
lock.wait()
f.close()
Its output after launching (do not rotate):
Code:
size: 360,487
a) canvas size: 360,487
size: 360,640
b) canvas size: 360,640
Got it ? Original size is 360,487 but after two resize callback, size() will return 360,640.