[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

creating a new gfxobj



The (hopefully) last question for this evening:

I want to define a new gfxobj on top of {editor-view}, in order to
get some additional slots for my own purposes. I think using the
inheritance feature of structures is the right way to do so:

(defabbrev scheme-editor {editor-view}:scheme-editor)

(defstruct {scheme-editor}
  scheme-name
  library
  host-formalism)

Creating an instance of the new type also works fine:

? (new '{scheme-editor})
= #<scheme-editor>
? ;;;Button execution:
#<scheme-editor> is a {editor-view}:scheme-editor
  x: 0
  y: 0
  w: 1
  h: 1
  window: ()
  image: #<view>
  properties: ()
  head-banner: ()
  hline: ()
  button-column: ()
  vline: ()
  scroll-object: ()
  expose-mode: ()
  scheme-name: ()
  library: ()
  host-formalism: ()
= ()

Now I want to write a `create' method that just does the same
default initialization as `{editor-view}:create' for the {editor-view}
part, and may be some other initialization for the new slots. 

How can I reuse the {editor-view} initialization for my new object
type?

	Guido


P.S.: "scheme" has nothing to do with the Lisp-like language with the
      same name.