Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Main Window leaves ghost windows when dragging around on desktop
I am running a Tk app that has at least one repeat function which is
reading and writing to a file every so often (virtual pipes)... I think
this is what causes my main window to get stuck in positions on the
desktop and at times when I drag it I get lots of little copies
(ghosts?) and it appears to not be free.... I am not using ->Busy --
what is causing this and how can I get similar functionality as repeat
without locking up the display even repeat?

Using the folling:

$zz_gui->repeat(500,sub{&zz_pipe_monitor});

Is this what is causing this lockup and ghost window creation as I drag
the window every 500 milliseconds?


Report this thread to moderator Post Follow-up to this message
Old Post
Johnny Google
11-05-04 08:56 PM


Re: Main Window leaves ghost windows when dragging around on desktop
In article <1099673205.765452.308460@f14g2000cwb.googlegroups.com>,
john_pataki@yahoo.com says...
> I am running a Tk app that has at least one repeat function which is
> reading and writing to a file every so often (virtual pipes)... I think
> this is what causes my main window to get stuck in positions on the
> desktop and at times when I drag it I get lots of little copies
> (ghosts?) and it appears to not be free.... I am not using ->Busy --
> what is causing this and how can I get similar functionality as repeat
> without locking up the display even repeat?
>
> Using the folling:
>
> $zz_gui->repeat(500,sub{&zz_pipe_monitor});
>
> Is this what is causing this lockup and ghost window creation as I drag
> the window every 500 milliseconds?

This almost certainly is a window manager/OS environment issue.

--
Go to http://MarcDashevsky.com to send me e-mail.

Report this thread to moderator Post Follow-up to this message
Old Post
Marc Dashevsky
11-05-04 08:56 PM


Re: Main Window leaves ghost windows when dragging around on desktop
Marc,

Ok - then what is the issue or fix? I am running WinXP Pro with 2Gig of
Ram and a fairly high end graphics setup.

Also - the frequency of the multiple windows changes when I change the
# of milliseconds repeats....

John


Report this thread to moderator Post Follow-up to this message
Old Post
Johnny Google
11-05-04 08:56 PM


Re: Main Window leaves ghost windows when dragging around on desktop
In article <1099676547.237142.111450@f14g2000cwb.googlegroups.com>,
john_pataki@yahoo.com says...
>
> Ok - then what is the issue or fix?

Oh, I see, you wanted a useful comment.

> I am running WinXP Pro with 2Gig of Ram and a fairly
> high end graphics setup.

Well, I recommend that you update your video driver or check out
the manufacturer's web site/knowledge base.  (I know, there I go
with another suggestion of limited value.)  It strikes me that if
artifacts occur outside the application window, this issue is outside
the domain of perl/Tk.

> Also - the frequency of the multiple windows changes when I change the
> # of milliseconds repeats....

This is exactly what you should look up in the video card knowledge base.

--
Go to http://MarcDashevsky.com to send me e-mail.

Report this thread to moderator Post Follow-up to this message
Old Post
Marc Dashevsky
11-05-04 08:56 PM


Re: Main Window leaves ghost windows when dragging around on desktop
Johnny Google wrote:
> I am running a Tk app that has at least one repeat function which is
> reading and writing to a file every so often (virtual pipes)... I think
> this is what causes my main window to get stuck in positions on the
> desktop and at times when I drag it I get lots of little copies
> (ghosts?) and it appears to not be free.... I am not using ->Busy --
> what is causing this and how can I get similar functionality as repeat
> without locking up the display even repeat?

It is very hard to diagnose. But, why aren't you using fileevent?
'perldoc Tk::fileevent' for more info. I don't know if it will fix your
problem, but it's a better approach than what you are doing.

--Ala

Report this thread to moderator Post Follow-up to this message
Old Post
Ala Qumsieh
11-06-04 01:56 AM


Re: Main Window leaves ghost windows when dragging around on desktop
Ok,

So I am trying to re-write my pipe code using fileevent ....

I read the docs -- and it appears that it needs a filehandle (OO) for
the command ....
so I am 'use' ing FileHandle to 'open' the file... so I have a file
handle to give fileevent....
but now I have the ol'e chicken and the egg contraversy....

If the file doesn't exists yet as I start up (because I delete it just
in case previous fails) and I am waiting for the other app to create
it...

fileevent can't take a file handle to a failed attempt on a file
open....

Is there a nifty way to wait until the file exists, then open it for
reading, then pass the filehandle to fileevent .
other than creating a while(! -e $pipe_in)
{\&sit_and_wait_for_a_while};

thanks for the suggestion to use fileevent -- this might help unfeeze
events with main window if I can get it to work...

I need to be able pop the last message written to $pipe_in whenever it
gets written... the other app will be appending to this file.

Is this what fileevent will do for me if I have this setup:


sub zz_pipe_open {

zz_stat();

# old way
#
# undef $zz_pipe_id;
# open (PIPE,"< $pipe_in") or croak "Can't open pipe.";
#
# new way

$PIPE = new FileHandle;
$PIPE->open("< $pipe_in");# or croak "Can't open pipe.";

if (defined $zz_gui) {
zz_stat("\tTk GUI Mode");

# old way
#
# $zz_pipe_id = $zz_gui->repeat(500,sub{&zz_pipe_monitor});
# zz_stat($zz_pipe_id);
#
# new way

$zz_gui->fileevent($PIPE, 'readable', \&zz_pipe_in);

} # end if

if (!defined $zz_gui) {
#zz_stat("\tNon-GUI Mode");
#while (!$zz_pipe_id) {select(undef, undef, undef,
0.50);&zz_pipe_monitor}
} # end if

} # end sub


sub zz_pipe_in {

zz_stat();

# new way

my $message;
my $r = sysread $PIPE, $message, 1024;
if ($r) {
chomp $message;
zz_stat("\tMessage = $message");
zz_cmd_call($message) if $message ne $last_message;
$last_message = $message;

} # end if

# old way

# my @message;
# while (<PIPE> ){push @message,$_};

# foreach $message (@message) {
#  chomp $message;
#  $message =~ s/\"|\s+//g;
#  zz_stat("\tMessage = $message");
#  zz_cmd_call($message) if $message ne $last_message;
#  $last_message = $message;
# } # end foreach

} # end sub


Report this thread to moderator Post Follow-up to this message
Old Post
Johnny Google
11-06-04 01:56 AM


Re: Main Window leaves ghost windows when dragging around on desktop
I tried just creating the file with nothing in it before opening the
filehandle -- but then it appears that even when the other app writes a
message to $pipe_in --- I never see zz_pipe_in called.... is there
something that I am missing?


Report this thread to moderator Post Follow-up to this message
Old Post
Johnny Google
11-06-04 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PerlTk archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:40 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.