greenhorn_007 has asked for the wisdom of the Perl Monks concerning the following question:

Hi to all :)

I have a program and some wxWidgets GUI. And I want my progress messages from the execution of the program to be displayed in wxWidgets. I was told I can hold a reference to my field, where I display the messages and just update it's value form inside my program.But I can't figure how exectly?

My GUI is actually a wizardWidow with wizardPages, and I want AFTER a specific page is loaded in the Wizard to run my code and display the progress messages from it in the GUI. So that thing "after a page is loaded" it's like after a Event. I can do it IN that Evvent, but the the page is not yet properly displayed. How can I do something just after an event is done?

Actually, I think this event EVT_WIZARD_PAGE_SHOWN will be perfect for my needs, except the fact it's not being recognized. It just says subroutine undefined and I can't use it.

Replies are listed 'Best First'.
Re: wxWidgets Events question
by taint (Chaplain) on May 27, 2014 at 17:30 UTC
    Greetings, greenhorn_007.

    Do you have any example code you can display, so we have some idea of how to help/direct you? As it is now, we're left with as many questions, as you have. :)

    A link to the wxWidgets Module(s) you're using, would also be of great help, in giving you better, more accurate information.

    --Chris

    ¡λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ꜱᴉɥʇ ədoH

      Sorry for being so unclear. Unfortunately a code sample would not be possible. I can give some links to the documentation pages I am using and try to make my explanation more clear?

      The Wizard documentation link: http://docs.wxwidgets.org/2.8.12/wx_wxwizard.html#wxwizard So there is this window wizard I want to use. It navigates threw some pages (special WizardPage or WizardPageSimple - they are practicaly panels with links to previous and next page). And in this WizardPages I just place my controls like buttons and text fields. The wizard window has some special events like page changed(meaning next/back button click) etc. I am using wizard with 2 pages. The first for collecting user data. The second - for running my program with that data and displaying results. While my program (well, it's not really a program, just the real logic in my code, classes etc, that can happily live without GUI, they do the real stuff). That code produces some progress messages: they tell what it is doing at the moment. I want my second page to display these messages. But it's kind of like... sending some info to the GUI without events, without user input, just some other part of the code wants to give it.

      I thought that I can run my real code with the collected data in some appropriate event handler. But what would that event be? I liked the EVT_WIZARD_PAGE_SHOWN(id, func). The problem is my program doesn't recognize it? But it recognizes the EVT_WIZARD_PAGE_CHANGED - so I thought just after this handler is done- it's my turn. How is that done and is it possible? Or is there another approach to running my code and sending some stuff to the GUI?

Re: wxWidgets Events question
by Anonymous Monk on May 28, 2014 at 00:25 UTC
    Can you pick one question you'd like answered?
      Ok, how can I do something after a specific event handler is done?

        Ok, how can I do something after a specific event handler is done?

        Is there an event type that is documented to fire after that specific event? Is it supported by wxPerl? For the installed/compiled-against version of wxWidgets?

        If there is, you simply register another event handler :)

        If there is not, then whatever you needed to do, you should have done from within your original event handler, perhaps at the very end of it :)

        OTOH , you can update display from within event handlers ... and from outside of them