[Q] Window pointer
-
- VIP Livecode Opensource Backer
- Posts: 93
- Joined: Tue Nov 17, 2009 6:47 pm
- Location: Wellington, New Zealand
Re: [Q] Window pointer
Could you create as a library rather than a widget?
Re: [Q] Window pointer
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..
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..
-
- Livecode Staff Member
- Posts: 192
- Joined: Thu Apr 18, 2013 2:48 pm
Re: [Q] Window pointer
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:
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
Thanks.. I'll give that a try..
Re: [Q] Window pointer
As you're well aware - it works!
Now time to get some code written..
Now time to get some code written..
Re: [Q] Window pointer
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..
-
- Livecode Staff Member
- Posts: 192
- Joined: Thu Apr 18, 2013 2:48 pm
Re: [Q] Window pointer
Great! It's really good to see this
Re: [Q] Window pointer
I had fun making it..