deech / fltkhs

Haskell bindings to FLTK GUI toolkit.
MIT License
190 stars 24 forks source link

Where is fl_choice? #131

Closed ericu closed 5 years ago

ericu commented 5 years ago

I expected to find the translation of fl_choice [https://www.fltk.org/doc-1.4/group__group__comdlg.html#ga36c19b29fcd5c261f3eafdf9f7126b16] in http://hackage.haskell.org/package/fltkhs-0.8.0.2/docs/Graphics-UI-FLTK-LowLevel-Ask.html. Is it somewhere else? I can't find it in any of the places I thought were likely.

deech commented 5 years ago

It is missing. Are you blocked on it? If you don't want to wait for me to do it, I can help you get a PR together.

ericu commented 5 years ago

I'm not blocked. I have way too many features waiting to be implemented to get blocked that easily =*). I'm just working on other stuff until that becomes available.

OTOH if it would be easy for you I'd be happy to take direction on a PR.

deech commented 5 years ago

I now remember why I didn't add fl_choice; it used varargs to create buttons and there's no way to bind to kind of function without having a bunch of fl_choice2, fl_choice3, ... functions. Since that was pain and I didn't see much need for it at the time I held off. Given this, do you still need this dialog?

ericu commented 5 years ago

My use case is the standard "You've made changes: Exit without saving/Save/Cancel" dialog. While I could make a custom dialog for that, it seems a common enough case to have something like fl_ask implemented. Likewise a two-button dialog is needed quite often.

I don't actually need the printf-style formatting, though. It seems a bit weird to me to have that built into fl_ask when you could always just sprintf yourself before calling it. A simplified version that took Text for the message and first button and Maybe Text for the other two buttons would be plenty for me.

ericu commented 5 years ago

Similarly, while I don't need printf-style formatting in fl_input, it would be nice to be able to supply the default string there. I use it for renaming things, and if the default string were pre-filled, it would be nicer for making small edits. Should I open a separate bug, or is this close enough to keep them together?

deech commented 5 years ago

A separate issue would be good. Thanks!

ericu commented 5 years ago

https://github.com/deech/fltkhs/pull/139