--- appframe.rb.old 2005-02-08 11:46:02.392828416 +0100 +++ appframe.rb 2005-02-08 11:45:38.820411968 +0100 @@ -21,7 +21,24 @@ component_slot.subscribe do |event, slot| if (event == :notify_slot_add && slot.parent == component_slot) - Renderer.new(plugin, slot) + app = Fox::FXApp.new("FreeRIDE", "FreeRIDE") + r = Renderer.new(plugin, slot, app) + app.create + + plugin["/system/ui/messagepump"].set_proc do + begin + app.run + rescue + exc_box = FreerideExceptionBox.new(r,"#{$!.class}: #{$!.message}\n\n#{$@.join("\n")}") + if exc_box.execute == MBOX_CLICKED_YES + plugin['/system/ui/components/EditPane'].each_slot {|ep| ep.manager.save} + end + # raise the exception again for the text console + raise + ensure + plugin["/system/shutdown"].call(1) + end + end end end @@ -36,14 +53,13 @@ class Renderer < Fox::FXMainWindow include Fox attr_reader :plugin - def initialize(plugin, slot) + + def initialize(plugin, slot, app) @plugin = plugin @slot = slot - + @app = app @command = @slot["/system/ui/commands"] @plugin.log_info << "AppFrame started" - @app = FXApp.new("FreeRIDE", "FreeRIDE") - @app.init(ARGV) # use the FR mini icon for the main window mi_path = "#{plugin.plugin_configuration.full_base_path}/icons/bullseye.ico" @@ -130,24 +146,28 @@ @plugin["/system/ui/fox/dockbar/south/textAngle"].data = 0 @plugin.log_info << "Dockbar UI components positioned OK!" - @app.create + #LJ@app.create @running = true - @plugin["/system/ui/messagepump"].set_proc do - begin - @app.run - rescue - exc_box = FreerideExceptionBox.new(self,"#{$!.class}: #{$!.message}\n\n#{$@.join("\n")}") - if exc_box.execute == MBOX_CLICKED_YES - @plugin['/system/ui/components/EditPane'].each_slot {|ep| ep.manager.save} - end - # raise the exception again for the text console - raise - ensure - @running = false - @plugin["/system/shutdown"].call(1) - end - end +# BGB - START +# was: +# @plugin["/system/ui/messagepump"].set_proc do +# begin +# @app.run +# rescue +# exc_box = FreerideExceptionBox.new(self,"#{$!.class}: #{$!.message}\n\n#{$@.join("\n")}") +# if exc_box.execute == MBOX_CLICKED_YES +# @plugin['/system/ui/components/EditPane'].each_slot {|ep| ep.manager.save} +# end +# # raise the exception again for the text console +# raise +# ensure +# @running = false +# @plugin["/system/shutdown"].call(1) +# end +# end +# now: +# BGB - END end def shutdown