Ok, here is my class:
#====================================
class SetupWizard < Wx::Wizard
def initialize(timefly, title)
setup_image = Wx::Bitmap.new(“wizard_side.png”,
Wx::BITMAP_TYPE_PNG)
super(nil, -1, title, setup_image)
@timefly = timefly
step_one = Wx::WizardPageSimple.new()
setup_page_one(step_one)
step_two = Wx::WizardPageSimple.new(nil, step_one)
step_one.set_next(step_two)
setup_page_two(step_two)
run_wizard(step_one)
#self.show(true)
end
def setup_page_one(step)
intro_label =
“some
text
here”
Wx::StaticText.new(step, :label => intro_label)
end
def setup_page_two(step)
label =
“more
text here”
Wx::StaticText.new(step, :label => label)
txt = Wx::TextCtrl.new(step,
:id => 21,
:value => @timefly.running_path+“log”,
:style => Wx::TE_READONLY,
:size => Wx::Size.new(270,-1),
:pos => Wx::Point.new(0, 140),
:name => "step2path")
btn_change_path = Wx::Button.new(step,
:id =>22,
:label => 'Change',
:pos => Wx::Point.new(0, 163),
:name => "btn_change_path")
evt_button(22) {|evt| on_change_logpath(evt)}
btn_default_path = Wx::Button.new(step,
:id =>22,
:label => 'Default',
:pos => Wx::Point.new(80, 163),
:name => "btn_default_path")
end
def on_change_logpath(evt)
print “change logpath!”
end
end
#====================================
#here is the call from within another class:
#====================================
…
SetupWizard.new(@timefly, “TimeFly Setup”)
…
#====================================
I got the splash screen working with a timer (see previous post:
Wx::SplashScreen, and events)
Let me qualify the above code by saying that it originally inherited
from Wx::Frame, and I made a new Wx:Wizard with the self (Wx::Frme) as
parent. But I was having a problem where NO events were firing when I
intereacted with the controls on each WizardPageSimple.
So I decided to try and see if making the whole thing inherit Wx::Wizard
and set parent window to nil works any better. Well - now I see the
wizard for just under half a second, and it never comes back. The ruby
runtime continues though - and I get no error messages.
What did I miss?
HALP!