SampleCode-ImageViewer

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

SampleCode-ImageViewer

Wade Scholine
This is a question about the sample that was posted here last October, at

  http://lists.squeakfoundation.org/pipermail/beginners/2006-October/001238.html

I am not able to make it work. I was able to file in the code and start an instance from a workspace with 'SampleImageViewerMorph new.' I click on the 'dir' button in the upper left hand corner of the resulting Image Viewer Morph window, and that summons a directory browser UI that I can navigate to a directory that has jpgs in it. ( e.g., "C:\Documents and Settings\wades\My Documents\My Pictures\rocks5"). When I hit the 'accept' button in the directory browser, it goes away and the path to the directory I picked goes into the location bar or whatever you'd call it in the Image Viewer Morph window. A balloon comes up, saying 'When I'm populated, you can click on a file to load it.' Nothing happens.

If I try hitting the little '>' button by the location bar on the Image View Morph window, I get an "error out of bounds." If I debug that, I see that the error happens in SampleImageLoader>>loadImage: it appears that the SampleImageLoader's collection members are empty.

I tried making an instance of SampleImageLoader from the workspace, thinking I could manually initialize it and load the image list.

a _ SampleImageLoader new.
a inspect.
(open a transcript)
a loadImagesBelow: 'c:\stuff\rpics'
The transcript shows "Entering DosFileDirectory on 'c:\stuff\rpics'" and then nothing else happens.

Should any of this work?

I am using:

Squeak3.9
latest update: #7067
Current Change Set: Unnamed1
 OK


On WinXP SP2.

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: SampleCode-ImageViewer

Edgar De Cleene

On 23/06/2007, at 13:51, Wade Scholine wrote:

This is a question about the sample that was posted here last October, at

  http://lists.squeakfoundation.org/pipermail/beginners/2006-October/001238.html

I am not able to make it work. I was able to file in the code and start an instance from a workspace with 'SampleImageViewerMorph new.' I click on the 'dir' button in the upper left hand corner of the resulting Image Viewer Morph window, and that summons a directory browser UI that I can navigate to a directory that has jpgs in it. ( e.g., "C:\Documents and Settings\wades\My Documents\My Pictures\rocks5"). When I hit the 'accept' button in the directory browser, it goes away and the path to the directory I picked goes into the location bar or whatever you'd call it in the Image Viewer Morph window. A balloon comes up, saying 'When I'm populated, you can click on a file to load it.' Nothing happens.

If I try hitting the little '>' button by the location bar on the Image View Morph window, I get an "error out of bounds." If I debug that, I see that the error happens in SampleImageLoader>>loadImage: it appears that the SampleImageLoader's collection members are empty.

I tried making an instance of SampleImageLoader from the workspace, thinking I could manually initialize it and load the image list.

a _ SampleImageLoader new.
a inspect.
(open a transcript)
a loadImagesBelow: 'c:\stuff\rpics'
The transcript shows "Entering DosFileDirectory on 'c:\stuff\rpics'" and then nothing else happens.

Should any of this work?

I am using:

Squeak3.9
latest update: #7067
Current Change Set: Unnamed1
 OK


On WinXP SP2.
_______________________________________________
Beginners mailing list

I  file the code and could see is working.

SampleImageViewerMorph new on a Workspace
Or select the class in the Sustem Browser and alt - click for "more" and then "sample instace"

Could be enhanced to read all the picts formats and not only jpg.

Hints:
Go to Utilities >> graphicsFileSuffixes.
Investigate "senders"
Have fun !

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: SampleCode-ImageViewer

Wade Scholine
In reply to this post by Wade Scholine

------------------------------

Message: 7
Date: Sat, 23 Jun 2007 15:19:43 -0300
From: Edgar J De Cleene <[hidden email]>
Subject: Re: [Newbies] SampleCode-ImageViewer
To: "A friendly place to get answers to even the most basic questions
        about   Squeak." <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="us-ascii"


On 23/06/2007, at 13:51, Wade Scholine wrote:

> This is a question about the sample that was posted here last
> October, at
>

>   http://lists.squeakfoundation.org/pipermail/beginners/2006-
> October/001238.html
>
> I am not able to make it work. I was able to file in the code and
> start an instance from a workspace with 'SampleImageViewerMorph
> new.' I click on the 'dir' button in the upper left hand corner of
> the resulting Image Viewer Morph window, and that summons a
> directory browser UI that I can navigate to a directory that has
> jpgs in it. ( e.g., "C:\Documents and Settings\wades\My Documents
> \My Pictures\rocks5"). When I hit the 'accept' button in the
> directory browser, it goes away and the path to the directory I
> picked goes into the location bar or whatever you'd call it in the
> Image Viewer Morph window. A balloon comes up, saying 'When I'm
> populated, you can click on a file to load it.' Nothing happens.
>
> If I try hitting the little '>' button by the location bar on the
> Image View Morph window, I get an "error out of bounds." If I debug
> that, I see that the error happens in SampleImageLoader>>loadImage:
> it appears that the SampleImageLoader's collection members are empty.
>
> I tried making an instance of SampleImageLoader from the workspace,
> thinking I could manually initialize it and load the image list.
>
> a _ SampleImageLoader new.
> a inspect.
> (open a transcript)
> a loadImagesBelow: 'c:\stuff\rpics'
> The transcript shows "Entering DosFileDirectory on 'c:\stuff
> \rpics'" and then nothing else happens.
>
> Should any of this work?
>
> I am using:
>
> Squeak3.9
> latest update: #7067
> Current Change Set: Unnamed1
>  OK
>
>
> On WinXP SP2.
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

I  file the code and could see is working.

SampleImageViewerMorph new on a Workspace
Or select the class in the Sustem Browser and alt - click for "more"
and then "sample instace"

Could be enhanced to read all the picts formats and not only jpg.

Hints:
Go to Utilities >> graphicsFileSuffixes.
Investigate "senders"
Have fun !

I got SampleImageLoader's loadImagesBelow working: the problem was that it was trying to match files ending with .jpg or .jpeg, but my files had .JPG.

I still am having problems with the package though. It appears that the SampleImageLoader is not getting hooked up with the Model correctly.

Are you using 3.9?


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: SampleCode-ImageViewer

Edgar J. De Cleene



El 6/25/07 11:01 AM, "Wade Scholine" <[hidden email]> escribió:

> I got SampleImageLoader's loadImagesBelow working: the problem was that it was
> trying to match files ending with .jpg or .jpeg, but my files had .JPG.

Change the method for  test "JPG"
>
> I still am having problems with the package though. It appears that the
> SampleImageLoader is not getting hooked up with the Model correctly.
>
> Are you using 3.9?

I try on 3.10


Maybe you are right and SampleImageLoader is not getting hooked up with the
Model correctly.

If I try to do same, sure I do very different.
I attach some I do to request some Squeaker .
You could drag and drop on your 3.9
Then you could do:

SelectedPictures new slideShow

Improve this demo to your taste !

Edgar


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

PobrePoint.1.cs (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SampleCode-ImageViewer

Edgar J. De Cleene
In reply to this post by Wade Scholine
Also you could do:

SelectedPictures new showThumbnails

Edgar


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

PobrePoint.1.cs (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SampleCode-ImageViewer

Michael Davies-2
In reply to this post by Wade Scholine
(re-sent as my original didn't get through)

Hi Wade, Edgar,

I wrote that sample application, so I'm sorry you had problems getting
it working. As you worked out, it's fussy about the (number, and case
of) file extensions it recognises. I've fixed those issues and uploaded a
new version, as I'm sure that this will have caused other people
problems too.

Edgar - you mentioned that you'd have done things differently. I
started writing a more complex application, but realised that image
handling on my Mac wasn't very fast, so I stripped the application
back down, but thought it was useful to document what I'd produced as
I had a lot of trouble getting to a core SystemWindow-based
application. Are you saying that (i) using SystemWindow is not the
approach you'd have taken, or (ii) that's not how you'd have implemented a
SystemWindow-based application? (or both!).

I'd appreciate any comments you have, and may add them to the
application as warnings to anyone who picks it up in future.

Thanks,
Michael
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: SampleCode-ImageViewer

Edgar J. De Cleene



El 6/27/07 12:35 PM, "Michael Davies" <[hidden email]> escribió:
>  you mentioned that you'd have done things differently.
I send a attached of some old thing I do for showing how a slide show of
picts could be made to some Squeaker.

Don't take me as last word !
I sure many could do same better.

> but realised that image
> handling on my Mac wasn't very fast,
On which Mac ? How many picts ? I curious

> I had a lot of trouble getting to a core SystemWindow-based
> application. Are you saying that (i) using SystemWindow is not the
> approach you'd have taken, or (ii) that's not how you'd have implemented a
> SystemWindow-based application? (or both!).

I do a PasteUpMorph container of all picts.
But could be done as SystemWindow and using layout.
When I have time I try to redo the demo , this time SystemWindow based and
recursive.
I have one folder with 1117 picts from my cousins trip to Italy...
Clear to manage this kind my PasteUpMorph approach is not good.
Maybe a modification of BookMorph (as MiStack ) with cards holding say 50
picts each and flipping the cards ...

Keep Squeaking and having fun !

Edgar


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: SampleCode-ImageViewer

Wade Scholine
In reply to this post by Wade Scholine
Date: Wed, 27 Jun 2007 16:35:27 +0100
From: "Michael Davies" <[hidden email]>
Subject: Re: [Newbies] SampleCode-ImageViewer
To: "A friendly place to get answers to even the most basic questions
       about   Squeak." <[hidden email]>
Message-ID:
       <[hidden email]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

(re-sent as my original didn't get through)

Hi Wade, Edgar,

I wrote that sample application, so I'm sorry you had problems getting
it working. As you worked out, it's fussy about the (number, and case
of) file extensions it recognises. I've fixed those issues and uploaded a
new version, as I'm sure that this will have caused other people
problems too.

Edgar - you mentioned that you'd have done things differently. I
started writing a more complex application, but realised that image
handling on my Mac wasn't very fast, so I stripped the application
back down, but thought it was useful to document what I'd produced as
I had a lot of trouble getting to a core SystemWindow-based
application. Are you saying that (i) using SystemWindow is not the
approach you'd have taken, or (ii) that's not how you'd have implemented a
SystemWindow-based application? (or both!).

I'd appreciate any comments you have, and may add them to the
application as warnings to anyone who picks it up in future.

I found that it worked OK after I arranged for the file extension check to look of #JPG and #JPEG.

The other problems I was having with it were because I was not hitting enter on the PluggableTextMorph before clicking on the goBack and goNext buttons. I'm not sure why I didn't notice the comments and balloon help about pressing enter in the PluggableTextMorph.

I haven't had time to look at it more deeply since. I would have thought it would be nice if the goNext/Back buttons cause the directory field to accept if it hadn't already, I think this would be more in keeping with the behavior of modern GUIs. I didn't see an obvious way to make that happen.

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: SampleCode-ImageViewer

Michael Davies-2
In reply to this post by Edgar J. De Cleene
> I send a attached of some old thing I do for showing how a slide show of
> picts could be made to some Squeaker.
>
> Don't take me as last word !
> I sure many could do same better.
>
Thanks, it's always good to see how someone else addresses the same problem.

> > but realised that image
> > handling on my Mac wasn't very fast,
> On which Mac ? How many picts ? I curious
>
1Ghz G4 PowerBook. Loading of pictures is very slow (eg > five seconds
per image IIRC) compared to the same code running on my work machine.
That's why I added in background loading and caching of images.

> Maybe a modification of BookMorph (as MiStack ) with cards holding say 50
> picts each and flipping the cards ...
>
I'd not thought of that approach, could be very useful

> Keep Squeaking and having fun !
>
Thanks,
Michael
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: SampleCode-ImageViewer

Michael Davies-2
In reply to this post by Wade Scholine
> ... I would have thought it
> would be nice if the goNext/Back buttons cause the directory field to accept
> if it hadn't already, I think this would be more in keeping with the
> behavior of modern GUIs. I didn't see an obvious way to make that happen.
>

I see what you mean - I think I ended up creating an interface that's
as 'opaque' as some of the controls that have confused me in the past.
The first time I tried to using the refactoring Selector Editor I had
no idea what the hell I was supposed to do with this mysterious
window!

I'll have a play around...

Cheers, Michael
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners