Advertisement
DragonOsman

12_3_gui_example1.cpp

Mar 17th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. // Osman Zakir
  2. // 3 / 18 / 2017
  3. // Bjarne Stroustrup: Programming: Principles and Practice Using C++ 2nd Edition
  4. // Chapter 12 Section 12.3 First GUI Example
  5. // 12_3_first_gui_example.cpp
  6.  
  7. #include "../../Simple_window.h"
  8. #include "../../Graph.h"
  9.  
  10. int main()
  11. {
  12.     using namespace Graph_lib;
  13.  
  14.     Point tl{ 100, 100 };
  15.  
  16.     Simple_window win{ tl, 600, 400, "Canvas" };
  17.  
  18.     Graph_lib::Polygon poly;
  19.  
  20.     poly.add(Point{ 300, 200 });
  21.     poly.add(Point{ 350, 100 });
  22.     poly.add(Point{ 400, 200 });
  23.  
  24.     poly.set_color(Color::red);
  25.  
  26.     win.attach(poly);
  27.  
  28.     win.wait_for_button();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement