Re: Problem creating new object

Juergen Schoenwaelder (schoenw@cs.utwente.nl)
Thu, 6 Jun 1996 18:38:12 +0200

David Kerr <dk@broadcom.ie> wrote:

> I'm trying to create a new object within TKINED (ie. in addition to the
> NODE and GROUP etc. objects).

> I have defined an object AUTHORITY which I want to use in an application
> I'm developing using TKINED as a front end.

[...]

> When I try to create an instance, using
> set authority [AUTHORITY create],
> then I get the crosshair cursor over the canvas as expected, but when I
> click on it to place the authority object on the canvas, nothing comes
> up. As far as I can tell, the authority object *is* created, because
> the the value of $authority is, as expected authority0.

Your changes are good to implement the model (the C code that keeps
track of what kind of objects exist etc.) Note, you will also have to
look at the table at the end of objects.c which defines which methods
can be applied to which object.

To actually see the object, you also have to implement the view (yes,
this is the good old model-view-controller idea from smalltalk). The
view defines how an object is shown on the GUI. There is a Tcl file
Object.tcl which contains Tcl procedures that are called whenever
changes to the model need to update the view. You have to define a
couple of these procedures for your new AUTHORITY object. Hope this
hint helps to solve the puzzle,
Juergen