fxri 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/fxri-0.3.6.tar.gz +0 -0
  2. data/fxri.gemspec +1 -1
  3. data/lib/fxirb.rb +433 -369
  4. metadata +3 -2
Binary file
@@ -4,7 +4,7 @@ require 'rubygems'
4
4
  spec = Gem::Specification.new do |s|
5
5
  s.name = "fxri"
6
6
  s.add_dependency('fxruby', '>= 1.2.0')
7
- s.version = "0.3.5"
7
+ s.version = "0.3.6"
8
8
  s.date = Time.now
9
9
  s.summary = "Graphical interface to the RI documentation, with search engine."
10
10
  s.require_paths = ["lib"]
@@ -1,20 +1,17 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
- # TODO
4
- # - handle user input redirection
5
- # - readline
6
-
7
3
  # Credits:
8
4
  # - Initial linux version: Gilles Filippini
9
5
  # - Initial windows port : Marco Frailis
10
- # - Currently maintained and developed by
6
+ # - Currently maintained and developed by
11
7
  # Martin DeMello <martindemello@gmail.com>
12
8
 
13
- # Not needed; fxri already does that
14
- #require "fox16"
9
+ # fxri already includes Fox
10
+ #require "fox12"
15
11
  require "irb"
16
12
  require "singleton"
17
13
  require "English"
14
+ require 'thread'
18
15
 
19
16
  include Fox
20
17
 
@@ -22,380 +19,447 @@ STDOUT.sync = true
22
19
 
23
20
  class FXIRBInputMethod < IRB::StdioInputMethod
24
21
 
25
- attr_accessor :print_prompt, :gets_mode
26
-
27
- def initialize
28
- super
29
- @history = 1
30
- @begin = nil
31
- @print_prompt = true
32
- @end = nil
33
- @continued_from = nil
34
- @gets_mode = false
35
- end
36
-
37
- def gets
38
- if @gets_mode
39
- return FXIrb.instance.get_line
40
- end
41
-
42
- if (a = @prompt.match(/(\d+)[>*]/))
43
- level = a[1].to_i
44
- else
45
- level = 0
46
- end
47
-
48
- if level > 0
49
- @continued_from ||= @line_no
50
- elsif @continued_from
51
- merge_last(@line_no-@continued_from+1)
52
- @continued_from = nil
53
- end
54
-
55
- if @print_prompt
56
- print @prompt
57
-
58
- #indentation
59
- print " "*level
60
- end
61
-
62
- str = FXIrb.instance.get_line
63
-
64
- @line_no += 1
65
- @history = @line_no + 1
66
- @line[@line_no] = str
67
-
68
- str
69
- end
70
-
71
- # merge a block spanning several lines into one \n-separated line
72
- def merge_last(i)
73
- return unless i > 1
74
- range = -i..-1
75
- @line[range] = @line[range].map {|l| l.chomp}.join("\n")
76
- @line_no -= (i-1)
77
- @history -= (i-1)
78
- end
79
-
80
- def prevCmd
81
- return "" if @gets_mode
82
-
83
- if @line_no > 0
84
- @history -= 1 unless @history <= 1
85
- return line(@history)
86
- end
87
- return ""
88
- end
89
-
90
- def nextCmd
91
- return "" if @gets_mode
92
-
93
- if (@line_no > 0) && (@history < @line_no)
94
- @history += 1
95
- return line(@history)
96
- end
97
- return ""
98
- end
22
+ attr_accessor :print_prompt, :gets_mode
23
+
24
+ def initialize
25
+ super
26
+ @history = 1
27
+ @begin = nil
28
+ @end = nil
29
+ @print_prompt = true
30
+ @continued_from = nil
31
+ @gets_mode = false
32
+ end
33
+
34
+ def gets
35
+ if @gets_mode
36
+ return FXIrb.instance.get_line
37
+ end
38
+
39
+ if (a = @prompt.match(/(\d+)[>*]/))
40
+ level = a[1].to_i
41
+ continued = @prompt =~ /\*\s*$/
42
+ else
43
+ level = 0
44
+ end
45
+
46
+ if level > 0 or continued
47
+ @continued_from ||= @line_no
48
+ elsif @continued_from
49
+ merge_last(@line_no-@continued_from+1)
50
+ @continued_from = nil
51
+ end
52
+
53
+ l = @line.length
54
+ @line = @line.reverse.uniq.reverse
55
+ delta = l - @line.length
56
+ @line_no -= delta
57
+ @history -= delta
58
+
59
+ if print_prompt
60
+ print @prompt
61
+
62
+ #indentation
63
+ print " "*level
64
+ end
65
+
66
+ str = FXIrb.instance.get_line
67
+
68
+ @line_no += 1
69
+ @history = @line_no + 1
70
+ @line[@line_no] = str
71
+
72
+ str
73
+ end
74
+
75
+ # merge a block spanning several lines into one \n-separated line
76
+ def merge_last(i)
77
+ return unless i > 1
78
+ range = -i..-1
79
+ @line[range] = @line[range].join
80
+ @line_no -= (i-1)
81
+ @history -= (i-1)
82
+ end
83
+
84
+ def prev_cmd
85
+ return "" if @gets_mode
86
+
87
+ if @line_no > 0
88
+ @history -= 1 unless @history <= 1
89
+ return line(@history)
90
+ end
91
+ return ""
92
+ end
93
+
94
+ def next_cmd
95
+ return "" if @gets_mode
96
+
97
+ if (@line_no > 0) && (@history < @line_no)
98
+ @history += 1
99
+ return line(@history)
100
+ end
101
+ return ""
102
+ end
99
103
 
100
104
  end
101
105
 
102
106
  module IRB
103
107
 
104
- def IRB.start_in_fxirb(im)
105
- if RUBY_VERSION < "1.7.3"
106
- IRB.initialize(nil)
107
- IRB.parse_opts
108
- IRB.load_modules
109
- else
110
- IRB.setup(nil)
111
- end
112
-
113
- irb = Irb.new(nil, im)
114
-
115
- @CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
116
- @CONF[:MAIN_CONTEXT] = irb.context
117
- trap("SIGINT") do
118
- irb.signal_handle
119
- end
120
-
121
- class << irb.context.workspace.main
122
- def gets
123
- inp = IRB.conf[:MAIN_CONTEXT].io
124
- inp.gets_mode = true
125
- retval = IRB.conf[:MAIN_CONTEXT].io.gets
126
- inp.gets_mode = false
127
- retval
128
- end
129
- end
130
-
131
- catch(:IRB_EXIT) do
132
- irb.eval_input
133
- end
134
- print "\n"
135
-
136
- end
108
+ def IRB.start_in_fxirb(im)
109
+ if RUBY_VERSION < "1.7.3"
110
+ IRB.initialize(nil)
111
+ IRB.parse_opts
112
+ IRB.load_modules
113
+ else
114
+ IRB.setup(nil)
115
+ end
116
+
117
+ irb = Irb.new(nil, im)
118
+
119
+ @CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
120
+ @CONF[:MAIN_CONTEXT] = irb.context
121
+ trap("SIGINT") do
122
+ irb.signal_handle
123
+ end
124
+
125
+ class << irb.context.workspace.main
126
+ def gets
127
+ inp = IRB.conf[:MAIN_CONTEXT].io
128
+ inp.gets_mode = true
129
+ retval = IRB.conf[:MAIN_CONTEXT].io.gets
130
+ inp.gets_mode = false
131
+ retval
132
+ end
133
+ end
134
+
135
+ catch(:IRB_EXIT) do
136
+ irb.eval_input
137
+ end
138
+ print "\n"
139
+ end
140
+
141
+ end
142
+
143
+ class FXEvent
144
+ def ctrl?
145
+ (self.state & CONTROLMASK) != 0
146
+ end
137
147
 
148
+ def shift?
149
+ (self.state & SHIFTMASK) != 0
150
+ end
138
151
  end
139
152
 
140
153
 
141
154
  class FXIrb < FXText
142
- include Singleton
143
- include Responder
144
-
145
- attr_reader :input
146
-
147
- def FXIrb.init(p, tgt, sel, opts)
148
- unless @__instance__
149
- Thread.critical = true
150
- begin
151
- @__instance__ ||= new(p, tgt, sel, opts)
152
- ensure
153
- Thread.critical = false
154
- end
155
- end
156
- return @__instance__
157
- end
158
-
159
- def initialize(p, tgt, sel, opts)
160
- FXMAPFUNC(SEL_KEYRELEASE, 0, "onKeyRelease")
161
- FXMAPFUNC(SEL_KEYPRESS, 0, "onKeyPress")
162
- FXMAPFUNC(SEL_LEFTBUTTONPRESS,0,"onLeftBtnPress")
163
- FXMAPFUNC(SEL_MIDDLEBUTTONPRESS,0,"onMiddleBtnPress")
164
- FXMAPFUNC(SEL_LEFTBUTTONRELEASE,0,"onLeftBtnRelease")
165
-
166
- super
167
- setFont(FXFont.new(FXApp.instance, "lucida console", 9))
168
- @anchor = 0
169
- end
170
-
171
- def create
172
- super
173
- setFocus
174
- # IRB initialization
175
- @inputAdded = 0
176
- @input = IO.pipe
177
- $DEFAULT_OUTPUT = self
178
-
179
- @im = FXIRBInputMethod.new
180
- @irb = Thread.new {
181
- IRB.start_in_fxirb(@im)
182
- self.crash
183
- }
184
-
185
-
186
- @multiline = false
187
-
188
- @exit_proc = lambda {exit}
189
- end
190
-
191
- def on_exit(&block)
192
- @exit_proc = block
193
- end
194
-
195
- def crash
196
- instance_eval(&@exit_proc)
197
- end
198
-
199
- def onKeyRelease(sender, sel, event)
200
- case event.code
201
- when Fox::KEY_Return, Fox::KEY_KP_Enter
202
- newLineEntered
203
- end
204
- return 1
205
- end
206
-
207
- def onKeyPress(sender,sel,event)
208
- case event.code
209
- when Fox::KEY_Return, Fox::KEY_KP_Enter
210
- setCursorPos(getLength)
211
- super
212
- when Fox::KEY_Up,Fox::KEY_KP_Up
213
- str = extractText(@anchor, getCursorPos-@anchor)
214
- if str =~ /\n/
215
- @multiline = true
216
- super
217
- setCursorPos(@anchor+1) if getCursorPos < @anchor
218
- else
219
- history(:prev) unless @multiline
220
- end
221
- when Fox::KEY_Down,Fox::KEY_KP_Down
222
- str = extractText(getCursorPos, getLength - getCursorPos)
223
- if str =~ /\n/
224
- @multiline = true
225
- super
226
- else
227
- history(:next) unless @multiline
228
- end
229
- when Fox::KEY_Left,Fox::KEY_KP_Left
230
- if getCursorPos > @anchor
231
- super
232
- end
233
- when Fox::KEY_Delete,Fox::KEY_KP_Delete,Fox::KEY_BackSpace
234
- if getCursorPos > @anchor
235
- super
236
- end
237
- when Fox::KEY_Home, Fox::KEY_KP_Home
238
- setCursorPos(@anchor)
239
- when Fox::KEY_End, Fox::KEY_KP_End
240
- setCursorPos(getLength)
241
- when Fox::KEY_Page_Up, Fox::KEY_KP_Page_Up
242
- history(:prev)
243
- when Fox::KEY_Page_Down, Fox::KEY_KP_Page_Down
244
- history(:next)
245
- when Fox::KEY_bracketright
246
- #auto-dedent if the } or ] is on a line by itself
247
- if (emptyline? or (getline == "en")) and indented?
248
- dedent
249
- end
250
- super
251
- when Fox::KEY_u
252
- if (event.state & CONTROLMASK) != 0
253
- str = extractText(getCursorPos, getLength - getCursorPos)
254
- rmline
255
- appendText(str)
256
- setCursorPos(@anchor)
257
- end
258
- super
259
- when Fox::KEY_k
260
- if (event.state & CONTROLMASK) != 0
261
- str = extractText(@anchor, getCursorPos-@anchor)
262
- rmline
263
- appendText(str)
264
- setCursorPos(getLength)
265
- end
266
- super
267
- when Fox::KEY_d
268
- if (event.state & CONTROLMASK) != 0
269
- #Ctrl - D
270
- rmline
271
- appendText("exit")
272
- newLineEntered
273
- else
274
- # test for 'end' so we can dedent
275
- if (getline == "en") and indented?
276
- dedent
277
- end
278
- end
279
- super
280
- else
281
- super
282
- end
283
- end
284
-
285
- def dedent
286
- str = getline
287
- @anchor -= 2
288
- rmline
289
- appendText(str)
290
- setCursorPos(getLength)
291
- end
292
-
293
- def history(dir)
294
- str = (dir == :prev) ? @im.prevCmd.chomp : @im.nextCmd.chomp
295
- if str != ""
296
- removeText(@anchor, getLength-@anchor)
297
- write(str)
298
- end
299
- end
300
-
301
- def getline
302
- extractText(@anchor, getLength-@anchor)
303
- end
304
-
305
- def rmline
306
- str = getline
307
- removeText(@anchor, getLength-@anchor)
308
- str
309
- end
310
-
311
- def emptyline?
312
- getline == ""
313
- end
314
-
315
- def indented?
316
- extractText(@anchor-2, 2) == " "
317
- end
318
-
319
- def onLeftBtnPress(sender,sel,event)
320
- @store_anchor = @anchor
321
- setFocus
322
- super
323
- end
324
-
325
- def onLeftBtnRelease(sender,sel,event)
326
- super
327
- @anchor = @store_anchor
328
- setCursorPos(@anchor)
329
- setCursorPos(getLength)
330
- end
331
-
332
- def onMiddleBtnPress(sender,sel,event)
333
- pos=getPosAt(event.win_x,event.win_y)
334
- if pos >= @anchor
335
- super
336
- end
337
- end
338
-
339
- def newLineEntered
340
- if getLength-@anchor > 0
341
- processCommandLine(extractText(@anchor, getLength-@anchor))
342
- else
343
- # Probably wrong, but might work
344
- processCommandLine(extractText(@anchor, getLength))
345
- end
346
- end
347
-
348
- def processCommandLine(cmd)
349
- @multiline = false
350
- lines = cmd.split(/\n/)
351
- lines.each {|i|
352
- @input[1].puts i
353
- @inputAdded += 1
354
- }
355
- @im.print_prompt = false
356
- while (@inputAdded > 0) do
357
- @irb.run
358
- end
359
- @im.merge_last(lines.length)
360
- @im.print_prompt = true
361
- end
362
-
363
- def sendCommand(cmd)
364
- setCursorPos(getLength)
365
- makePositionVisible(getLength) unless isPosVisible(getLength)
366
- cmd += "\n"
367
- appendText(cmd)
368
- processCommandLine(cmd)
369
- end
370
-
371
- def write(obj)
372
- str = obj.to_s
373
- appendText(str)
374
- setCursorPos(getLength)
375
- makePositionVisible(getLength) unless isPosVisible(getLength)
376
- return str.length
377
- end
378
-
379
- def get_line
380
- @anchor = getLength
381
- if @inputAdded == 0
382
- Thread.stop
383
- end
384
- @inputAdded -= 1
385
- return @input[0].gets
386
- end
155
+ include Singleton
156
+ include Responder
157
+
158
+ attr_reader :input
159
+ attr_accessor :multiline
160
+
161
+ def FXIrb.init(p, tgt, sel, opts)
162
+ unless @__instance__
163
+ Thread.critical = true
164
+ begin
165
+ @__instance__ ||= new(p, tgt, sel, opts)
166
+ ensure
167
+ Thread.critical = false
168
+ end
169
+ end
170
+ return @__instance__
171
+ end
172
+
173
+ def initialize(p, tgt, sel, opts)
174
+ FXMAPFUNC(SEL_KEYRELEASE, 0, "onKeyRelease")
175
+ FXMAPFUNC(SEL_KEYPRESS, 0, "onKeyPress")
176
+ FXMAPFUNC(SEL_LEFTBUTTONPRESS,0,"onLeftBtnPress")
177
+ FXMAPFUNC(SEL_MIDDLEBUTTONPRESS,0,"onMiddleBtnPress")
178
+ FXMAPFUNC(SEL_LEFTBUTTONRELEASE,0,"onLeftBtnRelease")
179
+
180
+ super
181
+ setFont(FXFont.new(FXApp.instance, "lucida console", 9))
182
+ @anchor = 0
183
+ end
184
+
185
+ def create
186
+ super
187
+ setFocus
188
+ # IRB initialization
189
+ @inputAdded = 0
190
+ @input = IO.pipe
191
+ $DEFAULT_OUTPUT = self
192
+
193
+ @im = FXIRBInputMethod.new
194
+ @irb = Thread.new {
195
+ IRB.start_in_fxirb(@im)
196
+ self.crash
197
+ }
198
+
199
+ @multiline = false
200
+
201
+ @exit_proc = lambda {exit}
202
+ end
203
+
204
+ def on_exit(&block)
205
+ @exit_proc = block
206
+ end
207
+
208
+ private
209
+
210
+ def crash
211
+ instance_eval(&@exit_proc)
212
+ end
213
+
214
+ def onLeftBtnPress(sender,sel,event)
215
+ @store_anchor = @anchor
216
+ setFocus
217
+ super
218
+ end
219
+
220
+ def onLeftBtnRelease(sender,sel,event)
221
+ super
222
+ @anchor = @store_anchor
223
+ setCursorPos(getLength)
224
+ end
225
+
226
+ def onMiddleBtnPress(sender,sel,event)
227
+ pos = getPosAt(event.win_x,event.win_y)
228
+ if pos >= @anchor
229
+ super
230
+ end
231
+ end
232
+
233
+ def onKeyRelease(sender, sel, event)
234
+ case event.code
235
+ when KEY_Return, KEY_KP_Enter
236
+ new_line_entered unless empty_frame?
237
+ end
238
+ return 1
239
+ end
240
+
241
+ def onKeyPress(sender,sel,event)
242
+ case event.code
243
+ when KEY_Return, KEY_KP_Enter
244
+ move_to_end_of_frame
245
+ super unless empty_frame?
246
+
247
+ when KEY_Up,KEY_KP_Up
248
+ multiline = true if get_from_start_of_line =~ /\n/
249
+ multiline ? super : history(:prev)
250
+ move_to_start_of_line if invalid_pos?
251
+
252
+ when KEY_Down,KEY_KP_Down
253
+ multiline = true if get_to_end_of_line =~ /\n/
254
+ multiline ? super : history(:next)
255
+
256
+ when KEY_Left,KEY_KP_Left
257
+ super if can_move_left?
258
+
259
+ when KEY_Delete,KEY_KP_Delete,KEY_BackSpace
260
+ if event.shift? or event.ctrl?
261
+ event.code == KEY_BackSpace ?
262
+ delete_from_start_of_line :
263
+ delete_to_end_of_line
264
+ elsif can_move_left?
265
+ super
266
+ end
267
+
268
+ when KEY_Home, KEY_KP_Home
269
+ move_to_start_of_line
270
+
271
+ when KEY_End, KEY_KP_End
272
+ move_to_end_of_line
273
+
274
+ when KEY_Page_Up, KEY_KP_Page_Up
275
+ history(:prev)
276
+
277
+ when KEY_Page_Down, KEY_KP_Page_Down
278
+ history(:next)
279
+
280
+ when KEY_bracketright, KEY_braceright
281
+ #auto-auto_dedent if the } or ] is on a line by itself
282
+ auto_dedent if empty_frame? and indented?
283
+ super
284
+
285
+ when KEY_u
286
+ event.ctrl? ? delete_from_start_of_line : super
287
+
288
+ when KEY_k
289
+ event.ctrl? ? delete_to_end_of_line : super
290
+
291
+ when KEY_d
292
+ if event.ctrl? and empty_frame?
293
+ quit_irb
294
+ else
295
+ # test for 'end' so we can auto_dedent
296
+ if (get_frame == "en") and indented?
297
+ auto_dedent
298
+ end
299
+ super
300
+ end
301
+
302
+ else
303
+ super
304
+ end
305
+ end
306
+
307
+ def auto_dedent
308
+ str = get_frame
309
+ clear_frame
310
+ @anchor -= 2
311
+ appendText(str)
312
+ setCursorPos(getLength)
313
+ end
314
+
315
+ def history(dir)
316
+ str = (dir == :prev) ? @im.prev_cmd.chomp : @im.next_cmd.chomp
317
+ if str != ""
318
+ clear_frame
319
+ write(str)
320
+ end
321
+ end
322
+
323
+ def quit_irb
324
+ clear_frame
325
+ appendText("exit")
326
+ new_line_entered
327
+ end
328
+
329
+ def get_frame
330
+ extractText(@anchor, getLength-@anchor)
331
+ end
332
+
333
+ def invalid_pos?
334
+ getCursorPos < @anchor
335
+ end
336
+
337
+ def can_move_left?
338
+ getCursorPos > @anchor
339
+ end
340
+
341
+ def move_to_start_of_frame
342
+ setCursorPos(@anchor)
343
+ end
344
+
345
+ def move_to_end_of_frame
346
+ setCursorPos(getLength)
347
+ end
348
+
349
+ def move_to_start_of_line
350
+ if multiline
351
+ cur = getCursorPos
352
+ pos = lineStart(cur)
353
+ pos = @anchor if pos < @anchor
354
+ else
355
+ pos = @anchor
356
+ end
357
+ setCursorPos(pos)
358
+ end
359
+
360
+ def move_to_end_of_line
361
+ if multiline
362
+ cur = getCursorPos
363
+ pos = lineEnd(cur)
364
+ else
365
+ pos = getLength
366
+ end
367
+ setCursorPos(pos)
368
+ end
369
+
370
+ def get_from_start_of_line
371
+ extractText(@anchor, getCursorPos-@anchor)
372
+ end
373
+
374
+ def get_to_end_of_line
375
+ extractText(getCursorPos, getLength - getCursorPos)
376
+ end
377
+
378
+ def clear_frame
379
+ removeText(@anchor, getLength-@anchor)
380
+ end
381
+
382
+ def delete_from_start_of_line
383
+ str = get_to_end_of_line
384
+ clear_frame
385
+ appendText(str)
386
+ setCursorPos(@anchor)
387
+ end
388
+
389
+ def delete_to_end_of_line
390
+ str = get_from_start_of_line
391
+ clear_frame
392
+ appendText(str)
393
+ setCursorPos(getLength)
394
+ end
395
+
396
+ def empty_frame?
397
+ get_frame == ""
398
+ end
399
+
400
+ def indented?
401
+ extractText(@anchor-2, 2) == " "
402
+ end
403
+
404
+ def new_line_entered
405
+ process_commandline(extractText(@anchor, getLength-@anchor))
406
+ end
407
+
408
+ def process_commandline(cmd)
409
+ multiline = false
410
+ lines = cmd.split(/\n/)
411
+ lines.each {|i|
412
+ @input[1].puts i
413
+ @inputAdded += 1
414
+ }
415
+
416
+ while (@inputAdded > 0) do
417
+ @irb.run
418
+ end
419
+ end
420
+
421
+ public
422
+
423
+ def send_command(cmd)
424
+ setCursorPos(getLength)
425
+ makePositionVisible(getLength) unless isPosVisible(getLength)
426
+ cmd += "\n"
427
+ appendText(cmd)
428
+ process_commandline(cmd)
429
+ end
430
+
431
+ def write(obj)
432
+ str = obj.to_s
433
+ appendText(str)
434
+ setCursorPos(getLength)
435
+ makePositionVisible(getLength) unless isPosVisible(getLength)
436
+ return str.length
437
+ end
438
+
439
+ def get_line
440
+ @anchor = getLength
441
+ if @inputAdded == 0
442
+ Thread.stop
443
+ end
444
+ @inputAdded -= 1
445
+ retval = @input[0].gets
446
+ # don't print every prompt for multiline input
447
+ @im.print_prompt = (@inputAdded == 0)
448
+ return retval
449
+ end
387
450
  end
388
451
 
389
452
  # Stand alone run
390
453
  if __FILE__ == $0
391
- application = FXApp.new("FXIrb", "ruby")
392
- application.threadsEnabled = true
393
- Thread.abort_on_exception = true
394
- application.init(ARGV)
395
- window = FXMainWindow.new(application, "FXIrb", nil, nil, DECOR_ALL, 0, 0, 580, 500)
396
- fxirb = FXIrb.init(window, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP|TEXT_SHOWACTIVE)
397
- application.create
398
- window.show(PLACEMENT_SCREEN)
399
- fxirb.on_exit {exit}
400
- application.run
454
+ application = FXApp.new("FXIrb", "ruby")
455
+ application.threadsEnabled = true
456
+ Thread.abort_on_exception = true
457
+ window = FXMainWindow.new(application, "FXIrb",
458
+ nil, nil, DECOR_ALL, 0, 0, 580, 500)
459
+ fxirb = FXIrb.init(window, nil, 0,
460
+ LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP|TEXT_SHOWACTIVE)
461
+ application.create
462
+ window.show(PLACEMENT_SCREEN)
463
+ fxirb.on_exit {exit}
464
+ application.run
401
465
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: fxri
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.3.5
7
- date: 2006-12-14 00:00:00 +01:00
6
+ version: 0.3.6
7
+ date: 2006-12-18 00:00:00 +01:00
8
8
  summary: Graphical interface to the RI documentation, with search engine.
9
9
  require_paths:
10
10
  - lib
@@ -32,6 +32,7 @@ files:
32
32
  - lib
33
33
  - fxri
34
34
  - fxri.gemspec
35
+ - fxri-0.3.6.tar.gz
35
36
  - fxri.rb
36
37
  - lib/FoxDisplayer.rb
37
38
  - lib/icons