Donald,
> if i evaluate this code:
>
> x := OrderedCollection new.
> 1 to: 10 do: [:e | x add: e printString].
> ListPresenter showOn: x
>
> i get a listPresenter with 10 lines of numbers. however, the
> title/caption says 'a ListPresenter'. how can i change that?
>
> i just want a listpresenter with -my- title in it. i don't want to gin
> up a whole new view for this simple task.
ListPresenters use list/combo box controls that don't have a caption.
#showOn: is creating a shell to wrap the list box to make it easy to
move/resize/close it, and probably to prevent it from being gc'd. If that's
what you want, and simply want to change its caption, then you can send (to
the list presenter)
topShell caption:'Try this'
If you want to caption a list presenter that is a sub-presenter of a
composite, then it's a little more trouble because you have to provide a
peer control to hold the caption. If you have only a few of them, you can
use either group boxes or static text controls to hold the captions. I have
one app that uses lots of captioned lists and defines a composite presenter
for the purpose; other view resources embed them as reference views.
More recently, I've created what I think (well, hope anyway<g>) is a
composite presenter that works as a value presenter - the tricky part was to
identify the various ways that the models and the presenters can initiate
changes. It sounds like D5 will make this kind of thing a lot easier to do
because OA has moved the composite behavior up to Presenter, allowing any
presenter to be a composite.
Have a good one,
Bill
--
Wilhelm K. Schwab, Ph.D.
[hidden email]