|
From: Emmanuel E <emm...@gm...> - 2008-04-23 13:29:17
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I think he means he wants to use threads. So that one thread can take
care of the window in the foreground and another the code in the
background...<br>
<br>
Ilya BANDORIN wrote:
<blockquote
cite="mid:8B0...@bs..."
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<title>Window doesn't appear until code has finished</title>
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Tahoma","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page Section1
{size:612.0pt 792.0pt;
margin:2.0cm 42.5pt 2.0cm 3.0cm;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="Section1">
<p class="MsoNormal"><span
style="font-size: 10pt; font-family: "Tahoma","sans-serif"; color: rgb(31, 73, 125);"
lang="EN-US">What do you mean by “in background”?<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 10pt; font-family: "Tahoma","sans-serif"; color: rgb(31, 73, 125);"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 10pt; font-family: "Tahoma","sans-serif"; color: rgb(31, 73, 125);"
lang="EN-US">If you wish to perform some tasks “in background”
while user sees login window, enters his login/pass, etc - I think the
only way
is to create a multithreaded application.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 10pt; font-family: "Tahoma","sans-serif"; color: rgb(31, 73, 125);"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 10pt; font-family: "Tahoma","sans-serif"; color: rgb(31, 73, 125);"
lang="EN-US">But if you just want to create/show window and then
perform some
extra code, you can call Win32::GUI::DoEvent instead of
Win32::GUI::Dialog(). It
will draw the window and all stuff but won’t “stop” for
interaction with user. Of course you should call Win32::GUI::Dialog()
at some
point to allow user to interact with your application.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 10pt; font-family: "Tahoma","sans-serif"; color: rgb(31, 73, 125);"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 10pt; font-family: "Tahoma","sans-serif"; color: rgb(31, 73, 125);"
lang="EN-US"><o:p> </o:p></span></p>
<div>
<div
style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span
style="font-size: 10pt; font-family: "Tahoma","sans-serif";"
lang="EN-US">From:</span></b><span
style="font-size: 10pt; font-family: "Tahoma","sans-serif";"
lang="EN-US">
<a class="moz-txt-link-abbreviated" href="mailto:per...@li...">per...@li...</a>
[<a class="moz-txt-link-freetext" href="mailto:per...@li...">mailto:per...@li...</a>] <b>On
Behalf Of </b>Brian
Rowlands (Greymouth High School)<br>
<b>Sent:</b> Wednesday, April 23, 2008 4:06 PM<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:per...@li...">per...@li...</a><br>
<b>Subject:</b> [perl-win32-gui-users] Window doesn't appear until
code has
finished<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p><span style="font-size: 10pt; font-family: "Arial","sans-serif";">I'm
writing
a login gui in perl and I've got a mental block:</span> <o:p></o:p></p>
<p><span style="font-size: 10pt; font-family: "Arial","sans-serif";">I've
created
my gui:</span> <o:p></o:p></p>
<p><span style="font-size: 10pt; font-family: "Arial","sans-serif";">my
$main =
Win32::GUI::Window->new(</span> <br>
<span
style="font-size: 10pt; font-family: "Arial","sans-serif";">-name
=> 'Main',</span> <br>
<span
style="font-size: 10pt; font-family: "Arial","sans-serif";">-width
=> 600,</span> <br>
<span
style="font-size: 10pt; font-family: "Arial","sans-serif";">-height
=> 400,</span> <br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">
-text => 'GHS Login',</span> <br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">
-sizable=> 0,</span> <br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">
-hasminimize => 0,</span> <br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">
-hasmaximize=> 0, </span><br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">);</span>
<br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">…
widgets
positioned</span> <br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">$main->Center();</span>
<br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">$main->Show();</span>
<br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">Win32::GUI::Dialog();</span>
<br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">exit(0);</span>
<o:p></o:p></p>
<p><span style="font-size: 10pt; font-family: "Arial","sans-serif";">My
question
is, how can I get the window to be displayed and then have perl code
running in the background?</span> <br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">I've
tried:</span>
<br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">sub
Main_Activate {</span> <br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">
… perl code</span> <br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">return
0;</span>
<br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">}</span>
<br>
<span style="font-size: 10pt; font-family: "Arial","sans-serif";">The
perl code
runs and then the window appears.</span> <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p><span
style="font-size: 10pt; font-family: "Arial","sans-serif"; color: red;">Thanks</span>
<br>
<span
style="font-size: 10pt; font-family: "Arial","sans-serif"; color: red;">Brian
Rowlands</span> <br>
<span style="font-family: "Arial","sans-serif"; color: red;">We must
accept finite
disappointment, but we must never lose infinite hope.<br>
</span><a moz-do-not-send="true"
href="file:///%5C%5Cquotes%5Ck%5Cmartinlutherking%5C"><i><span
style="font-family: "Arial","sans-serif"; color: red;">Martin Luther
King Jr.</span></i></a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<pre>=======================================================
Ce message et toutes les pieces jointes (ci-apres le "message")
sont confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite.
Tout message electronique est susceptible d'alteration.
La SOCIETE GENERALE et ses filiales declinent toute responsabilite
au titre de ce message s'il a ete altere, deforme ou falsifie.
=======================================================
This message and any attachments (the "message") are confidential
and intended solely for the addressees.
Any unauthorized use or dissemination is prohibited.
E-mails are susceptible to alteration.
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates
shall be liable for the message if altered, changed or falsified.
=======================================================
</pre>
<pre wrap="">
<hr size="4" width="90%">
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
<a class="moz-txt-link-freetext" href="http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone">http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone</a></pre>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Perl-Win32-GUI-Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Per...@li...">Per...@li...</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users">https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users</a>
<a class="moz-txt-link-freetext" href="http://perl-win32-gui.sourceforge.net/">http://perl-win32-gui.sourceforge.net/</a></pre>
</blockquote>
</body>
</html>
|