Re: STKlos and OOP

From: Erick Gallesio <eg_at_kaolin.unice.fr>
Date: Tue, 17 Jan 1995 12:27:02 +0000

> I have a modification that I want to make to the <Button> class --
> changing it so that when the mouse is moved over a button, a recessed
> frame appears, rather than the button becoming highlighted.
>
> But then, I would like this new button to be used in the Filebox
> widget.
>
> It seems to me like the only way to do this is to modify the code of
> Filebox so that it calls my new <RButton> (recessed-button) class
> rather than <Button>.
>
> I guess I can do this by using "sed" to edit the file automatically,
> but it is a little distressing that I cannot do anything more
> automatic to resolve this problem.

A way to do should be to define a new class, say <RFile-Box> which inherits
from
<File-box>, such as:

(define-class <RFile-box> (<File-box>)
  ())

Now, to change the behaviour of Rfile-boxes, you only have to define a method
 initialize-composite-widget for <Rfile-box>. Something like:
  (define-method initialize-composite-widget
                  ((self <RFile-box>) initargs frame)
       ....
        body of the initialize-composite-widget for <File-box>
        where <Button> is replaced by <RButton>)

Unlucky, this function is rather long. But it should work.


        



                -- Erick
Received on Tue Jan 17 1995 - 12:27:03 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST