Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Perl Tkx module

by nirmal1349 (Initiate)
on Oct 04, 2009 at 20:36 UTC ( #799118=perlquestion: print w/replies, xml ) Need Help??
nirmal1349 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am trying to open a GUI from my perl program using Perl Tkx module. When I run my program I get the error, "Can't locate object method "new" via package "MainWindow" (perhaps you forgot to load "MainWindow"?) at line 16." Can anyone please tell me whats missing?

Replies are listed 'Best First'.
Re: Perl Tkx module
by zwon (Abbot) on Oct 04, 2009 at 21:02 UTC

    Welcome to the monastery!

    Can anyone please tell me whats missing?
    The code that fails. Without the code it's hard to tell what's the problem. Can you please provide us with code snippet that causes error? Also please read How do I post a question effectively?

    Update: there's such thing as MainWindow when you're using Tk package, and that's not the same as Tkx, so perhaps you just mixed up these two packages.

Re: Perl Tkx module
by biohisham (Priest) on Oct 05, 2009 at 07:44 UTC
    I doubt that Tkx has a MainWindow object because the MainWindow object is available in Tk but not Tkx. Show us the code that generated this problem because without it we'd just be punching in the dark with regard to what possibly could have caused this as zwon has told you. Further, I'd demonstrate to you a basic difference between these two modules that can be related to your problem.

    This is how the Tkx module is invoked (run "perldoc Tkx" from your shell for more info):

    use strict; use warnings; use Tkx my $mw=Tkx::widget->new .... .... .... Tkx::MainLoop;

    And this is how you invoke the Tk module (run "perldoc Tk" from your shell for more info):

    use strict; use warnings; use Tk; my $mw=MainWindow->new(); ... ... ... MainLoop;
    Don't forget to check perldoc for each one of these modules, it can potentially give you basic information that could enable you to find where the error is yourself, if you couldn't then post that code here for us please. Have a nice Perl journey..

    Excellence is an Endeavor of Persistence. Chance Favors a Prepared Mind.
Re: Perl Tkx module
by mhinkle (Initiate) on Nov 15, 2012 at 17:27 UTC
    Hello, when I try to access the documentation referred to, I get the following:
    C:\Perl>perldoc tkx No documentation found for "tkx".
    What am I doing wrong?
      case sensitive???

        No; when I do the exact thing, I get the doc for Tkx. I think it must be that he doesn't have Tkx installed. Perhaps he has an older version of Perl?

        I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://799118]
Approved by planetscape
[Corion]: :-D
Corion discovers a new shiny toy to try out over the (longish) weekend. Since I've done some more with websockets, maybe I'll try writing a webserver that implements hot-reloading of HTML(+CSS, +Javascript) in the browser. Edit the local file and ...
[Corion]: ... the browser(s) get a ping to a) refresh the page or b) reload "just" the changed parts, keeping the scroll position etc.
[Corion]: But I also have to look at how I can make WWW::Mechanize:: RemoteBrowser a reality, and how to make it safe from malicious content ;)
[Corion]: Part of wanting hot-reloading is that I think I've stumbled on a very simple set of CSS that I maybe want to use for a blog, but I want to try that out on mobile too, and I also want to add/modify it slightly so it has a header too...
[Corion]: ... and having hot reloading would make it easy to view the changes in multiple browser windows of different sizes, and on Android, simultaneously

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2018-04-26 10:49 GMT
Find Nodes?
    Voting Booth?