Closed mohawk2 closed 3 years ago
Thanks for merge! Got any thoughts on the questions asked above? :-)
ad -textvariable
: I was curious whether it's possible to make use of a non-reference -textvariable
. A provided non-ref value is simply displayed in the entry and the value may be later retrieved using $entry->cget('-textvariable')
. Quite obscure, but I can imagine that some users are using it this way... nevertheless I tried to restrict the accepted type by using TK_OPTION_SCALARVAR
instead of TK_OPTION_OBJ
in tkEntry.c, but this did not work --- it seems that TK_OPTION_SCALARVAR
deliberately accepts non-ref scalars, and that a new config option TK_OPTION_SCALARREFVAR
or so is needed...
ad simpleDialog
: a possible approach would be to create a normal CPAN module for this. Later we can decide to "absorb" this module into Tk core (this already happened in the past, AFAIR Tk::PNG and Tk::JPEG used to be separate modules).
Found these while trying to figure out why my local use of
-textvariable
wasn't working, thought I'd GitHub-search the repo.That was in fact because I passed the value of the variable, not a reference to it. Do you think the Perl use of that should
croak
if a non-scalar-ref value is given?Also, Perl/Tk doesn't have an equivalent of tkinter's "simpledialog". This is only a few lines, but it took me a couple of hours to figure out. Should this be either in docs, or a small provided class? If so, please say so and I'll PR it.