Another ImagePresenter question

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

Another ImagePresenter question

John Clonts
I tried to do:

     ImagePresenter showOn: (Icon fromId: 'Model.ico')

I got a DNU Icon>>asSharedCopy.
Taking a cue from OLEPicture, I implemented

     Icon>>asSharedCopy
         ^ self

Now it opens successfully, but no image displays?


Thanks,
John

--
[:o|]


Reply | Threaded
Open this post in threaded view
|

Re: Another ImagePresenter question

Ian Bartholomew
John,

"John Clonts" <[hidden email]> wrote in message
news:[hidden email]...
> I tried to do:
>
>      ImagePresenter showOn: (Icon fromId: 'Model.ico')

The "Default view" class for an ImagePresenter is StaticBitmap which is the
correct class to display bitmap files. To display an icon you need to use
the StaticIcon class. ImagePresenter already has this as an alternative
(i.e. non default) view.  To open the ImagePresenter with one of it's
alternative views you have to specify the view's name. So -

ImagePresenter show: 'Static icon' on: (Icon fromId: 'Model.ico')

If you locate ImagePresenter in the ResourceBrowser you will see that it can
be opened with three view classes -

"Basic image" uses a StaticImage
"Default view" uses a StaticBitmap
"Static icon" uses a StaticIcon

Ian


Reply | Threaded
Open this post in threaded view
|

Re: Another ImagePresenter question

John Clonts
Excellent, thanks!


Ian Bartholomew wrote:

>
> John,
>
> "John Clonts" <[hidden email]> wrote in message
> news:[hidden email]...
> > I tried to do:
> >
> >      ImagePresenter showOn: (Icon fromId: 'Model.ico')
>
> The "Default view" class for an ImagePresenter is StaticBitmap which is the
> correct class to display bitmap files. To display an icon you need to use
> the StaticIcon class. ImagePresenter already has this as an alternative
> (i.e. non default) view.  To open the ImagePresenter with one of it's
> alternative views you have to specify the view's name. So -
>
> ImagePresenter show: 'Static icon' on: (Icon fromId: 'Model.ico')
>
> If you locate ImagePresenter in the ResourceBrowser you will see that it can
> be opened with three view classes -
>
> "Basic image" uses a StaticImage
> "Default view" uses a StaticBitmap
> "Static icon" uses a StaticIcon
>
> Ian