Author: sh-sh-sh Date: Wed Dec 5 20:01:40 2007 New Revision: 42739 URL: http://svn.opensuse.org/viewcvs/yast?rev=42739&view=rev Log: new example Added: trunk/core/libyui/doc/examples/PopupStressTest.ycp Added: trunk/core/libyui/doc/examples/PopupStressTest.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/doc/examples/PopupStressTest.ycp?rev=42739&view=auto ============================================================================== --- trunk/core/libyui/doc/examples/PopupStressTest.ycp (added) +++ trunk/core/libyui/doc/examples/PopupStressTest.ycp Wed Dec 5 20:01:40 2007 @@ -0,0 +1,58 @@ +// Popup stress test: Pop up dialogs and close them all the time +{ + UI::OpenDialog(`opt(`defaultsize ), + `VBox( + `Heading( "Pop-up Stress Test" ), + `VSpacing( 5 ), + `Label( "Sit back and watch the pop-up dialogs.\n" + + "\n" + + "Experiment with minimizing this application\n" + + "and with working with some other application\n" + + "while this is running." ), + `Bottom(`Right(`PushButton(`id(`cancel), `opt(`default), "&Close" ) ) ) + ) + ); + + while ( true ) + { + if ( UI::TimeoutUserInput(3*1000) == `cancel ) + break; + + UI::OpenDialog(`VBox( + `Heading("Annoying pop-up #1" ), + `PushButton(`id(`cancel), `opt(`default), "&Cancel" ) + ) + ); + + if ( UI::TimeoutUserInput(3*1000) == `cancel ) + { + UI::CloseDialog(); + break; + } + + UI::OpenDialog(`VBox( + `Heading("Annoying pop-up #2" ), + `PushButton(`id(`cancel), `opt(`default), "&Cancel" ) + ) + ); + + if ( UI::TimeoutUserInput(3*1000) == `cancel ) + { + UI::CloseDialog(); + UI::CloseDialog(); + break; + } + + UI::CloseDialog(); // close pop-up #2 + + if ( UI::TimeoutUserInput(3*1000) == `cancel ) + { + UI::CloseDialog(); + break; + } + + UI::CloseDialog(); // close pop-up #1 + } + + UI::CloseDialog(); +} -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org