Why does this work:
require ‘fox’
module Test2
include Fox
class Foo
class Bar < FXMainWindow
end
end
end
and not this:
module Base
class Y
end
end
module Test
include Base
class Foo
class Bar < Y # undefined superclass ‘Y’ (TypeError)
end
end
end
Is Fox doing something strange to allow inner scoped classes to see
constants when its included with outer scoped modules/classes?
-rich
···
Rich Kilmer, InfoEther LLC
trap(“SIGINT”) { raise [104, 101, 108, 108].pack(“cccc”) }
ts1
(ts)
2
Why does this work:
require 'fox'
Which version of fox
pigeon% ruby
require 'fox'
module Test2
include Fox
class Foo
class Bar < FXMainWindow
end
end
end
^D
-:6: undefined superclass `FXMainWindow' (TypeError)
pigeon%
Guy Decoux
I think it is 1.0.13
I also think the behavior changed in 14 and 15
-rich
···
-----Original Message-----
From: ts [mailto:decoux@moulon.inra.fr]
Sent: Wednesday, November 13, 2002 12:17 PM
To: ruby-talk ML
Cc: ruby-talk@ruby-lang.org
Subject: Re: FW: Fox include question
Why does this work:
require ‘fox’
Which version of fox
pigeon% ruby
require ‘fox’
module Test2
include Fox
class Foo
class Bar < FXMainWindow
end
end
end
^D
-:6: undefined superclass `FXMainWindow’ (TypeError)
pigeon%
Guy Decoux
ts1
(ts)
4
I think it is 1.0.13
pigeon% head -6 lib/fox/responder2.rb
require 'fox'
require 'fox/responder'
include Fox
# Instances of this class act as the message target for any widgets who
pigeon%
pigeon% tail -6 ext/fox/FXRuby.cpp
rb_require("fox/iterators");
rb_require("fox/keys");
rb_require("fox/overloads");
rb_require("fox/aliases");
rb_require("fox/responder2");
}
pigeon%
Guy Decoux