[Apollo-talk:35] Re: Late assignment of Delphi event handlers

Back to archive index

repeater repea****@lucen*****
Mon Oct 28 23:54:41 JST 2002


<..>

> --
> #! ruby -Ks
> require "phi"
>
> class MyPanel < Phi::Panel
>   def on_click
>     p "MyPanel#on_click"
>   end
>   def initialize( *args )
>     #super( *args )  #<= uncomment this to make test work. why ?
>   end
> end
>
> form = Phi::Form.new
> MyPanel.new form
>
> form.show
> Phi.mainloop
> --
>
> How to succeed is under examination even if there is no continuation of
> "super".
>

if i gather correctly, the new behaviour is intended for performance
reasons, and that is fine.
but could you supply a solution to make the following work ?

--
require 'phi'
class MyPanel < Phi::Panel
  def on_click
    p "MyPanel#on_click"
  end
  def initialize( *args )
    super( *args )		#added
  end
end

class SuperMyPanel < MyPanel
  def initialize( *args )
    super( *args )
  end
end

form = Phi::Form.new
SuperMyPanel.new form
form.show
Phi.mainloop
--

SuperMyPanel should inherit MyPanel's events

thanks

regards
re~




More information about the Apollo-talk mailing list
Back to archive index