[Fxruby-users] Triggering events before connecting to them
Status: Inactive
Brought to you by:
lyle
|
From: Daniel S. <da...@pr...> - 2004-03-11 01:58:26
|
I've been getting a segmentation fault from my code upon exit, and have
managed to track it down with the following test code.
When I switch the order of the connect and addItemLast lines, the
segmentation fault goes away. Is it a rule that a connect cannot be
issued after the event has been triggered? Will it fail if ANY connect
is called after ANY event has been handled by the object?
----
require 'fox'
include Fox
class TestWindow < FXMainWindow
=20 def initialize(parent)
=20 super(parent, "test", nil, nil, DECOR_ALL, 0, 0, 400, 300)
=20 @treeList =3D FXTreeList.new(self, 0)
=20 @treeList.addItemLast(nil, FXTreeItem.new("hello"), true)
=20 @treeList.connect(SEL_INSERTED) { |a,b,item| puts "hello"}
=20 end
=20 def create
=20 super
=20 show(PLACEMENT_SCREEN)
=20 end
end
=20 =20
if __FILE__ =3D=3D $0
=20 FXApp.new("test7", "test") do |theApp|
=20 TestWindow.new(theApp)
=20 theApp.create
=20 theApp.run
=20 end
end
#########################################################################=
############
This email has been scanned by MailMarshal, an email content filter.
#########################################################################=
############
|