[Seaside] getting the browser's screen resolution?

Lukas Renggli renggli at gmail.com
Mon Mar 26 06:49:02 UTC 2007


> Hi Lukas. Since most methods in Seaside are undocumented, and it seems
> difficult to deduce what should I do from what you wrote, can you show me
> how to get those current values (how to trigger the callback to set weight
> and height)?

I asked Google for you and transformed everything to Seaside. The only
thing remaining for you to do is to copy the code into a rendering
method and to create the instance-variables width and height.

> html script: (html request
>     callback: [ :value | width := value ] value: (SUStream on:
> 'window.innerWidth || document.documentElement.clientWidth
> ||
> document.body.clientWidth || 0');
>     callback: [ :value | height := value ] value: (SUStream on:
> 'window.innerHeight ||
> document.documentElement.clientHeight ||
> document.body.clientHeight || 0'))

The object returned by #request -- the class SURequest -- has a nice
class comment. The key method here -- #callback:value: -- is well
documented.

Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the seaside mailing list