[fxruby-users] method call question

Rovshan Baghirov rovshanb at gmail.com
Wed Oct 29 01:28:58 EDT 2008


I'm also relatively new, but I understand it as follows:
All the widgets in the hierarchy define (or inherit) the create method that
is used to setup widget. When you call the create method on FXApp object it
recursively calls this method on all the child widgets and because of this
all the widgets have a chance to execute their initialization/setup logic.

On Mon, Oct 27, 2008 at 9:53 PM, chen li <chen_li3 at yahoo.com> wrote:

> Hi all,
>
> I am new to FxRuby. I am learning it by studying some code samples. Now I
> am confused about a method call in the following script:  which class
> defines method  create, class FXApp or HelloWindow/FXMainWindow? Based on
> the code, class HelloWindow/FXMainWindow defines method 'create'. If this is
> true , the object from this class can response to the message. But here why
> does an object created by a different class FXApp response to method
> 'create'?
>
> Thanks,
>
> Li
>
>
>
>
>
>
> 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
>
>
>
> _______________________________________________
> fxruby-users mailing list
> fxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/fxruby-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20081029/620d7780/attachment.html>


More information about the fxruby-users mailing list