[yast-commit] r39217 - /branches/tmp/sh/mod-ui/core/libyui/doc/examples/ComboBox-icons.ycp

Author: sh-sh-sh Date: Fri Jul 6 16:05:30 2007 New Revision: 39217 URL: http://svn.opensuse.org/viewcvs/yast?rev=39217&view=rev Log: new example Added: branches/tmp/sh/mod-ui/core/libyui/doc/examples/ComboBox-icons.ycp Added: branches/tmp/sh/mod-ui/core/libyui/doc/examples/ComboBox-icons.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/doc/... ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/doc/examples/ComboBox-icons.ycp (added) +++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/ComboBox-icons.ycp Fri Jul 6 16:05:30 2007 @@ -0,0 +1,31 @@ +// Combo box with icons +{ + UI::OpenDialog( + `VBox( + `Heading( "YaST2 Mini Control Center" ), + `ComboBox(`id(`mod ), + "Modules", + [ + `item(`id( "keyboard" ), `icon( "yast-keyboard.png" ), "Keyboard" ), + `item(`id( "mouse" ), `icon( "yast-mouse.png" ), "Mouse" ), + `item(`id( "timezone" ), `icon( "yast-timezone.png" ), "Time zone" ), + `item(`id( "lan" ), `icon( "yast-lan.png" ), "Network" ), + `item(`id( "sw_single" ), `icon( "yast-software.png" ), "Software" ) + ] ), + `PushButton("&OK") + ) + ); + UI::UserInput(); + + // Get the input from the combo box. + // + // Notice: The return value of UI::UserInput() does NOT return this value! + // Rather, it returns the ID of the widget (normally the PushButton) + // that caused UI::UserInput() to return. + string mod = (string) UI::QueryWidget(`id(`mod ), `CurrentItem); + + // Close the dialog. + // Remember to read values from the dialog's widgets BEFORE closing it! + 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