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

Back to archive index

Take_tk ggb03****@nifty*****
Wed Oct 30 23:53:11 JST 2002


Hi!
This is take_tk

[Apollo-talk:35] Re: Late assignment of Delphi event handlers
"repeater" <repea****@lucen*****> wrote:

  Short solution is add "self.on_click = nil" in MyPanel#initialize
which teaches to apollo that on_click event is defined in this class.

: --
: require 'phi'
: class MyPanel < Phi::Panel
:   def on_click
:     p "MyPanel#on_click"
:   end
:   def initialize( *args )
:     super( *args )		#added
      self.on_click = nil #++ to teach on_click is defined to apollo
:   end
: end
: 
: class SuperMyPanel < MyPanel
:   def initialize( *args )
:     super( *args )
:   end
: end
: 
: form = Phi::Form.new
: SuperMyPanel.new form
: form.show
: Phi.mainloop
: --

----
  
  I'm now discussing with Mr. moriq how to realise the inheritance system
of modified event handlers in apollo.

  Basically to say, event handlers are not member of classes in Delphi.
ie. TForm1.Button1Click is not member of TButton.  So, inheritance
system of event handler is not exist.

  But, in Delphi style,  such modification of event handling is realized
by overriding the "event handler caller" function.  Such as
TControl.Click.

  Under the circumstances, how to realize it in Apollo..

take_tk = kumagai hidetake



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