Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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


"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;".

Replies are listed 'Best First'.
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\ 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://168150]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2018-06-23 16:24 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.