in reply to Re: Re: How to access options to Tk widgets
in thread How to access options to Tk widgets

I'm far from an expert in Tk, but I've just finished a couple of programs in it for an advanced perl class, so here goes my two cents. :)

Is there a reason you have

$self->Label(-text=>"var= $optnum")->pack();

instead of

$self->Label(-text=>$optnum)->pack();

If you're actually trying to make your text label $optnum, I believe that you need -text=>$optnum.

Hope that helps!

p.s.

If you find something to debug Tk, let me know would you? I had a HELL of a time debugging my Tk stuff beyond the print a line type of debugging.

Replies are listed 'Best First'.
Re: Re: Re: Re: How to access options to Tk widgets
by Rich36 (Chaplain) on May 10, 2002 at 14:16 UTC

    Tk has a built-in debugger that comes with the standard distro. When debugging, type perl -d:ptkdb name_of_app - it brings up a graphical debugger. I've found it easy to use and very helpful when building Tk apps.


    Rich36
    There's more than one way to screw it up...

      Actually I have used ptkdb one more than one occasion for my regular Perl programming and it has saved my fat from the proverbial fire more than one time.

      However as far as debugging a Tk app, I have had no success with it as once the program hits MainLoop, there is no way I've found to monitor what is going on with your program. If I've missed something, please let me know. :)

A reply falls below the community's threshold of quality. You may see it by logging in.