in reply to Re: Building an adaptable 'Entry Widget'
in thread Building an adaptable 'Entry Widget'

THANKS! That was awfully close to my desired goal.

Inside of:

sub Populate { ... }
You have:
my $entry = $frame -> Entry( -textvariable => $tv, # NOTE ) -> pack(-fill => 'x');
Why isnt it ' -textvariable => \$tv, ' ?

When I call widgets inside of DialogBox I do:

GUIask ( -textvariable => \$input, )
Why the disconnect/inconsistancy ? I totally dont get this difference.

#######################################

Inside of

sub Populate { }
you have:
my $label = $frame -> Label ( -fg => 'blue', -font => 30 ) -> pack(-fill => 'x' );
Shouldnt the label be inside the frame (and colored blue) ? Because I am not seeing that; this is something I want.

If I click on the main window, and move it, my widget gets covered up.

SEE: Writing my first PERL/Tk megawidgit

This mega-widget does not do that. Why? (Also another Q by me). This mega-widget stuff is new to me.

It would be nice to have some comments, to make this code more understandable like the

Entry( -textvariable => $tv, ) -> pack(-fill => 'x');

block above. (why its not \$tv )

2022-02-23 Athanasius added code and paragraph tags.

Replies are listed 'Best First'.
Re^3: Building an adaptable 'Entry Widget'
by Anonymous Monk on Feb 21, 2022 at 15:21 UTC

    Where did my structure go?! Is there a way to delete and reformat this?

      Only logged-in users can edit their posts. You should have used the <code> tags (mentioned both above and below the edit area).

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
      you should also check the preview before creating a post.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

Re^3: Building an adaptable 'Entry Widget'
by Anonymous Monk on Feb 22, 2022 at 02:37 UTC

    It was just a bunch of small code snippets and Qs.

    ANYHOOOOOO, I solved 1 Q, and that brought up another Q:

    When I call GUIask mega-widget, and use ' -label => $header_msg' the $header_msg gets printed outside the Frame(); when I use '-text => $header_msg' then the $header_msg gets printed inside the Frame().

    Why the difference here? The second case ('-text => $header_msg') is what I wanted.

    OH! BTW: I tried to get an acct here. I didnt get an email. I will check Trash, but dont count on it; I have already thrown much stuff out today...

    2022-02-23 Athanasius added code and paragraph tags.

        I discovered a problem:

        If I click the "Abort" button, the dialog-stuff goes away , and I am left with an empty frame.

        I tied this in several contexts and in 'ptk_test.pl' (I developed) . Same thing happens in all cases.

        A piece of pTk subtlety I noticed:

        -label => $header_msg, -- Sticks a label outside the frame -text => $header_msg -- Sticks a STRING OF TEXT inside the frame

        Why the difference?

        2022-02-23 Athanasius added code and paragraph tags.