Scores - true // this allows graphics without control...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
string person; int grade; i struct Simple_window3 : Window { s : Window(xy,w,h,title), button_pushed(false), mole2(Point(175,325),160,75," PLAY AGAIN? ", cb_next), mole3(Point(400,325),125,75," QUIT ", cb_quit) { attach(mole2); attach(mole3); } void wait_for_button3() // modified event loop // handle all events (as per default), but quit when button_pushed becomes true // this allows graphics without control inversion { while (!button_pushed) Fl::wait(); button_pushed = false; Fl::redraw(); } void wait_for_button4() // modified event loop // handle all events (as per default), but quit when button_pushed becomes
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: true // this allows graphics without control inversion { while (!button_pushed) Fl::wait(); button_pushed = true; hide(); } Button mole2; Button mole3; B bool button_pushed; b static void cb_next(Address, Address addr) // callback for play again button // { reference_to<Simple_window>(addr).next(); } { static_cast<Simple_window3*>(addr)->next(); } static void cb_quit(Address, Address addr) // callback for quit button // { reference_to<Simple_window>(addr).next(); } { static_cast<Simple_window3*>(addr)->quit(); } void next() { button_pushed = true;} void quit() { hide();} v };...
View Full Document

This note was uploaded on 02/26/2011 for the course ECE 112 taught by Professor Doraty during the Spring '11 term at Texas A&M.

Ask a homework question - tutors are online