in reply to getting entered data from a pTk megawidget

Your Tk::GUIask module should be in a separate .pm file so that it can be reused.

It looks like you've just reinvented Tk::LabEntry. If you really want to create a new widget, perhaps as an academic exercise, see the Tk::LabEntry code for pointers on how to proceed.

The basic idea is to advertise your Tk::Entry subwidget. In your code that uses Tk::GUIask, access the Tk::Entry subwidget, then use it as you would a plain Tk::Entry widget.

See also: Tk::mega, Tk::composite, and other documentation linked from those, such as Tk::ConfigSpecs and Tk::Derived. You may also find the "Sample Perl Mega-Widgets" section of the Widget Demo to be useful.

— Ken

Replies are listed 'Best First'.
Re^2: getting entered data from a pTk megawidget
by Anonymous Monk on Jan 10, 2022 at 23:53 UTC

    I think I looked at Tk::LabEntry -- and yes I am basically rewriting it. But I want it done MY WAY. It must have a programmer-setable message; and it must have an 'Abort' or 'Quit' button. I have done this several times in a program I am writing. I want to convert this block of code into a megawidget to avoid rewriting this code repeatedly. Building the widget appears easy -- getting the input back so the application can use it is a pain...

      getting the input back so the application can use it is a pain...

      so you're saying delegates isnt working for get method? Strip all other parts if program until you get get delegates working...

      im on mobile

        I found 2 typos in the Delegates and ConfigSpecs lines. (I copied from Learning PERL/Tk). I still cant get my entered text back.