How to change ActiveWorld extent resp. host window size programmatically?

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

How to change ActiveWorld extent resp. host window size programmatically?

marcel.taeumel (old)
Hi!

Is there a way to change a world's extent from within Smalltalk? This does not work:

ActiveWorld extent: 500@500.

Is there a primitive to modify the host window size? If no, could we add one? :)

Scenario: If I make screencasts, I want to use common resolutions and make my capturing tool record a window's contents. It is quite tricky to achieve pixel-wise accuracy (offset + size).

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: How to change ActiveWorld extent resp. host window size programmatically?

Tobias Pape
Hi,

On 02.02.2015, at 07:54, Marcel Taeumel <[hidden email]> wrote:

> Hi!
>
> Is there a way to change a world's extent from within Smalltalk? This does
> not work:
>
> ActiveWorld extent: 500@500.
>
> Is there a primitive to modify the host window size? If no, could we add
> one? :)
>
> Scenario: If I make screencasts, I want to use common resolutions and make
> my capturing tool record a window's contents. It is quite tricky to achieve
> pixel-wise accuracy (offset + size).
>
To my knowledge, we do not have a way to change the host window in-image.
On Lukas Renggli's version of Builder-CI, however, I found a C-tool that
patches the image to have the desired dimensions.
 Hacky, I know, but it works.

Best
        -Tobias




build-resize.c (982 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to change ActiveWorld extent resp. host window size programmatically?

Bert Freudenberg
In reply to this post by marcel.taeumel (old)
Look at the class side of DisplayScreen. There is something like

DisplayScreen hostWindowExtent: ...

- Bert -


> On 02.02.2015, at 07:54, Marcel Taeumel <[hidden email]> wrote:
>
> Hi!
>
> Is there a way to change a world's extent from within Smalltalk? This does
> not work:
>
> ActiveWorld extent: 500@500.
>
> Is there a primitive to modify the host window size? If no, could we add
> one? :)
>
> Scenario: If I make screencasts, I want to use common resolutions and make
> my capturing tool record a window's contents. It is quite tricky to achieve
> pixel-wise accuracy (offset + size).
>
> Best,
> Marcel
>
>
>
> --
> View this message in context: http://forum.world.st/How-to-change-ActiveWorld-extent-resp-host-window-size-programmatically-tp4803109.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>



smime.p7s (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to change ActiveWorld extent resp. host window size programmatically?

marcel.taeumel (old)
Hi!

Thank you, Bert. You made me look at DisplayScreen's methods. There is no #hostWindowExtent: in Squeak 4.5 oder in Trunk, but this works:

DisplayScreen depth: 32 width: 1024 height: 768 fullscreen: false.
self assert: (1024@768) = ActiveWorld extent.

However, we should introduce #hostWindowExtent: to Trunk. :)


Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: How to change ActiveWorld extent resp. host window size programmatically?

marcel.taeumel (old)
...and I also vote for making

ActiveWorld extent: 800@600.

call that method auto-magically.

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: How to change ActiveWorld extent resp. host window size programmatically?

marcel.taeumel (old)
hostwindow.cs

How about this? I chose to implement it in Project. Now this would work:

Project current fullScreenOff; hostWindowExtent: 800@600.
self assert: Display extent = (800@600).

Project current fullScreenOn.
self assert: Project current hostWindowExtent = (800@600).

A class var keeps track of the last extent in case of full-screen. Just like LastScreenModeSelected does.

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: How to change ActiveWorld extent resp. host window size programmatically?

timrowledge
Host window stuff has been there for *years* -actually it’s now just passed a *decade*

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Oxymorons: Soft rock



Reply | Threaded
Open this post in threaded view
|

Re: How to change ActiveWorld extent resp. host window size programmatically?

marcel.taeumel (old)
Yep, but its API is not that convenient. :)

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: How to change ActiveWorld extent resp. host window size programmatically?

timrowledge

On 02-02-2015, at 1:15 PM, Marcel Taeumel <[hidden email]> wrote:

> Yep, but its API is not that convenient. :)

How hard could it be to connect up an incantation like
HostWindowProxy new primitiveWindowSize: 1 x: 1500 y: 1200 1500@1200
to the Display?
And don’t forget DisplayScreen class>depth:width:height:fullscreen: even though that fiddles with the actual screen size it might do what you actually want.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful Latin Phrases:- Spero nos familiares mansuros. = I hope we'll still be friends.



Reply | Threaded
Open this post in threaded view
|

Re: How to change ActiveWorld extent resp. host window size programmatically?

Bert Freudenberg
In reply to this post by marcel.taeumel (old)
Im pretty sure it's there. I think I ported it over from Etoys. It uses the HostWindow primitive, as Tim suggested, just without any proxy stuff.

If it is indeed not there, please look at an Etoys image. This is much better than the primitive you found, which was never properly supported on all platforms.

- Bert -


> On 02.02.2015, at 09:38, Marcel Taeumel <[hidden email]> wrote:
>
> Hi!
>
> Thank you, Bert. You made me look at DisplayScreen's methods. There is no
> #hostWindowExtent: in Squeak 4.5 oder in Trunk, but this works:
>
> DisplayScreen depth: 32 width: 1024 height: 768 fullscreen: false.
> self assert: (1024@768) = ActiveWorld extent.
>
> However, we should introduce #hostWindowExtent: to Trunk. :)
>
>
> Best,
> Marcel
>
>
>
> --
> View this message in context: http://forum.world.st/How-to-change-ActiveWorld-extent-resp-host-window-size-programmatically-tp4803109p4803120.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>



smime.p7s (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to change ActiveWorld extent resp. host window size programmatically?

marcel.taeumel (old)
Let me sum up the facts:

- There is no implementor of #hostWindowExtent: in the Trunk.
- DisplayScreen >> #depth:width:height:fullscreen: uses primitive 92, which is not properly supported on all platforms but seems to work under Windows.
- There is a DisplayHostWindow and some HostWindowProxy subclasses in 'Graphics-External-Ffenestri', which seem to provide that feature I am looking for.

I guess, Bert, you referred to that last point. Yes, this is in the Trunk. :) Now, I have to find out more about this concept of host windows in Squeak, which I did not know about.

The following code, as proposed by Tim, works fine for me:

HostWindowProxy new primitiveWindowSize: 1 x: 800 y: 600.

Although, I find this API kind of inconvenient, remembering that my starting point was to change the #extent of ActiveWorld programmatically. ;)

Thank you!

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: How to change ActiveWorld extent resp. host window size programmatically?

Bert Freudenberg

> On 03.02.2015, at 11:55, Marcel Taeumel wrote:
>
> HostWindowProxy new primitiveWindowSize: 1 x: 800 y: 600.

The method I was suggesting uses the exact same primitive. I'm away from my computer so I can't check, but I'm almost certain it's there.

- Bert -


smime.p7s (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to change ActiveWorld extent resp. host window size programmatically?

Bert Freudenberg

> On 03.02.2015, at 13:49, Bert Freudenberg <[hidden email]> wrote:
>
>
>> On 03.02.2015, at 11:55, Marcel Taeumel wrote:
>>
>> HostWindowProxy new primitiveWindowSize: 1 x: 800 y: 600.
>
> The method I was suggesting uses the exact same primitive. I'm away from my computer so I can't check, but I'm almost certain it's there.
>
> - Bert -
So indeed these methods are missing from Trunk. Attached. Not sure if it makes sense to include them, since we do have the proper HostWindow stuff already (which Etoys didn't).

- Bert -





DisplayScreen class-host window access.st (1K) Download Attachment
smime.p7s (5K) Download Attachment