first sorry for my poor english...I've a doubt..I'm reading the FXRuby for the pragmatic programmer..and I saw this code
require 'fox16'
include Fox
class HelloWindow < FXMainWindow
def initialize(app)
super(app, "Hello, World!" , :width => 200, :height => 100)
end
def create
super
show(PLACEMENT_SCREEN)
end
end
app = FXApp.new
HelloWindow.new(app)
app.create
app.run
It's a very basic example...actually It's he first example..but I'm so noob than I don't understand it:
app is a FXAPP object.. now I create a HelloWindow object and pass my FXApp object named "app"
so far so good
but now...in the book write app.create I'm calling the "create" method inside FXApp class...or not?..
why when I call app.create..ruby call the create method inside HelloWindow?..app is a very different object than HelloWindow class and I could can call an anscestor method (like when I use super) but not at the inverse way...
why they don't call it something like this
helloobject=HelloWindow.new(app)
helloobject.create
this way I calling the create method inside HelloWindows class..and it is descendent from FXMainWindows
I hope than you can understand (sorry for my bad english) and can help me
thanks so much