// HGlue 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 hglue with natural size of 20 pixels and no shrink or stretch. HGlue* hglue1 = new HGlue(20, 0,0); // Create hglue with natural size of 5 pixels and infinite stretchability. HGlue* hglue2 = new HGlue(5, hfil); // Create a horizontal box with these buttons and hglue. HBox* btnbox = new HBox(new HGlue, btn1, hglue1, btn2, hglue2, btn3, new HGlue); // Map the window. world->InsertApplication(new Frame(btnbox, 1, BevelOut)); // Enter the event loop. world->Run(); return 0; }
glue.h