1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
--- 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
|