The document discusses libyui, a library that provides abstraction from GUI and TUI toolkits to allow creating user interfaces that can run on multiple platforms from a single codebase. It demonstrates a simple "Hello World" application in C++, Perl, and Python using libyui. It also covers libyui internals, language bindings, debugging tips, and places to find documentation.
46. Hello World dissected, part I int main( int argc, char **argv ) { YDialog *dialog = YUI::widgetFactory()->createPopupDialog(); YLayoutBox *vbox = YUI::widgetFactory()->createVBox( dialog); 1 st call creates UI instance and w.factory instance Get widget pointer from w.factory Widget container (layout aid) Child of the main dialog
47. Hello World dissected, part II YUI::widgetFactory()->createLabel( vbox, "Hello, World!" ); YUI::widgetFactory()->createPushButton( vbox, "&OK" ); Create new widget, specify parent + property (string) Vert. container can have many children
48. Hello World dissected, part III dialog->waitForEvent(); dialog->destroy(); } Wait for user input Use this in event loops Close the dialog, do the final cleanup
55. ' zypper in [perl|python|ruby]-yui ' (that's it ☺ )
56. Hello World with perl-yui !/usr/bin/perl # # Trivial read-write (not write-only :) # example of libyui used from Perl # use yui; 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();
57. Hello World with python-yui # Trivial usage of libyui # in pretty the same way # in python # #!/usr/bin/python import sys import yui factory = yui.YUI.widgetFactory() dialog = factory.createPopupDialog() vbox = factory.createVBox( dialog ) factory.createLabel( vbox, "Hello, World!" ) factory.createPushButton( vbox, "&OK" ) event = dialog.waitForEvent() dialog.destroy()
64. Where to get more information? On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ *-yui package doc with examples: /usr/share/doc/packages/*-yui On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ On line dokumentace: http://www.suse.de/~ug/ YaST development mailing list: [email_address] General YaST doc (incl. widget reference): http://forgeftp.novell.com/yast/doc/SL11 .1
Now we'll move onto the different scripts you can run at different times. Followed by some example of the kind of thing that can be done in the scripts.
Trouble shooting an Aytoyast seutp can be tricky. There are several places where things can go wrong, and debugging post install scripts can require a reinstall each time. However, there are some places to find information.