1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#include <GUI.h>
using namespace Graph_lib;
//---------------------------------
class Test : public Window {
public:
Test(Point, int, int, const string&);
private:
Button quit_button;
void quit() { hide(); }
static void cb_quit(Address, Address pw) { reference_to<Test>(pw).quit(); }
};
//----------------------------------------------------------------------------------
Test::Test(Point xy, int w, int h, const string& title):
Window(xy, w, h, title),
quit_button(Point(x_max()-120, 120), 80,30, "√", cb_quit) {
attach(quit_button);
}
//-------------------------------------------
int main() {
Test curr(Point(100,100), 500, 300, "Test");
return gui_main();
}
|