Hi Monks,
I have a GUI application (written in wxPerl) which calls other processes (mostly perl scripts) based on user selection.
If user selects all processes and clicks
Start P1 ... P
N is called in sequence.
Question 1
-How do I disable (gray-out) some other buttons when button A is selected. I also want to ensure if button is clicked more than once, event occurs only once.
Right now I am setting a global variable flag to see if/which button is clicked. It seems a primitive way to do it.
Question 2-
-The application needs to provide user control to
Pause after current process finishes and before it kicks off the next process.
The problem I am having is that Once Start Button is clicked control is handed over to the subroutine called and until the sub doesn't return, the GUI does not process any other events.
So how do I make event A run in background and return to GUI's main Loop so it can process other events.
Any Help is very much appreciated.
The relevant part of code is given below:
##All GUI defining.layout stuff here
#
EVT_BUTTON ($self,
$start_btn,
\&runProcess1,
);
EVT_BUTTON ($self,
$pause_btn,
\&runProcess2,
);
sub runProcess1{
my ($self, $event)= @_;
if (!$MyFrame::startIsClicked){
&MyMethods::testStartJob($self,$event);
}
}
sub runProcess2{
my ($self, $event)= @_;
$| =1;
print "This is the pause event \n";
}
Thank you Wise Monks,
I work to fork now...
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.