Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- / Compile with:
- //
- // g++ -I/usr/include/yui -lyui Test.cc -o Test
- #include "YUI.h"
- #include "YWidgetFactory.h"
- #include "YDialog.h"
- #include "YLayoutBox.h"
- #include "YLabel.h"
- #include "YFrame.h"
- #include "YInputField.h"
- #include "YEvent.h"
- int main( int argc, char **argv )
- {
- YDialog * dialog = YUI::widgetFactory()->createMainDialog();
- YLayoutBox * vbox = YUI::widgetFactory()->createVBox( dialog );
- YLayoutBox * hbox = YUI::widgetFactory()->createHBox( vbox );
- YFrame * frame = YUI::widgetFactory()->createFrame(hbox, "Frame 1");
- frame->setWeight(YD_HORIZ, 2);
- YLayoutBox * vbox1 = YUI::widgetFactory()->createHBox( frame );
- YLabel *l1 = YUI::widgetFactory()->createLabel( vbox1, "Label 1" );
- YUI::widgetFactory()->createInputField( vbox1, "Input 1" );
- frame = YUI::widgetFactory()->createFrame(hbox, "Frame 2");
- frame->setWeight(YD_HORIZ, 4);
- vbox1 = YUI::widgetFactory()->createHBox( frame );
- YLabel *l2 = YUI::widgetFactory()->createLabel( vbox1, "Label 2" );
- YUI::widgetFactory()->createInputField( vbox1, "Input 2" );
- YUI::widgetFactory()->createPushButton( hbox, "Submit" );
- YUI::widgetFactory()->createPushButton( vbox, "&OK" );
- dialog->waitForEvent();
- dialog->destroy();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement