[squeak-dev] knowing World extent before redraw.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] knowing World extent before redraw.

Herbert König
Hello,

how do i know the World's extent before the World is redrawn after a
size change of the Squeak window?

User story: I wrote a (Win only) plugin which programmatically can
change the Squeak window's size. Alas the parameters only set the
outer window's size.

So in order to tightly fit the Squeak window around my application I
would have to:

self setWindowSize: x@y.
self waitUntilWindowHasWedawn
diff := x@y - World extent
self setWindowSize (x@y + diff)

I'd like to skip the second line if I could get diff earlier.

OTOH if a Windows knowable person would know how to set the size of
Squeak's client area that would be much nicer. I'm kind of C and
Winapi illiterate :-).

 

Thanks,

Herbert                          mailto:[hidden email]


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: knowing World extent before redraw.

Klaus D. Witzel
On Fri, 07 Mar 2008 18:19:57 +0100, Herbert König wrote:

> Hello,
>
> how do i know the World's extent before the World is redrawn after a
> size change of the Squeak window?
>
> User story: I wrote a (Win only) plugin which programmatically can
> change the Squeak window's size. Alas the parameters only set the
> outer window's size.
>
> So in order to tightly fit the Squeak window around my application I
> would have to:
>
> self setWindowSize: x@y.
> self waitUntilWindowHasWedawn
> diff := x@y - World extent
> self setWindowSize (x@y + diff)
>
> I'd like to skip the second line if I could get diff earlier.
>
> OTOH if a Windows knowable person would know how to set the size of
> Squeak's client area that would be much nicer. I'm kind of C and
> Winapi illiterate :-).

Smalltalk should know, it sets the world during DisplayScreen startUp to  
what it was at shutdown.

HTH.

/Klaus

> Thanks,
>
> Herbert                          mailto:[hidden email]
>
>
>



Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: knowing World extent before redraw.

Andreas.Raab
In reply to this post by Herbert König
Try:

   DisplayScreen depth: Display depth width: 800 height: 600 fullscreen:
false

Cheers,
   - Andreas

Herbert König wrote:

> Hello,
>
> how do i know the World's extent before the World is redrawn after a
> size change of the Squeak window?
>
> User story: I wrote a (Win only) plugin which programmatically can
> change the Squeak window's size. Alas the parameters only set the
> outer window's size.
>
> So in order to tightly fit the Squeak window around my application I
> would have to:
>
> self setWindowSize: x@y.
> self waitUntilWindowHasWedawn
> diff := x@y - World extent
> self setWindowSize (x@y + diff)
>
> I'd like to skip the second line if I could get diff earlier.
>
> OTOH if a Windows knowable person would know how to set the size of
> Squeak's client area that would be much nicer. I'm kind of C and
> Winapi illiterate :-).
>
>  
>
> Thanks,
>
> Herbert                          mailto:[hidden email]
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: knowing World extent before redraw.

Bert Freudenberg
In reply to this post by Klaus D. Witzel
On Mar 7, 2008, at 18:28 , Klaus D. Witzel wrote:

> Smalltalk should know, it sets the world during DisplayScreen  
> startUp to what it was at shutdown.

Not quite. The preferred window size is stored in the image header  
when snapshotting. On startup, the VM tries to create a window of  
that size. The image creates a Display form of the right size by  
querying the actualScreenSize primitive.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: knowing World extent before redraw.

Herbert König
In reply to this post by Andreas.Raab
Hello Andreas,


AR> Try:

AR>    DisplayScreen depth: Display depth width: 800 height: 600 fullscreen:
AR> false

oh dear me, knowing that would have saved me loads of time :-))
I will look through Display and DisplayScreen for other useful things.

I believe, when I want to change the window frame (no frame, no close
button..) will be when I will have to resort to a plugin anyway.


Thanks a lot,

Herbert                            mailto:[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: knowing World extent before redraw.

Bert Freudenberg

On Mar 7, 2008, at 18:52 , Herbert König wrote:

> Hello Andreas,
>
>
> AR> Try:
>
> AR>    DisplayScreen depth: Display depth width: 800 height: 600  
> fullscreen:
> AR> false
>
> oh dear me, knowing that would have saved me loads of time :-))
> I will look through Display and DisplayScreen for other useful things.
>
> I believe, when I want to change the window frame (no frame, no close
> button..) will be when I will have to resort to a plugin anyway.


Did you look at the HostWindowPlugin?

- Bert -



Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: knowing World extent before redraw.

Andreas.Raab
In reply to this post by Herbert König
Herbert König wrote:

> AR> Try:
>
> AR>    DisplayScreen depth: Display depth width: 800 height: 600 fullscreen:
> AR> false
>
> oh dear me, knowing that would have saved me loads of time :-))
> I will look through Display and DisplayScreen for other useful things.
>
> I believe, when I want to change the window frame (no frame, no close
> button..) will be when I will have to resort to a plugin anyway.

In which case the answer is similarly simple if you remember the write a
primitive that returns the "outer window size". E.g.,

   delta := DisplayScreen outerWindowSize "outer window size"
              - DisplayScreen actualScreenSize. "client area"
   DisplayScreen outerWindowSize: myExtent + delta.

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: knowing World extent before redraw.

Herbert König
In reply to this post by Bert Freudenberg
Hello Bert,

BF> Did you look at the HostWindowPlugin?

for a long time, believe me. It got me started on my plugin (which I
called SqueakWindowPlugin :-)) but there's much to much work to do to
make it usable with Morphic.

So I decided to just start another Squeak if I would need a second
window.

For popup windows (message box from a minimized Squeak) I successfully
tested FFI.


Cheers

Herbert                            mailto:[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: knowing World extent before redraw.

Herbert König
In reply to this post by Andreas.Raab
Hello Andreas,


AR>    delta := DisplayScreen outerWindowSize "outer window size"
AR>               - DisplayScreen actualScreenSize. "client area"
AR>    DisplayScreen outerWindowSize: myExtent + delta.

AR> Cheers,
AR>    - Andreas

So I will not put my method's into my own SqueakWindow class but
extend DisplayScreen which looks like the natural place.

To the occasional programmer Squeak *is* big :-))

Thanks,

Herbert                            mailto:[hidden email]


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Re: knowing World extent before redraw.

Klaus D. Witzel
In reply to this post by Bert Freudenberg
On Fri, 07 Mar 2008 18:49:49 +0100, Bert Freudenberg wrote:

> On Mar 7, 2008, at 18:28 , Klaus D. Witzel wrote:
>
>> Smalltalk should know, it sets the world during DisplayScreen startUp  
>> to what it was at shutdown.
>
> Not quite. The preferred window size is stored in the image header when  
> snapshotting.

Sure.

> On startup, the VM tries to create a window of that size. The image  
> creates a Display form of the right size by querying the  
> actualScreenSize primitive.

Ah, this is just for the corresponding Form part. Thank you.

> - Bert -
>
>
>
>