Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi,

This is a good question. In this case the error is telling you that some widget requires a '-label' parameter and did not get it. (The prime example of this is the command method of a Menubutton widget, which if left without a label will produce this exact error.)

Normally use Tk::ErrorDialog will produce a stack, with useful information, but neither that nor a custom Tk::Error sub will produce useful information in the example that I gave.

sub Tk::Error { my ($widget, $error, @locations) = @_; print "Widget:\n\t$widget\n"; print "Error:\n\t$error\n"; print "Locations:\n"; map { print "\t$_\n" } @locations; }
If you or anyone else comes upon a way to trap this kind of (rare) error that occurs outside of Tk's built-in error mechanism, I'd like to see it. In my experience this kind of thing is how pTk earns its undeserved bad reputation.

Update: belg4mit snuck in a response a bit before me {g}, but I wanted to say that I have version 3.078 of Widget.pm as well and it does indeed produce this exact error at that line number if perform the action I describe above with the command method of a Menubutton widget. That is why this error appears to happen outside of Tk's Error handling mechanism.

Good luck,
{NULE}
--
http://www.nule.org


In reply to Re: how can I coerce Tk to cluck by {NULE}
in thread how can I coerce Tk to cluck by stefp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-26 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found