Hello, i have kind of a weird problem with a PerlTk-GUI-tool which i am programming for a customer. The tool works great on my Linux-environment, but not on the one of my customer. We both use the standard Perl v5.8.5 and Perl v5.8.7.

The problem is, that on my customers system the script/GUI freezes each time, it tries to open up a new TopLevel-window, a dialogbox like getOpenFile or these small balloon-helpboxes. The script allways freezes, before these features would show up on the screen.

Also the script freezes in most cases when i call the methods: I tried out a lot and checked any callbacks and bindings on my script, wether one of those could be the reason for that, but it isn't.

I suspect the window manager or the X Server to block each attempt to take control, for instance by creating new windows etc.; But i am really not sure about that. Maybe it's some kind of safety guideline, which avoids programms from doing things like that.

Does anyone maybe have an idea, what could be the reason and where to search? Is there maybe some quite simplier explanation or options i should check first?

Below is some part of the code i am using with the MainWindow setup and the methods causing the problems.

Thanks,

Markus.
#!/usr/bin/perl -w use strict; use warnings; use diagnostics; use Tk; use Tk::Balloon; use Tk::Dialog; use Tk::DialogBox; use Tk::FileSelect; use Tk::Pane; use Tk::BrowseEntry; use Tk::ProgressBar; use Tk::NoteBook; #---------------------- my $version = "1.1.0"; sub init { $initdone = 0; $mw->Walk( sub { $_[0]->destroy } ) if ( Exists( $mw ) ); $mw = MainWindow->new( -background => "#e6e6e6", -title => "ParaWell v$version +", ) if ( not Exists( $mw ) ); #----------------------------------------- sub progress { $frameprogress->MapWindow if ( $_[0] < 1 ); $percents = sprintf( "%d%%", $_[0] * 100 ); $percent = $_[0] * 100; $progressbar->idletasks; $frameprogress->UnmapWindow if ( $_[0] == 1 ); return if ( $_[1] eq $progwhat ); $progwhat = " "; $progwhatlab->idletasks; $progwhat = ( $frameprogress->ismapped ) ? $_[1] : ""; } #---------------------------------- sub addball { return if ( not Exists( $_[0] ) ); my $ball = $_[0]->Balloon( -state => "balloon", -foreground => "#000000", -background => "#ffffaa", -cancelcommand => sub { return 1 }, ); $ball->attach( $_[0], -balloonposition => 'mouse', -msg => ( join "\n", $_[1] +), -cancelcommand => sub { return 1 }, -initwait => 200, ); }

In reply to Perl Tk, GUI / Window Manager freezes/blocks when creating new windows, dialogues or balloons by vertigomagic

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.