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 |
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). > 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 |
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 |
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 |
...and I also vote for making
ActiveWorld extent: 800@600. call that method auto-magically. Best, Marcel |
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 |
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 |
Yep, but its API is not that convenient. :)
Best, Marcel |
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. |
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 |
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 |
> 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 |
> 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 - - Bert - DisplayScreen class-host window access.st (1K) Download Attachment smime.p7s (5K) Download Attachment |
Free forum by Nabble | Edit this page |