ncruces / zenity

Zenity dialogs for Golang, Windows, macOS
https://pkg.go.dev/github.com/ncruces/zenity
MIT License
736 stars 37 forks source link

Any plans to add checklists? #34

Closed zakiloki0 closed 1 year ago

zakiloki0 commented 2 years ago

Would be very usefull

Thanks for the project!

ncruces commented 2 years ago

Checklists would be impossible to support in macOS (and a tone of work on Windows). So what do you suggest?

I could, conceivably, implement them only on Unix:

Still only one "column" besides the check/radiolist one. Then it's only a visual thing, and only on Unix.

Does that make sense? Or is it just a lot of work to waste?

zakiloki0 commented 2 years ago

Checklists would be impossible to support in macOS (and a tone of work on Windows). So what do you suggest?

I could, conceivably, implement them only on Unix:

  • zenity.CheckList() implies zenity.Multiple() (which already exists)
  • zenity.RadioList() is the opposite.

Still only one "column" besides the check/radiolist one. Then it's only a visual thing, and only on Unix.

Does that make sense? Or is it just a lot of work to waste?

Thanks for answering me ncruces!

I was referring for example to whether it was possible (and not so complicated to implement) in Windows for example, in the original zenity I used the multi-select boxes a lot in my scripts and they were very efficient for me, that's why I asked, thanks again for this zenity, it is impressive how well it adapts to the Windows environment.

ncruces commented 2 years ago

Windows would be a tone of work, but doable.

If multiple selection is what you need, this already works (on the command line):

zenity --list --multiple a b c

Or in Go:

zenity.ListMultipleItems("Select items", "a", "b", "c")

Or (for additional options):

zenity.ListMultiple("Select items", []string{"a", "b", "c"}, zenity.DisallowEmpty())

These don't make it as obvious that you can select multiple items as having the checkboxes.

If that's the goal, that's an easy enhancement on Unix, some work on Windows (as time permits), and not really doable on macOS (but it doesn't break either).

zakiloki0 commented 2 years ago

Windows would be a tone of work, but doable.

If multiple selection is what you need, this already works (on the command line):

zenity --list --multiple a b c

Or in Go:

zenity.ListMultipleItems("Select items", "a", "b", "c")

Or (for additional options):

zenity.ListMultiple("Select items", []string{"a", "b", "c"}, zenity.DisallowEmpty())

These don't make it as obvious that you can select multiple items as having the checkboxes.

If that's the goal, that's an easy enhancement on Unix, some work on Windows (as time permits), and not really doable on macOS (but it doesn't break either).

Thanks dude! Thanks for the tip, I'll keep looking into it :)

ncruces commented 2 years ago

This is done on Unix.

Issue now tracks Windows implementation of zenity.Checklist. This requires moving to ListView (rather than ListBox) and LVS_EX_CHECKBOXES.

This is still pretty out of scope on macOS. In any event, multiple selection is supported on all OSes with zenity.Multiple.

zakiloki0 commented 2 years ago

This is done on Unix.

Issue now tracks Windows implementation of zenity.Checklist. This requires moving to ListView (rather than ListBox) and LVS_EX_CHECKBOXES.

This is still pretty out of scope on macOS. In any event, multiple selection is supported on all OSes with zenity.Multiple.

Wow, I didn't think you would do it so fast, thanks man!! If you need help to make tests tell me without problems!

ncruces commented 2 years ago

Only Unix is done. Windows will take me a while, no promises. But writing down my preliminary findings will help me keep track of what needs to be done.

zakiloki0 commented 2 years ago

Only Unix is done. Windows will take me a while, no promises. But writing down my preliminary findings will help me keep track of what needs to be done.

Thanks ncruces :)

ncruces commented 1 year ago

This really is a tone of work. If you want it added on Windows (just for the checkbox, multiple selection already works) I welcome the contribution, but won't work on it myself.