[yast-commit] r41572 - /branches/tmp/sh/mod-ui/core/libyui/doc/examples/ComboBox5.ycp
![](https://seccdn.libravatar.org/avatar/d788d4d6ea7d5ed777eaa8feaaa2c1d8.jpg?s=120&d=mm&r=g)
Author: sh-sh-sh Date: Thu Oct 25 16:20:18 2007 New Revision: 41572 URL: http://svn.opensuse.org/viewcvs/yast?rev=41572&view=rev Log: New example Added: branches/tmp/sh/mod-ui/core/libyui/doc/examples/ComboBox5.ycp Added: branches/tmp/sh/mod-ui/core/libyui/doc/examples/ComboBox5.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/doc/examples/ComboBox5.ycp?rev=41572&view=auto ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/doc/examples/ComboBox5.ycp (added) +++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/ComboBox5.ycp Thu Oct 25 16:20:18 2007 @@ -0,0 +1,48 @@ +// Advanced ComboBox / SelecionBox example: +// Dialog with a ComboBox and a SelectionBox +// where selecting an item in one will also select it in the other +{ + list items = + [ + `item(`id( "Napoli" ), "Napoli" ), + `item(`id( "Funghi" ), "Funghi", true ), + `item(`id( "Salami" ), "Salami" ) + ]; + + UI::OpenDialog( + `VBox( + `MinSize( 30, 5, + `HBox( + `Top( + `ComboBox(`id(`pizzaComboBox), `opt(`notify), "Pizza:", items ) + ), + `SelectionBox (`id(`pizzaSelBox ), `opt(`notify), "Pizza:", items ) + ) + ), + `Right(`PushButton(`id(`cancel), "&Close") ) + ) + ); + + symbol widget = nil; + + repeat + { + widget = (symbol) UI::UserInput(); + // y2debug( "Event widget: %1", widget ); + + if ( widget == `pizzaComboBox || widget == `pizzaSelBox ) + { + string pizza = (string) UI::QueryWidget( widget, `Value ); + y2debug( "Pizza: %1", pizza ); + + UI::ChangeWidget( widget == `pizzaComboBox ? + `pizzaSelBox : `pizzaComboBox, + `Value, pizza ); + + y2debug( "ComboBox: %1", UI::QueryWidget(`pizzaComboBox, `Items ) ); + y2debug( "SelBox : %1", UI::QueryWidget(`pizzaSelBox, `Items ) ); + } + } until ( widget == `cancel ); + + UI::CloseDialog(); +} -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
sh-sh-sh@svn.opensuse.org