Thanks. Now I’m a new wx’er.
BTW, Misha on russian equivalent Michael in english
How you do the letters green?
-
I create forms now in DialogBlocks 4.39 (next - DB). If I do not
create a menubar, it’s OK. If I add it, I need to change a PLATFORM
value on it from any to some. It’s normal?
-
Conversion is normal in DB - in my opinion, the question is closed.
-
I copy code, but it not works:
require ‘wx’
include Wx
class MyFrame < Frame
def initialize()
super(nil, -1, ‘My Frame Title’)
# First create the controls
@my_panel = Panel.new(self)
@my_label = StaticText.new(@my_panel, -1, ‘My Label Text’,
DEFAULT_POSITION, DEFAULT_SIZE, ALIGN_CENTER)
@my_textbox = TextCtrl.new(@my_panel, -1, ‘Default Textbox
Value’)
@my_combo = ComboBox.new(@my_panel, -1, ‘Default Combo Text’,
DEFAULT_POSITION, DEFAULT_SIZE, [‘Item 1’, ‘Item 2’, ‘Item 3’])
@my_button = Button.new(@my_panel, -1, ‘My Button Text’)
# Bind controls to functions
evt_button(@my_button.get_id()) { |event|
my_button_click(event)}
# Now do the layout
@my_panel_sizer = BoxSizer.new(VERTICAL)
@my_panel.set_sizer(@my_panel_sizer)
@my_panel_sizer.add(@my_label, 0, GROW|ALL, 2)
@my_panel_sizer.add(@my_textbox, 0, GROW|ALL, 2)
@my_panel_sizer.add(@my_combo, 0, GROW|ALL, 2)
@my_panel_sizer.add(@my_button, 0, GROW|ALL, 2)
show()
end
def my_button_click(event)
# Your code here
end
end
class MyApp < App
def on_init
MyFrame.new
end
end
MyApp.new.main_loop()
myframe = MyFrame.new.show()
There isn’t a .xrc file in this folder. It’s only .rb file. It doesn’t
work…
Can you give me some working simple window code to Copy-Paste in .rb
file as example of ruby-GUI-application.
Sorry for my english, Misha.