Page 2 of 2

Re: [Q] Window pointer

Posted: Tue Nov 28, 2017 7:56 am
by pthirkell
Could you create as a library rather than a widget?

Re: [Q] Window pointer

Posted: Tue Nov 28, 2017 8:14 am
by shaosean
The NSWindow pointer is the location of the window (in memory) and is required to be able to run any of the NSWindow commands..

The full screen feature will take your window and make it full screen and move it to it's own virtual desktop (depending on the version of macOS you are using, it's either the double arrows in the top right corner of the window or the green button in the top left corner of the window)

This looks like either the windowID isn't the windowNumber, or the windowFromWindowNumber isn't returning the proper result (apparently it can return 0 in some cases depending on how the window was created)..

Perhaps time to do a feature request for a Handle/Pointer property so we can have access to the window pointer, regardless of the OS, so we have a method to get the handle in a LCB library.. Widgets already have a method, but require the widget to be embedded on a stack which doesn't really work for a library as it's not embedded on a stack..

Re: [Q] Window pointer

Posted: Fri Dec 01, 2017 9:37 pm
by livecodeali
The problem with the code, I think, is that you are using Integer in the foreign handler definition for NSApplicationWindowWithWindowNumber

I have it working here as a library using CLong instead:

Code: Select all

private foreign handler NSApplicationWindowWithWindowNumber(in sharedApplication as ObjcId, in windowNumber as CLong) returns ObjcId binds to "objc:NSApplication.-windowWithWindowNumber:"

Re: [Q] Window pointer

Posted: Sat Dec 02, 2017 9:27 am
by shaosean
Thanks.. I'll give that a try.. :)

Re: [Q] Window pointer

Posted: Sat Dec 02, 2017 11:52 am
by shaosean
As you're well aware - it works! :D

Now time to get some code written..

Re: [Q] Window pointer

Posted: Sat Dec 02, 2017 3:12 pm
by shaosean
It might not look like much, but it's a start.. System-based full screen mode.. :) I'll be making it available shortly.. I'm pretty excited about this..
Screen Shot 2017-12-02 at 09.08.50.png
Screen Shot 2017-12-02 at 09.08.50.png (7.96 KiB) Viewed 5749 times

Re: [Q] Window pointer

Posted: Mon Dec 04, 2017 10:39 am
by livecodeali
Great! It's really good to see this :-)

Re: [Q] Window pointer

Posted: Mon Dec 04, 2017 11:54 am
by shaosean
I had fun making it..