[squeak-dev] Set Android window size (was Wireless/mobile)

Dimitry Golubovsky golubovsky at gmail.com
Tue Sep 13 12:47:09 UTC 2011


Stan Shepherd wrote:

> Could you expand on how you set the window size? I've not had any success
> with DisplayHostWindow or HostWindowProxy, nor can I find a setting.

I am not sure which window size you are asking about: window size that
the VM sees on a tablet, or window size on your development PC. I'll
try to answer both.

Window size on a tablet: it is determined from the onLayout method as
it is called by Android when the view is created. See


which calls a native method which stores the screen dimensions in a
pair of static cells which is used to shape the screen buffer, etc.
This actually works as when the onscreen keyboard pops up, it takes
the lower postion of the screen, and Pharo taskbar is repositioned
above the keyboard. You may see in the file /sdcard/jni.log what
actual screen dimensions are each time the screen is resized. So it is
not currently possible to control this from the interpreter.

Window size on PC: what is your OS? I use Linux/KDE, so here's what I
do to set Squeak window size similar to table screen size.

1. Resize the window, save image and quit. Next time you start the
image it must remember the last saved window dimensions.

2. If <1> does not work: tell the window manager that windows with
specific class (I don't remember exactly which window class is set,
most likely  "Squeak") are to be of certain size. but this will make
all squeak windows refardless of image to be of that size.

NB: it would be a useful functionality to set window/resource  class
from command line. I believe it is currently hardcoded in
platforms/unix/vm-display-X11/sqUnixX11.c ca. line 156
Such way, one could predefine resource classes e. g. Squeak800x480,
etc. to debug with various screen sizes.

3. Run a terminal emulator (konsole in my case, or maybe even xterm is
enough) in the desired geometry. See if there is a variable WINDOWID
in the environment. Pass its value to the VM using the  -browserWindow
 command line option. The VM will use the entire terminal window to
display the Squeak environment. But if you close the window, you will
not be asked whether to save the image, so be careful to save it

Not sure if any of these works in Windows or Mac.

Hope this helps.


Dimitry Golubovsky

Anywhere on the Web

More information about the Squeak-dev mailing list