From: Sean H. <jal...@ho...> - 2002-02-26 14:36:19
|
>My question is how is possible, or where can be my error, that I need to >press more than one time the window close button for the main window. >If there is some example about how to work with diferrent pm modules >without any problems, I will agree. I have had this problem in the past, and I have tracked it down to one of two things: 1) I have made a second call to Win32::GUI::Dialog inside some event sub, so when I press the close button the first time, that event finishes, but the original Win32::GUI::Dialog is still waiting for a -1 to be returned. If you have other windows with their own WIn32::GUI::Dialog calls, be sure whatever sub causes a secondary window to close also returns -1. 2) I am inside a Win32::GUI::DoEvents loop, and returning -1 will have no real effect until the loop terminates. (Unless, of course, you explicitly check for it - but I never do, because in every situation I've run across, it's easier and more efficient to use Win32::GUI::Dialog than to use Win32::GUI::DoEvents and check for -1.) _________________________________________________________________ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com |
From: Guillem C. W. <vac...@es...> - 2002-02-26 15:21:57
|
Thank you for your attention, but these 2 possible problems doesn't appea= r in my program. I think I have a more basic problem. Let me present how I distribute in pseudocode, for a module that can easy= be extended to more modules. ------------------- module_a.pm ------------------- # all window definition...for instance $window_a sub initial ##the first function that is call for another module { ... $window_a->Show() Win32::GUI::Dialog ... } sub back ## when I come from another module with cancel... { ... $window_a->Show(); ... } sub b_go_click (an event of the window) { ..... $window_a->Hide(); Llibreria:module_b::initial(); ..... return 0; } sub window_a_Terminate { $Window->Hide(); Llibreria::module_aa::back(); return 0; } I am doing a terrible error ?? How is the easy way do to that without possible errors ? All explanations I will receive will be wellcome. Excuses for my possible English mistakes. A lot of thanks. -----Mensaje original----- De: Sean Healy <jal...@ho...> Para: vac...@es... <vac...@es...>; per...@li... <per...@li...> Fecha: dimarts, 26 / febrer / 2002 15:36 Asunto: Re: [perl-win32-gui-users] How I have to separe the Win32::GUI between pm module >>My question is how is possible, or where can be my error, that I need t= o >>press more than one time the window close button for the main window. >>If there is some example about how to work with diferrent pm modules >>without any problems, I will agree. > >I have had this problem in the past, and I have tracked it down to one o= f >two things: > >1) I have made a second call to Win32::GUI::Dialog inside some event sub= , so >when I press the close button the first time, that event finishes, but t= he >original Win32::GUI::Dialog is still waiting for a -1 to be returned. I= f >you have other windows with their own WIn32::GUI::Dialog calls, be sure >whatever sub causes a secondary window to close also returns -1. > >2) I am inside a Win32::GUI::DoEvents loop, and returning -1 will have n= o >real effect until the loop terminates. (Unless, of course, you explicit= ly >check for it - but I never do, because in every situation I've run acros= s, >it's easier and more efficient to use Win32::GUI::Dialog than to use >Win32::GUI::DoEvents and check for -1.) > >_________________________________________________________________ >Join the world=92s largest e-mail service with MSN Hotmail. >http://www.hotmail.com > > |
From: Aldo C. <da...@pe...> - 2003-01-23 12:48:02
|
Guillem Cunillera Wefers wrote: > Thank you for your attention, but these 2 possible problems doesn't > appear in my program. I think I have a more basic problem. > Let me present how I distribute in pseudocode, for a module that can > easy be extended to more modules. > > ------------------- > module_a.pm > ------------------- > > # all window definition...for instance $window_a > > sub initial ##the first function that is call for another module > { > ... > $window_a->Show() > Win32::GUI::Dialog > ... > } this seems to be exactly the problem Sean pointed out. if you call the 'initial' function for more than one module (assuming they are all similar), you're in fact calling Win32::GUI::Dialog more than one time. try removing the Win32::GUI::Dialog call from your modules and placing it in the main application, where it is called only once. cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print; |
From: Guillem C. W. <vac...@es...> - 2002-02-26 16:25:59
|
> >this seems to be exactly the problem Sean pointed out. if you call the >'initial' function for more than one module (assuming they are all similar), >you're in fact calling Win32::GUI::Dialog more than one time. try removing >the Win32::GUI::Dialog call from your modules and placing it in the main >application, where it is called only once. Ok !! That's I really want, only one Win32::GUI::Dialog to prevent errors. Cheers Regards from Catalonia Guillem Cunillera Wefers |