is there a graphical file requester

Started by wadmixfm, September 02, 2020, 21:02:43

Previous topic - Next topic

wadmixfm

in blitzmax ng 64 is there a graphical version of a file requester about

one that can define the folder and then look for a certain extension

cheers

Derron

If you use a GUI (like MaxGUI) then it should be graphical. Without it, the app does not know "how" you want to display it - and will do via console/terminal.


bye
Ron

wadmixfm

cheers ron

are there any examples for this kind of thing ??


Kryzon

The BRL.system.mod module on BlitzMax has the global RequestDir() and RequestFile() functions that call the native file selector dialog.
https://en.wikibooks.org/wiki/BlitzMax/Modules/System/System#RequestFile

If you're using the SDL backed instead of BRL, then RequestDir and RequestFile are not implemented yet. It's still to-do because the SDL libraries don't have such a thing ready, it needs to be coded manually like RequestDir or RequestFile were. That said, you can just copy the includes and functions from the .C file and the BMX definitions from BRL.systemdefault anyway and use those in your programs along with SDL.

Derron

This only works on Windows and (untested) MacOS.


This is the linux part of requestfile etc:
Code (BlitzMax) Select

Method RequestFile$( Text$,exts$,save:Int,file$ ) Override
WriteStdout "Enter a filename:"
Return ReadStdin()
End Method

Method RequestDir$( Text$,path$ ) Override
WriteStdout "Enter a directory name:"
Return ReadStdin()
End Method


bye
Ron

TomToad

Problem with RequestFile() is that it doesn't always work with full screen graphics.

There is ifsoGUI which is a graphics GUI instead of a system GUI, which means it will look the same on all systems, and also will work full screen.
------------------------------------------------
8 rabbits equals 1 rabbyte.

wadmixfm

does this mod have to be put in one of the original mod folders like pub.mod or brl.mod for example

so it can be compiled ??

Lee

wadmixfm

hmmmmm i cant get that to work under 156 ng on mac or windows

never mind i will create my own file reader

statto

Quote from: wadmixfm on September 05, 2020, 12:12:24
does this mod have to be put in one of the original mod folders like pub.mod or brl.mod for example

so it can be compiled ??

Lee

Yes, you put it in your mod folder under ifsogui.mod and then rebuild it.