Displaying 1 result from an estimated 1 matches for "candyframe".
Did you mean:
can_frame
2007 Sep 27
10
Adding more sugar to wxSugar
...the
main_loop method for an app).
class CandyApp < Wx::App
attr_accessor :init_block
def self.create &block
# Create and run the application
app = new
app.init_block = block
app.main_loop
end
def on_init
instance_eval &init_block
true
end
end
class CandyFrame < Wx::Frame
def self.create *args, &block
frame = new args
frame.instance_eval &block
frame
end
def initialize args
super *args
end
end
Given these simple additional classes, the minimal app sample can be
written like this :
CandyApp.create do
self.app_name...