samples/sample3/sample.rb in wxruby3-shapes-0.9.0.pre.beta.3 vs samples/sample3/sample.rb in wxruby3-shapes-0.9.5
- old
+ new
@@ -110,11 +110,11 @@
end
def initialize(title)
super(nil, Wx::StandardID::ID_ANY, title, size: [800,600])
- self.icon = Wx::Icon(:sample)
+ self.icon = Wx::Icon(:logo)
if Wx.has_feature?(:USE_MENUS)
# create a menu bar
mbar = Wx::MenuBar.new
file_menu = Wx::Menu.new
@@ -242,18 +242,18 @@
if text.is_a?(Wx::SF::TextShape)
# update the text shape and its parent(s)
text.update
# display some info...
- Wx.log_message("New text of the star with ID #{text.get_parent_shape.id.to_i} is : '#{event.text}'")
+ Wx.log_message("New text of the star with ID #{text.get_parent_shape.object_id} is : '#{event.text}'")
end
end
def on_open(_event)
Wx::FileDialog(self, 'Load diagram from file...', Dir.getwd, '', "JSON Files (*.json)|*.json", Wx::FD_OPEN) do |dlg|
if dlg.show_modal == Wx::ID_OK
File.open(dlg.get_path, 'r') do |f|
- @canvas.set_diagram(Wx::SF::Serializable.deserialize(f))
+ @canvas.set_diagram(FIRM::Serializable.deserialize(f))
@canvas.clear_canvas_history
@canvas.save_canvas_state
end
@diagram = @canvas.get_diagram
@canvas.refresh(false)