Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hi All,

I have developed a perl GUI application using Wx::Perl. The front end was developed using wxGlade and the application is working as expected when I run it from Padre or cmd. Now I want to build an exe of my application. So I used PAR::Packer (pp) to build the exe. After many attempts I was able to built an exe (I got many missing dll and Wx module error and I added them all manually).

Now I have got two issues:

1. The generated exe is not showing the GUI. It just exists after hanging for few seconds. No errors, nothing. After a long debugging/rebuilding I was able to find the cause. My main program is as bellow (It was generated by xwGlade)

package main; unless(caller){ local *Wx::App::OnInit = sub{1}; my $app = Wx::App->new(); Wx::InitAllImageHandlers(); my $provisioning = provisioningChecklist->new(); $app->SetTopWindow($provisioning); $provisioning->Show(1); $app->MainLoop(); }

I found out that the exe is not entering the 'unless' block. If I comment out the 'unless' condition and rebuild the exe, GUI works.

So what is this 'caller' and why is it not running when I pack it using PAR::Packer, but works fine if it is run as normal perl script?

2. My Application uses a Marquee style progress bar while it populates the data in background. It is implemented using two threads. The logic is as below:

THREAD 1 enters a loop, generates an EVENT and sleeps for few milliseconds. The loop is controlled by a shared variable. The main program catches the EVENT and fires Wx::Gauge->Pulse;

THREAD 2 does the actual work and result is set in shared variable. An EVENT is fired and the main program catches it and populates the grid with the result. After all the work is done, shared variable is set to stop the THREAD 1 loop and an EVENT is generated to destroyed the progress bar.

This works fine when I run the script from cmd or Parde. But when I run the exe, progress bar window appears but the gauge is not moving. However the grid is populated with data. I am confused with the behaviour and dont know how to debug the exe. Any help on how to proceed further is greatly appreciated.

English is not my native language, hence forgive me for any mistakes and for the long post.

"Experience is the child of thought, and thought is the child of action."

In reply to wxperl + PAR::Packer + GUI not working by alfoos

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-16 14:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found