class BUTTON_TEST create make feature {NONE} -- Creation d: DISPLAY c: MOUSE_POINTER new_img (fn: STRING): IMAGE is do create {SDL_IMAGE}Result.make_from_file (fn) end make is local b: BUTTON_IMAGE w1: WINDOW do -- Init video create {SDL_DISPLAY}d.make (640,480, 16, True) -- Background create {WINDOW_IMAGE}w1.make (d.root, 100, 100, new_img ("logo.png")) -- Buttons create b.make (d.root, 200, 350, new_img("b1u.png"), new_img("b1p.png"), new_img("b1d.png")) b.set_click_handler (agent on_click("YES!%N") ) create b.make (d.root, 350, 350, new_img("b2u.png"), new_img("b2p.png"), new_img("b2d.png")) b.set_click_handler (agent on_click("OK!%N") ) -- Make pointer create c.make (new_img ("cursor1.png"), 6, 4) -- Set pointer d.root.set_pointer (c) w1.set_pointer (Void) -- Main loop d.do_event_loop d.close rescue if d /=Void then d.close end end on_click (message: STRING) is do print (message) d.add_event (create {EVENT_QUIT}) end end -- class BUTTON_TEST