jwlodek/py_cui

Allow setting a default value for text box popups

lenormf opened this issue · 2 comments

Is your feature request related to a problem? Please describe.
Text box popups cannot be instantiated with a default text value.

Describe the solution you'd like
Have TextBoxPopup take a default text value, forwarded to the Popup and TextBoxImplementation parent instances.

Yes, this would be nice. At the moment, I have to access the private _popup variable so I can set the default text value. In my case, it's a search query and I want to populate the popup with the last query, so they can edit instead of start all over.

root.show_text_box_popup("Filter expression:", popup_callback)
root._popup.set_text(last_filter_expression)

I have added this on the v0.1.5 branch by adding an initial_text kwarg to the show_text_box_popup function