Author: kkaempf Date: Fri May 23 15:14:54 2008 New Revision: 47836 URL: http://svn.opensuse.org/viewcvs/yast?rev=47836&view=rev Log: fix the Perl example Modified: trunk/libyui-bindings/swig/perl/examples/selection_box1.pl Modified: trunk/libyui-bindings/swig/perl/examples/selection_box1.pl URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui-bindings/swig/perl/examples/selection_box1.pl?rev=47836&r1=47835&r2=47836&view=diff ============================================================================== --- trunk/libyui-bindings/swig/perl/examples/selection_box1.pl (original) +++ trunk/libyui-bindings/swig/perl/examples/selection_box1.pl Fri May 23 15:14:54 2008 @@ -5,19 +5,14 @@ use yui; -yui::YUILog::setLogFileName( "/tmp/libyui-examples.log" ); -yui::YUILog::enableDebugLogging(); +# yui::YUILog::setLogFileName( "/tmp/libyui-examples.log" ); +# yui::YUILog::enableDebugLogging(); my $factory = yui::YUI::widgetFactory; my $dialog = $factory->createPopupDialog; my $vbox = $factory->createVBox( $dialog ); -# $factory->createLabel( $vbox, "Hello, World!" ); -# $factory->createPushButton( $vbox, "&OK" ); -# my $event = $dialog->waitForEvent(); -# $dialog->destroy(); - my $selBox = $factory->createSelectionBox( $vbox, "&Menu" ); $selBox->addItem( "Pizza Margherita" ); @@ -40,36 +35,26 @@ # # Event loop # - while (1) { - print "Begin of loop"; - my $event = $dialog->waitForEvent(); + $event = $dialog->waitForEvent(); if( not event ) { next } - print "Event !"; - if ($event->eventType() == yui::YEvent::CancelEvent) { # window manager "close window" button - print "Cancel"; - break; + if ($event->eventType() == $yui::YEvent::CancelEvent) { # window manager "close window" button + last; } - print "Not a cancel"; $valueField->setValue( "???" ); if ($event->widget() == $closeButton) { - print "Close"; - break; + last; } - print "Not a close"; - if ( ($event->widget() == $valueButton) || ($event->widget() == $selBox )) { # selBox will only send events with setNotify() + if ( ($event->widget() == $valueButton) or ($event->widget() == $selBox )) { # selBox will only send events with setNotify() $item = $selBox->selectedItem(); - print "selBox or valueButton"; if ($item) { $valueField->setValue( $item->label() ); } else { $valueField->setValue( "<none>" ); } - print "valueField set"; } } -print "Loop end"; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org