AndyObtiva / glimmer-dsl-libui

Glimmer DSL for LibUI - Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library - The Quickest Way From Zero To GUI - If You Liked Shoes, You'll Love Glimmer! - No need to pre-install any prerequisites. Just install the gem and have platform-independent GUI that just works on Mac, Windows, and Linux.
MIT License
458 stars 15 forks source link

Are there file and folder pickers? #34

Closed MtnBiker closed 1 year ago

MtnBiker commented 1 year ago

I'm looking a simple macOS app in Ruby, but need to pick files and folders. I can do this with Pashua, but it's not being actively supported.

If not what should I consider?

Thank you

kojix2 commented 1 year ago

Hi @MtnBiker

You can use open_file and save_file in Glimmer DSL LibUI. https://github.com/AndyObtiva/glimmer-dsl-libui#extra-dialogs

Or is it something more different that you are looking for?

MtnBiker commented 1 year ago

@kojix2 Looks like it. Now I'll try to look at glimmer-dsl-libui to sort out the syntax.

Thank you

AndyObtiva commented 1 year ago

@MtnBiker For selecting files, what @kojix2 mentioned is correct.

For selecting directories, that would be open_folder, but it won't be available until the next libui-ng C library release (a glimmer-dsl-libui included dependency), which should happen hopefully in the near future.

Otherwise, today, you could use Glimmer DSL for Tk with the Tk.chooseDirectory call to open a directory.

Alternatively, you could use Glimmer DSL for SWT in JRuby, which supports directory_dialog.open (as demonstrated in Hello, Directory Dialog!)

AndyObtiva commented 1 year ago

Hi, I just wanted to note that I just released glimmer-dsl-libui version 0.6.0.pre.0, which finally supports a newer version of the C libui library (the newer libui-ng), including support for open_folder (a variation on open_file that can open a directory).