Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Perltk and TopLevel

by ariels (Curate)
on May 21, 2002 at 15:08 UTC ( #168150=note: print w/ replies, xml ) Need Help??


in reply to Perltk and TopLevel

s/TopLevel/Toplevel/mg;

"require Tk::TopLevel;" doesn't bomb out because you'd appear to be on a Windows system (file search is case-insensitive). But Tk::TopLevel isn't being found, because it's Tk::Toplevel...

Oh, and it's probably a better idea to "use Tk::Toplevel;".


Comment on Re: Perltk and TopLevel
Select or Download Code
Re: Re: Perltk and TopLevel
by meraxes (Friar) on May 21, 2002 at 15:28 UTC

    I've tried changing the "require" line as you specified but now I get an extra line in the error codes:

    Assuming 'require Tk::TopLevel;' at D:\Work\test2.pl line 21

    And still no window. :(

      You need to also change the line where you create the new top-level window.

      $TestWindow = $main->Toplevel();

      It's not just the require that needs to change... The /m on ariels' substitution indicated that you needed to change TopLevel->Toplevel everywhere...

        I'm a colossal moron. Thanks for you patience. That did the trick. Can't believe I fell for the case-sensitive problem. I'll be more careful next time.
Re^2: Perltk and TopLevel
by jerryk (Initiate) on Oct 20, 2013 at 14:38 UTC
    Damn I hate MixedCaseVariableNames. Because I can't remember them as sounds. Is it topLevel or Toplevel or TopLevel? If I wrote the code, it's "top_level". Period. And what if there's an acronym buried in the variable name? Is it CvsVersion or CVSversion? Or - god help us - CVSVersion? When the revolution comes, the inventors of mixed case variable names will be the first against the wall!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://168150]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (12)
As of 2015-07-02 21:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (45 votes), past polls