[yast-commit] r58194 - /trunk/ycp-ui-bindings/examples/IconButton1.ycp

Author: kmachalkova Date: Tue Jul 28 15:49:01 2009 New Revision: 58194 URL: http://svn.opensuse.org/viewcvs/yast?rev=58194&view=rev Log: Extended example (borrowed from y2-gtk/tests and improved) Modified: trunk/ycp-ui-bindings/examples/IconButton1.ycp Modified: trunk/ycp-ui-bindings/examples/IconButton1.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/examples/IconButt... ============================================================================== --- trunk/ycp-ui-bindings/examples/IconButton1.ycp (original) +++ trunk/ycp-ui-bindings/examples/IconButton1.ycp Tue Jul 28 15:49:01 2009 @@ -1,12 +1,30 @@ +// PushButton with icons (relative path) { - // Build a dialog with one icon button. - // Wait until that button is clicked, - // then close the dialog and terminate. + UI::OpenDialog ( + `VBox ( + `Heading( "YaST2 Mini Control Center" ), + `IconButton (`id ("keyboard "), "yast-keyboard.png", "Keyboard"), + `IconButton (`id ("mouse" ), "yast-mouse.png", "Mouse"), + `IconButton (`id ("timezone" ), "yast-timezone.png", "Time zone"), + `IconButton (`id ("lan" ), "yast-lan.png", "Network"), + `IconButton (`id ("sw_single"), "yast-software.png", "Software") + ) + ); - UI::OpenDialog( - `IconButton( "icons/22x22/apps/yast-users.png", "&OK" ) - ); + any ret = nil; - UI::UserInput(); - UI::CloseDialog(); + do + { + ret = UI::UserInput(); + + if (ret != `cancel) + { + UI::OpenDialog (`Label ("Running " + (string) ret + "...")); + sleep (4000); + UI::CloseDialog(); + } + + } while ( ret != `cancel); + + UI::CloseDialog(); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
kmachalkova@svn.opensuse.org