#!ruby # -*- mode: ruby; coding: utf-8 -*- # Last updated: <2016/01/12 02:32:41 +0900> require_relative './lib/dxrubyws' require_relative './lib/standardgui' module WS class TutorialWindow < WSWindow def initialize(*args) super button = WS::WSButton.new(10,10,100,20,"TutorialButton") client.add_control(button, :btn) button.add_handler(:click, self.method(:on_click)) end def on_click(obj, tx, ty) client.btn.x += 10 client.btn.y += 10 end end end window = WS::TutorialWindow.new(100,100,300,200,"TutorialWindow") WS.desktop.add_control(window) Window.loop do WS.update end