void button() { rectangle(590,450,635,475); outtextxy(591,450,"Clear"); if(b!=0) {if(mx>=590&&my>=450&&mx<=635&&my<=475) {cleardevice();}} rectangle(590,425,635,450); outtextxy(591,425,"Color"); if(b!=0) {if(mx>=590&&my>=425&&mx<=635&&my<=450) {color();}} rectangle(590,400,635,425); outtextxy(591,400,"Close"); if(b!=0) {if(mx>=590&&my>=400&&mx<=635&&my<=425) {exit(1);}} rectangle(590,375,635,400); outtextxy(591,375,"Save"); if(b!=0) {if(mx>=590&&my>=375&&mx<=635&&my<=400) {save();}} rectangle(590,350,635,375); outtextxy(591,350,"Load"); if(b!=0) {if(mx>=590&&my>=350&&mx<=635&&my<=375) {load();}} rectangle(590,325,635,350); outtextxy(591,325,"Erase"); if(b!=0) {if(mx>=590&&my>=325&&mx<=635&&my<=350) {rubber();}} rectangle(590,300,635,325); outtextxy(591,300,"Shape"); if(b!=0) {if(mx>=590&&my>=300&&mx<=635&&my<=325) {shape();}} }
int main(int argc, char **argv){ Gtk::Main kit (argc, argv); Gtk::Window win; GObjTestTile p1; SimpleViewer viewer(&p1); Rubber rubber(&viewer); iPoint p(20,20); rubber.add_src_sq(p, 3); rubber.add_dst_sq(3); rubber.add_rect(p); rubber.add_line(p); win.add(viewer); win.set_default_size(640,480); win.show_all(); kit.run(win); }