Fellow Monks,

Im a 'medium' skilled Perl developer who just finished my first port of a cgi-based shopping cart to a windows based product using the powerful Win32::GUI modules and GUI::loft.

Im very pleased with the end result, but I need some feedback/help on what to do about focus on the main window and the appearance to the end user of 'hanging' during background operations.

This program is very "internet" heavy and has quite a few operations that use a background process for Net::FTP as well and LWP.

During usability testing - I noticed there is a problem of the software doing Net::FTP functions and 'freezing' the entire window during the operation. I assume this is because 100% of the process is dedicated to the Net::FTP command being executed.

The problem is - if my customers have slow connections, then the Win32::GUI widow will basically appear to 'hang' for however long the Net::FTP command is taking to execute. If it takes 30 seconds to login to a site, then my window is going to hang for 30 seconds.

I have tried to add a 'progress' bar and a 'popup status' text window that displays what is happening int he background, but this still does not help me for in-between operations - and hence the opportunities to update the progress bar/status window.

Worse - is that if someone changes focus to another window, then either the Win32:GUI window will just not respond at all, or it comes back 'partially' drawn - and the user has to look at a blank/half-drawn window until the next time the progress bar updates - and even then the rest of the window is still messed up.

Everything always returns to normal when Net::FTP is done whatever its doing - but i think people will be frustrated for the 30-60 seconds my script is showing a messed up window while it does its thing in the background.

So - my questions:

- Do I have 'any' control of re-drawing or capturing input from the user (such as a 'stop' button) whilst in the middle of a NEt::FTP command via the Win32::Gui window?

- Is there any way to prevent 'hanging' of other window areas during the Net::FTP processes?

- Is there anything I can do about the window getting messed up visualy when someone changes focus to a nother app while they are waiting - and then they change back to the win32 window?

- Is there a way I can abort a Net::FTP process that has gotten 'stuck' due to a dropped connection or other problem, without waiting for the 'time-out' (Guess what - this completely locks up the win32::gui window as well) forcing the program to have to be terminated via windows task manager.

Thanks in advance for your help - looking forward to building more apps in Win32::GUI if I can get past this issue.. Steve


In reply to Win32::GUI and Focus Problems by smcone

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.