Page 2 of 2

Re: FreeLibs for LiveCode

Posted: Tue Dec 12, 2017 3:19 pm
by shaosean
[-hh] wrote:
Tue Dec 12, 2017 12:47 am
You may watch a detailed progress here:
https://github.com/livecode/livecode/milestones
Thanks for that.. Now I'll check that page every day ;-)

Re: FreeLibs for LiveCode

Posted: Thu Apr 05, 2018 1:55 am
by PaulDaMacMan
shaosean wrote:
Tue Dec 12, 2017 3:19 pm
[-hh] wrote:
Tue Dec 12, 2017 12:47 am
You may watch a detailed progress here:
https://github.com/livecode/livecode/milestones
Thanks for that.. Now I'll check that page every day ;-)
Sean would you mind posting your source LCB for FreeLibs, maybe github so I can contribute? We need more code examples of FFI / ObjC in the wild, plus I'd like to mod the Notifications one to add the alert sound parameter (then it would be match my LCS+AppleScript version feature wise)

Re: FreeLibs for LiveCode

Posted: Thu Apr 05, 2018 5:38 am
by shaosean
here it is.. enjoy..

Re: FreeLibs for LiveCode

Posted: Thu Apr 05, 2018 6:51 am
by PaulDaMacMan
You're awesome, thanks!

Re: FreeLibs for LiveCode

Posted: Thu Apr 05, 2018 7:48 am
by shaosean
You're welcome.. It's in the public domain, so do what you want with it :)

Re: FreeLibs for LiveCode

Posted: Thu Apr 05, 2018 10:29 am
by PaulDaMacMan
OK I added the line for Key:Value pair for soundName, compiled and it works as expected. (Actually not as I was expecting because I had been using notifications through AppleScript, a different process, and so I would always get popup toast regardless of wether or not my stack was in the foreground or background)
One problem now is that it conflicts with the same PostUserNotification handler in net.freelibs.macos.2.0.0.lce, you uploaded the LCB for net.freelibs.usernotification.1.0.0.lce which doesn't have the fullscreen stuff (which is very useful to me, thanks again)

Also, neither of them have the integrated docs or .lcdoc so they show up in the LC dictionary. If you would be so kind as to upload the LCB for the full macOS extensions / net.freelibs.macos.2.0.0.LCB, I'll go through it and insert the documentation and reupload it for anyone else that might be interested.

Here's the one I modified with the added parameter to PostUserNotification, the last parameter can now be the name of a sound in the system like "Sosumi" or left empty for the old default "you've got mail" sound:
UserNotificationWithSound.lcb.zip
(1.72 KiB) Downloaded 348 times

Re: FreeLibs for LiveCode

Posted: Thu Apr 05, 2018 4:48 pm
by PaulDaMacMan
Minor change.
Added a line so you can pass 'empty' (which apparently is not the same as LCB's 'nothing') or the string literal "" as the soundName parameter to have a silent toast popup. Pass anything else that is NOT a sound in the system and you get the default "you've got mail" sound.
Here:
UserNotificationWithSoundParam.lcb.zip
(1.76 KiB) Downloaded 379 times

Re: FreeLibs for LiveCode

Posted: Thu Apr 05, 2018 5:37 pm
by PaulDaMacMan
LC 9 is so great, I'm loving having access to AppKit even though I don't know all that much about ObjectiveC :D
Here's another one I just whipped up in about 2 minutes (most of that was figuring out the binding string).
MiniaturizeAll. It takes no parameters and minimizes all document windows (not palettes, did not test other window types) into the Dock:
MiniaturizeAll.lcb.zip
(1.13 KiB) Downloaded 350 times

Re: FreeLibs for LiveCode

Posted: Thu Apr 05, 2018 11:55 pm
by shaosean
my bad.. here is the all-in-one version you mentioned (your changes have not been added to this, as I just compressed it and uploaded it).. again, it's in the public domain, so feel free to do whatever you want with it..

Re: FreeLibs for LiveCode

Posted: Fri Apr 06, 2018 2:57 am
by PaulDaMacMan
Hey that's cool, S.H., and really great that you're putting it in public domain too! If you don't mind I was thinking of just keep adding stuff to your lib and make it huge, releasing it as public domain on gitHub so other people can fork or contribute.

In fact I wrapped another NSApp thing, AppHide and AppUnhide, they're the programatic equivalent of a User selecting "Hide" from an App's Dock Menu (AppHide), and clicking the App's icon in the Dock to bring it to the foreground (AppUnhide), though "AppUnhide" is a little sketchy (I also tried to wrap NSApplicationUnhideWithoutActivation but it kept crashing LiveCode for some reason):
MacTools.lcb.zip
(562 Bytes) Downloaded 331 times

Re: FreeLibs for LiveCode

Posted: Fri Apr 06, 2018 8:49 am
by shaosean
Feel free to put it on GitHub..

I've found that this new LCB stuff is nice, but still lots of things that don't work with doing the Cocoa calls.. I've submitted bug reports and have had most of them fixed, so kudos to the development team..

Re: FreeLibs for LiveCode

Posted: Fri Apr 20, 2018 9:02 pm
by PaulDaMacMan
Everything here so far, combined into one library with SVG icon and dictionary integration:
https://github.com/PaulMcClernan/LiveCo ... macOSTools

Re: FreeLibs for LiveCode

Posted: Tue Apr 24, 2018 1:48 am
by PaulDaMacMan
New feature!
Screen Shot 2018-04-23 at 8.37.05 PM.png
Screen Shot 2018-04-23 at 8.37.05 PM.png (15.97 KiB) Viewed 13713 times
DockTile Badges :-D !

https://github.com/PaulMcClernan/LiveCo ... macOSTools

Re: FreeLibs for LiveCode

Posted: Tue Apr 24, 2018 4:54 am
by bogs
Looks pretty svelte there Paul :!:

Re: FreeLibs for LiveCode

Posted: Mon Apr 30, 2018 7:15 pm
by PaulDaMacMan
bogs wrote:
Tue Apr 24, 2018 4:54 am
Looks pretty svelte there Paul :!:
Thanks.