OpenFileRequest PB 5.73 beta 2 x64

Mac OSX specific forum
Andrew Lindsay
User
User
Posts: 24
Joined: Mon May 30, 2011 12:17 pm

OpenFileRequest PB 5.73 beta 2 x64

Post by Andrew Lindsay »

Hello group,

I am trying to select a file using the OpenFileRequest in a mac using the sample code in the manual.

Code: Select all

StandardFile$ = ""   ; set initial file+path to display
  ; With next string we will set the search patterns ("|" as separator) for file displaying:
  ;  1st: "Text (*.txt)" as name, ".txt" and ".bat" as allowed extension
  ;  2nd: "PureBasic (*.pb)" as name, ".pb" as allowed extension
  ;  3rd: "All files (*.*) as name, "*.*" as allowed extension, valid for all files
  Pattern$ = "Text (*.txt)|*.txt;*.bat|PureBasic (*.pb)|*.pb|All files (*.*)|*.*"
  Pattern = 0    ; use the first of the three possible patterns as standard
  File$ = OpenFileRequester("Please choose file to load", StandardFile$, Pattern$, Pattern)
  If File$
    MessageRequester("Information", "You have selected following file:" + Chr(10) + File$, 0)
  Else
    MessageRequester("Information", "The requester was canceled.", 0) 
  EndIf
I get the dialog to pop up to select a file, but the 'Open' button remains disabled. I am able to search around the directories, but I can never select a file to open.
Any assistance would be appreciated.
Andrew Lindsay
-----------------------------------------
User avatar
mk-soft
Always Here
Always Here
Posts: 6205
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: OpenFileRequest PB 5.73 beta 2 x64

Post by mk-soft »

With Catalina no problem ...

macOS don't support patterns!
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Andrew Lindsay
User
User
Posts: 24
Joined: Mon May 30, 2011 12:17 pm

Re: OpenFileRequest PB 5.73 beta 2 x64

Post by Andrew Lindsay »

OK, so what should the call look like, and if the call is wrong, why don't I get an error in my compile?
Andrew Lindsay
-----------------------------------------
collectordave
Addict
Addict
Posts: 1310
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: OpenFileRequest PB 5.73 beta 2 x64

Post by collectordave »

Running the code as shown I have no problems on Mojave or High sierra.

As soon as I select a file the open button is enabled.

The pattern bit threw me as well, Mac ignores the Pattern$ and select pattern.


CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Andrew Lindsay
User
User
Posts: 24
Joined: Mon May 30, 2011 12:17 pm

Re: OpenFileRequest PB 5.73 beta 2 x64

Post by Andrew Lindsay »

Ok, some new information to add into the mix. I'm using Catalina.

It's weird behaviour. When the dialog first appears, I can not select a file, and yet I can open and close folders. I can also drag and move around the dialog, still without being able to select a file.

BUT, if I grab the lower left corner and resize the dialog, I am then able to select a file. This is weird.

Regards

Andrew
Andrew Lindsay
-----------------------------------------
collectordave
Addict
Addict
Posts: 1310
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: OpenFileRequest PB 5.73 beta 2 x64

Post by collectordave »

That is a little weird.

When I upgraded to catalina i had some problems as well.

One thing I found was that Catalina was very slow so I down graded to mojave.

One other thing you can try is this link http://www.mediafire.com/file/47vqjoilz ... r.zip/file

I need the file requesters to be the same on both windows and mc so just rolling my own.

Regards

CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1282
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: OpenFileRequest PB 5.73 beta 2 x64

Post by Paul »

collectordave wrote: One other thing you can try is this link http://www.mediafire.com/file/47vqjoilz ... r.zip/file

I need the file requesters to be the same on both windows and mc so just rolling my own.
Just a note, your code crashes because you hard coded the location of one of the images used :wink:

Code: Select all

imgUpEnabled = LoadImage(#PB_Any,"/Users/williamatkin/Documents/PB Projects/FileRequester/arrow_up.png")
Image Image
collectordave
Addict
Addict
Posts: 1310
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: OpenFileRequest PB 5.73 beta 2 x64

Post by collectordave »

Thanks will remove and repost

CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
collectordave
Addict
Addict
Posts: 1310
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: OpenFileRequest PB 5.73 beta 2 x64

Post by collectordave »

Hardcoded image removed.

May add it to data section later.

Also found you could not enter a filename to save also cleared.


Same link.


If anyone tries it on windows let me know.

CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Andrew Lindsay
User
User
Posts: 24
Joined: Mon May 30, 2011 12:17 pm

Re: OpenFileRequest PB 5.73 beta 2 x64

Post by Andrew Lindsay »

Cheers,

I'll have a look at that and see how things go.

Regards

Andrew
Andrew Lindsay
-----------------------------------------
Post Reply