what's wromg with this code?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

what's wromg with this code?

jWarrior
| x |
x := Smalltalk at: #DocumentShell.
y := x allSubclasses.
ChoicePrompter choices: y.

the prompter shows
'Workspace'
'TextDocument'

but the subclasses of DocumentShell are
SmalltalkWorkspaceDocument
and
TextDocument.

so where did the choicePrompter get the different names?

Donald


Reply | Threaded
Open this post in threaded view
|

Re: what's wromg with this code?

Ian Bartholomew
Donald,

> so where did the choicePrompter get the different names?

Confusing isn't it.<g> Some development classes provide a class side
#displayOn: method that override the normal #display behaviour of answering
the name of a class. They appeared with D3 so I guess the only reason for
them is to make the labels that appear in the main folders and options list
more user friendly.

In your example you will have to convert to a String yourself before opening
the choice prompter

x := Smalltalk at: #DocumentShell.
y := x allSubclasses collect: [:each | each name].
ChoicePrompter choices: y.

Ian


Reply | Threaded
Open this post in threaded view
|

Re: what's wromg with this code?

jWarrior
"Ian Bartholomew" <[hidden email]> wrote in message
news:%E4y6.75608$[hidden email]...
> Donald,
>
> > so where did the choicePrompter get the different names?
>
> Confusing isn't it.<g> Some development classes provide a class side
> #displayOn: method that override the normal #display behaviour of
answering
> the name of a class. They appeared with D3 so I guess the only reason for
> them is to make the labels that appear in the main folders and options
list
> more user friendly.

i thought it was something like that; i went looking for implementors of
-displayString- and crapped out.

thanks.
>
> In your example you will have to convert to a String yourself before
opening

> the choice prompter
>
> x := Smalltalk at: #DocumentShell.
> y := x allSubclasses collect: [:each | each name].
> ChoicePrompter choices: y.
>
> Ian
>
>
>
>