Search found 49 matches

by Airr
Sun Dec 11, 2016 3:35 am
Forum: Mac OSX
Topic: AuthorizationExecuteWithPrivileges
Replies: 0
Views: 3505

AuthorizationExecuteWithPrivileges

(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 ...
by Airr
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.
by Airr
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 ...
by Airr
Thu Dec 01, 2016 6:28 am
Forum: Mac OSX
Topic: setAutoresizingMask
Replies: 11
Views: 4773

Re: setAutoresizingMask

tmp = CocoaMessage(0, GadgetID(handle),"enclosingScrollView")
Thanks! Much cleaner!

AIR.
by Airr
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
by Airr
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 ...
by Airr
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 ...
by Airr
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 ...
by Airr
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 ...
by Airr
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.
by Airr
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 ...
by Airr
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 ...
by Airr
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 ...
by Airr
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 ...
by Airr
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?

Code: Select all

if (ADCValue[0]>=130 && ADCValue[0]<=145) {
    Return 1;
}
AIR.