[Q] adding tiles to Plugin?

Scott Wallace scott
Fri Apr 18 14:54:09 PDT 2003


Hi, Anindita,

The Plug-in image and the mainstream image have deviated considerably 
by now so there are a number of things that behave quite differently 
between them.

In this case, after taking all the (correct) steps that you describe, 
you need to evaluate "Vocabulary initialize", and then things should 
straighten out, and you should see your newly-added items in viewers. 
In the mainstream image, whenever an #additionsToViewerCategories 
method is recompiled that reinitialization is invoked automatically, 
but not in the plugin.

Incidentally, all "non-universal" categories occur "below the line" 
-- this is not a bug but rather the way it's designed to be.  The 
items and the order of the universal "above-the-line" category list 
are hard-coded; if you want to modify that, edit method 
Morph.categoriesForViewer -- insert any new categories that you want 
to appear "above-the-line" *before* #miscellaneous in the list 
defined there.

Cheers,

  -- Scott

At 7:58 PM -0400 5/15/02, Anindita wrote:
>Hi,
>
>I was just trying to add tiles and categories to the Plugin and the
>solution that worked for Squeak 3.x for some reason doesn't seem to be
>working. . .
>
>Basically, I tried the original solution-- wrote a method under
>Player>>scripts-standard and added an entry into Morph class>>
>additionsToViewerCategories, but no new tiles appeared.  It was a command,
>not a slot tile, so I'm pretty sure I wrote everything in the right
>places.  Then to debug this (in case my method was buggy), I tried to just
>move some tiles around, so something that's normally under miscellaneous
>would be under basic-- copied and pasted between
>additionsToViewerCategoriesMiscellaneous and Basic, but nothing moved in
>the viewer.  I think I'm missing a step somewhere.  Finally, I tried to
>add a new viewer category by writing an additionsToViewerCategoriesX and
>adding it into additionsToViewerCategories, but when it appeared, it
>wasn't part of the main group of categories.  It was separated by a line,
>like the text category.  And again, none of the new tiles appeared.  What
>are the other classes I need to modify in order to add tiles and modify
>categories in the Plugin?
>
>Thanks!
>
>Anindita
>
>On Sun, 14 Apr 2002, Ted Kaehler wrote:
>
>>  Anindita,
>>	See the method  TextMorph class>>additionsToViewerCategories.
>>  That is where you need to add a line for each new tile you want.
>>  Make a duplicate of the inner array below, and edit it.
>>
>>  #((basic "The category name in the viewer" (
>>  (slot  characters "name on the tile"
>>     'The characters in my contents'   "balloon help string"
>>     String    "Type that it returns"
>>     readWrite  "both setting and getting"
>>     Player  "put into viewers on objects of this class"
>>     getCharacters   "getter selector  (your method name goes here)"
>>     Player   "put into viewers on objects of this class"
>>     setCharacters:    "setter selector  (your method name goes here)")
>  > "another slot" )))
>  >
>  > --Ted.




More information about the Squeakland mailing list