I’ve found for simple confirmation dialogs, a quick call to ui.messageBox makes injecting a check super easy. It would be nice if there were a similar simple built-in pop dialog that could return a string submission from a user.
I’m aware of the popDialog in TDResources/palette, and with enough fanagling with the callbacks I can kind of get what I want from it, but its nowhere near as simple as something like:
The challenge there is the async nature of it. The system doesn’t stall while waiting for input, so instead of returning a value, you pass in a callback that gets invoked once the input is ready.
the async thing has been my main issue. I’m imagining a scenario where this dialog is the exception in a for loop, and will wait on user input before continuing with the rest of the process. Maybe an async toggle that could interrupt the process would be feasible for the current popDialog.
I’m working with widget buttons not dissimilar to the ones in the palette, and would like to use a one liner onClick run script that functions how I’m already using ui.messageBox, bypassing the need for more extraneous operators and functions
The popDialog is also limited to four buttons, and while that should be sufficient for most needs, it doesn’t scale well if I would like more options. I suppose in that case what would actually be better is an optional drop down menu instead of buttons populated by kwargs for label : value. To this end, the popDialog tox could have width/height/auto scale arguments to accommodate dynamically populated menus.
Obviously these aren’t super high priority rfe’s, and it would be simple enough to fork and modify the existing popDialog if I really needed any of these features, but since the template already exists in ui.messageBox with the functionality I’m looking for, i figured a string input ui class dialog might be worth bringing up