// VGlue Example #include <ivplus/box.h> #include <ivplus/button.h> #include <ivplus/frame.h> #include <ivplus/glue.h> #include <ivplus/world.h> #include <string.h> int main(int argc, char **argv) { // Create the world to get the connection with the display. World* world = new World("MyApp", argc, argv); // Create three push buttons. PushButton* btn1 = new PushButton("Button1", new ButtonState(0), 1); PushButton* btn2 = new PushButton("Button2", new ButtonState(0), 1); PushButton* btn3 = new PushButton("Button3", new ButtonState(0), 1); // Create vglue with natural size of 20 pixels and no shrink or stretch. VGlue* vglue1 = new VGlue(20, 0,0); // Create vglue with natural size of 5 pixels and infinite stretchability. VGlue* vglue2 = new VGlue(5, hfil); // Create a vertical box with these buttons and vglue. VBox* btnbox = new VBox(new VGlue, btn1, vglue1, btn2, vglue2, btn3, new VGlue); // Map the window. world->InsertApplication(new Frame(btnbox, 1, BevelOut)); // Enter the event loop. world->Run(); return 0; }
glue.h