(Note: This API is considered deprecated and has been for years. It still works in Sierra, though).
I recently needed to be able to run a shell command that requires root/sudo access in order to complete successfully, and decided to see if I could use the Security Framework to accomplish this. Note ...
Search found 49 matches
- Sun Dec 11, 2016 3:35 am
- Forum: Mac OSX
- Topic: AuthorizationExecuteWithPrivileges
- Replies: 0
- Views: 3505
- Thu Dec 01, 2016 9:58 pm
- Forum: Mac OSX
- Topic: setAutoresizingMask
- Replies: 11
- Views: 4773
Re: setAutoresizingMask
Thanks, will replace what I have with the built-in command.
- Thu Dec 01, 2016 8:23 pm
- Forum: Mac OSX
- Topic: setAutoresizingMask
- Replies: 11
- Views: 4773
Re: setAutoresizingMask
Yes, updated the Gist last night with the following:
Case #PB_GadgetType_Editor, #PB_GadgetType_ListView, #PB_GadgetType_ListIcon, #PB_GadgetType_Tree
; THE GADGETS ABOVE ARE COMPOSED OF PBGADGET->NSCLIPVIEW->NSSCROLLVIEW HIERARCHY
; So we have to retrieve the actual NSScrollView object to ...
Case #PB_GadgetType_Editor, #PB_GadgetType_ListView, #PB_GadgetType_ListIcon, #PB_GadgetType_Tree
; THE GADGETS ABOVE ARE COMPOSED OF PBGADGET->NSCLIPVIEW->NSSCROLLVIEW HIERARCHY
; So we have to retrieve the actual NSScrollView object to ...
- Thu Dec 01, 2016 6:28 am
- Forum: Mac OSX
- Topic: setAutoresizingMask
- Replies: 11
- Views: 4773
Re: setAutoresizingMask
Thanks! Much cleaner!tmp = CocoaMessage(0, GadgetID(handle),"enclosingScrollView")
AIR.
- Thu Dec 01, 2016 5:50 am
- Forum: Mac OSX
- Topic: setAutoresizingMask
- Replies: 11
- Views: 4773
Re: setAutoresizingMask
I decided to give this a try with the PureBasic Gadget Demo source.
Since I couldn't attach files, I created a Gist instead
Give it a try and let me know what you think....
AIR
Since I couldn't attach files, I created a Gist instead
Give it a try and let me know what you think....
AIR
- Thu Dec 01, 2016 3:52 am
- Forum: Mac OSX
- Topic: setAutoresizingMask
- Replies: 11
- Views: 4773
Re: setAutoresizingMask
Ok, in the Anchor proc, change the "3" to a "1" in the call to "setImageScaling"
Then change
Anchor(#ImageGadget, #akFull)
to
Anchor(#ImageGadget, #akTop|#akWidth)
I should note that "#akTop" anchors the widget proportionally to the top or the "Y" axis. So it will push the gadget towards the ...
Then change
Anchor(#ImageGadget, #akFull)
to
Anchor(#ImageGadget, #akTop|#akWidth)
I should note that "#akTop" anchors the widget proportionally to the top or the "Y" axis. So it will push the gadget towards the ...
- Thu Dec 01, 2016 1:05 am
- Forum: Mac OSX
- Topic: setAutoresizingMask
- Replies: 11
- Views: 4773
Re: setAutoresizingMask
How about an ImageGadget()?
Procedure Anchor (handle, value)
Define tmp
Select GadgetType(handle)
Case #PB_GadgetType_Editor
; EDITOR GADGET IS COMPOSED OF NSTEXTVIEW->NSCLIPVIEW->NSSCROLLVIEW HIERARCHY
; So we have to traverse the hierarchy to get the actual NSScrollView object
tmp ...
Procedure Anchor (handle, value)
Define tmp
Select GadgetType(handle)
Case #PB_GadgetType_Editor
; EDITOR GADGET IS COMPOSED OF NSTEXTVIEW->NSCLIPVIEW->NSSCROLLVIEW HIERARCHY
; So we have to traverse the hierarchy to get the actual NSScrollView object
tmp ...
- Wed Nov 30, 2016 10:43 pm
- Forum: Mac OSX
- Topic: setAutoresizingMask
- Replies: 11
- Views: 4773
setAutoresizingMask
It's been a long time since I've visited this forum, amazing how far PB has come since my last visit!
One of the things I've always wanted to be able to do is auto-size/anchor Gadgets like Interface Builder allows one to do.
So I downloaded the latest Mac beta of PB last night, and started playing ...
One of the things I've always wanted to be able to do is auto-size/anchor Gadgets like Interface Builder allows one to do.
So I downloaded the latest Mac beta of PB last night, and started playing ...
- Fri Feb 04, 2011 6:13 am
- Forum: Mac OSX
- Topic: Correct using of relative path on MacOS
- Replies: 2
- Views: 2089
Re: Correct using of relative path on MacOS
I'm not sure I fully understand what you're seeking, but I'll take a stab at it.
Assuming that you have the PureBasicLogoNew.png inside of your Resources folder, you could retrieve the path to the application bundle (in this case, PureBasic0.app) by using the following Procedure:
ImportC ...
Assuming that you have the PureBasicLogoNew.png inside of your Resources folder, you could retrieve the path to the application bundle (in this case, PureBasic0.app) by using the following Procedure:
ImportC ...
- Tue May 04, 2010 7:33 pm
- Forum: Mac OSX
- Topic: Window style textured/metal
- Replies: 3
- Views: 1911
Re: Window style textured/metal
I sort of remember something about PB forms not being composited under OSX.
That's probably why it doesn't quite work with my suggestion.
Sorry about that....
A.
That's probably why it doesn't quite work with my suggestion.
Sorry about that....
A.
- Sat May 01, 2010 9:16 pm
- Forum: Mac OSX
- Topic: Window style textured/metal
- Replies: 3
- Views: 1911
Re: Window style textured/metal
Not 100% sure if this is what you want, but try adding this right after your window creation statement:
ChangeWindowAttributes_(WindowID(0),256,0)
The first parameter is the handle to your window, the second is the attribute to add (in this case, kWindowMetalAttribute), and the third is used to ...
ChangeWindowAttributes_(WindowID(0),256,0)
The first parameter is the handle to your window, the second is the attribute to add (in this case, kWindowMetalAttribute), and the third is used to ...
- Sat May 01, 2010 8:24 pm
- Forum: Mac OSX
- Topic: Trouble with RunProgram()
- Replies: 1
- Views: 1551
Re: Trouble with RunProgram()
Try runnning the "cal" command directly:
Terminal = RunProgram("/usr/bin/cal", "", "", #PB_Program_Open|#PB_Program_Read)
Or if you want to run it in Terminal (which won't allow redirection I think), you can do:
Terminal = RunProgram("/usr/bin/open", "/Applications/Utilities/Terminal.app /usr ...
Terminal = RunProgram("/usr/bin/cal", "", "", #PB_Program_Open|#PB_Program_Read)
Or if you want to run it in Terminal (which won't allow redirection I think), you can do:
Terminal = RunProgram("/usr/bin/open", "/Applications/Utilities/Terminal.app /usr ...
- Wed Jan 06, 2010 4:41 am
- Forum: Feature Requests and Wishlists
- Topic: My wishlist for PureBasic 4.50
- Replies: 103
- Views: 26114
Re: My wishlist for PureBasic 4.50
Something a little different:
I'd like to see a native form designer for OSX.
I'd like the option of being able to use NIB files in OSX.
I'd like to see a move away from Carbon to Cocoa. I know this isn't trivial, though. Barring this, I'd like to at least have compositing enabled for the gui ...
I'd like to see a native form designer for OSX.
I'd like the option of being able to use NIB files in OSX.
I'd like to see a move away from Carbon to Cocoa. I know this isn't trivial, though. Barring this, I'd like to at least have compositing enabled for the gui ...
- Thu Dec 31, 2009 3:40 am
- Forum: Mac OSX
- Topic: How to include font with app
- Replies: 1
- Views: 1494
Re: How to include font with app
You would want to place the font in Contents/Resources, and then use the ATSFontActivateFromFileReference api to notify the system that the font is available (you can set it so that only your app knows about the font, or the globally for the system).
Here's the link to the Apple Type Services ...
Here's the link to the Apple Type Services ...
- Thu Dec 31, 2009 2:40 am
- Forum: General Discussion
- Topic: C switch case Vs PB Select Case
- Replies: 9
- Views: 3538
Re: C switch case Vs PB Select Case
Could you do something like this?
AIR.
Code: Select all
if (ADCValue[0]>=130 && ADCValue[0]<=145) {
Return 1;
}