Advertisement
Guest User

anaselli

a guest
Feb 26th, 2014
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.29 KB | None | 0 0
  1. / Compile with:
  2. //
  3. //     g++ -I/usr/include/yui -lyui Test.cc -o Test
  4.  
  5. #include "YUI.h"
  6. #include "YWidgetFactory.h"
  7. #include "YDialog.h"
  8. #include "YLayoutBox.h"
  9. #include "YLabel.h"
  10. #include "YFrame.h"
  11. #include "YInputField.h"
  12. #include "YEvent.h"
  13.  
  14. int main( int argc, char **argv )
  15. {
  16.     YDialog    * dialog = YUI::widgetFactory()->createMainDialog();
  17.     YLayoutBox * vbox   = YUI::widgetFactory()->createVBox( dialog );
  18.     YLayoutBox * hbox   = YUI::widgetFactory()->createHBox( vbox );
  19.  
  20.     YFrame     * frame  = YUI::widgetFactory()->createFrame(hbox, "Frame 1");
  21.     frame->setWeight(YD_HORIZ, 2);
  22.     YLayoutBox * vbox1   = YUI::widgetFactory()->createHBox( frame );
  23.     YLabel *l1 = YUI::widgetFactory()->createLabel( vbox1, "Label 1" );
  24.     YUI::widgetFactory()->createInputField( vbox1, "Input 1" );
  25.  
  26.     frame  = YUI::widgetFactory()->createFrame(hbox, "Frame 2");
  27.     frame->setWeight(YD_HORIZ, 4);
  28.     vbox1  = YUI::widgetFactory()->createHBox( frame );
  29.     YLabel *l2 = YUI::widgetFactory()->createLabel( vbox1, "Label 2" );
  30.     YUI::widgetFactory()->createInputField( vbox1, "Input 2" );
  31.  
  32.     YUI::widgetFactory()->createPushButton( hbox, "Submit" );
  33.     YUI::widgetFactory()->createPushButton( vbox, "&OK" );
  34.  
  35.     dialog->waitForEvent();
  36.     dialog->destroy();
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement