Re: EuGTK:Working Demo For Pop-up Dialog to Collect A String
- Posted by irv Sep 23, 2019
- 1162 views
There are several ways to do what you want. Perhaps the simplest is demonstrated here:
https://openeuphoria.org/pastey/322.wc
It uses a standard dialog with an addon GtkEntry. Since clicking on either dialog button closes and destroys the dialog (and all items it contains), the entry is destroyed before you can get the contents.
The trick is to capture the "about to be destroyed" event on the entry, which is the "unrealize" signal, and connect it to a routine which saves the entry text before it all goes away.
Then we use the OK or Cancel signals from the dialog to decide whether to update a variable with the new contents or to retain the old value.