VMat has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I'm trying to build a little app using perl/Tk (perl 5.8.7, Tk 804.027) over Win32. When I add either an Optionmenu or a BrowseEntry to my MW, I get weird results: at startup, the BrowseEntry shows up as a list in the top left corner of the screen. If I click the window title bar, the list goes away, but leaves a little white square behind. If I move my window, another window pops up in that same corner, with the title "TclNotifier" - and I know there's something in the window, but I can't see it because the window is too small, and can't be resized.

With Optionmenu I don't get the list at startup, the main window shows up alright. But if I click on the Optionmenu I get the small TclNotifier window.

I even tried to use the sample code from the CPAN Tk::BrowseEntry page (plus "MainWindow->new()" and "MainLoop"), to eliminate possible interferences from my other widgets, but it still didn't work.

Anyone saw that before? Any suggestions?

Thank you,

VMat
  • Comment on TclNotifier?? (Win32 + Tk + BrowseEntry)

Replies are listed 'Best First'.
Re: TclNotifier?? (Win32 + Tk + BrowseEntry)
by biohisham (Priest) on Aug 14, 2009 at 21:47 UTC
    I don't know how your coding approach is going like, but I give you these general tips though I haven't seen any code fragment in your question, these are my own frequent mistakes in Tk, I forget to use the Pack sometimes, I forget to use the arrow head as in "=>" and "->" so it gives me weird results, if you have set up your stricture and warnings you can probably see this the clearer....

    Excellence is an Endeavor of Persistence. Chance Favors a Prepared Mind.
Re: TclNotifier?? (Win32 + Tk + BrowseEntry)
by Anonymous Monk on Aug 15, 2009 at 00:24 UTC
    Show code that generates the problem for you, this works for me
    use Tk; tkinit->BrowseEntry(qw! -label label!)->pack; MainLoop;
      Tried your code here, same result.

      Mine was extracted from CPAN pages, as I said - I just added the headers and the "MainLoop":

      #!/usr/bin/perl use Tk; use Tk::BrowseEntry; my $var; my $mw = MainWindow->new(); $b = $mw->BrowseEntry(-label => "Label", -variable => \$var); $b->insert("end", "opt1"); $b->insert("end", "opt2"); $b->insert("end", "opt3"); $b->pack; $mw->Button(-text=>'Exit', -command=>sub{$mw->destroy})->pack; MainLoop;

      Don't know what's wrong. I've just tested it in a Solaris box and it worked fine. But I need to run it on Win32.
        Works just fine here Tk 804.027, perl v5.8.9 built for MSWin32-x86-multi-thread. Maybe you should upgrade Tk?