[Newbies] Customizing wrapping in TextMorph
Hi, I want to change the text-wrapping that is done in TextMorph (wrap after all non-letter characters (not only spaces), don't force-wrap long words). I could not find where or how the wrapping is actually done in TextMorph. Any pointers where I should look? Thanks, Matthias -- Matthias Korn Institut für Wirtschaftsinformatik Fachbereich 5 Universität Siegen Telefon: +49 (0) 271 / 23 67 660 Mobil: +49 (0) 176 / 700 17 17 8 Uni: +49 (0) 271/ 740 - 3382 eMail: matthias.k...@uni-siegen.de Web: http://mkorn.binaervarianz.de/ ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Re: [Newbies] Resizing a form to specific width and height
Hi Bert, thanks for your hint. I tried WarpBlt classrotate:degrees:center:scaleBy:smoothing: and it worked as expected. But I also found that I just had a slight mistake and my initial try with FormmagnifyBy: and aPoint (with x and y scaling) was actually also successful. I am using this now. Thanks, Matthias P.S.: I had to fix FormmagnifyBy: in my Squeak version as it initially did not work with Points as advertised. Am Mon, 12 Jan 2009 11:45:43 +0100 schrieb Bert Freudenberg b...@freudenbergs.de: On 12.01.2009, at 00:16, Matthias Korn wrote: Hi, how can I resize a form to a specific width and height by either stretching it on one axis or cropping it on the other axis. Forms are fixed-size. The way you do it is by creating a new form of the desired extent and depth, and then copying (a part of) the old form into the new form, possibly scaling the pixels while doing so. This is done by class BitBlt (for bit block transfer) and its extension WarpBlt (which can do scaling and rotation too). There are convenience methods hiding the details of form creation, BitBlt, and WarpBlt in class Form. E.g. copy: aRectangle does cropping, and magnify: aRectangle by: aPoint smoothing: anInteger does cropping and scaling. BitBlt also does bit-depth conversion, color-remapping, statistics, and other image manipulations. It's well worth learning about :) - Bert - ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners -- Matthias Korn Institut für Wirtschaftsinformatik Fachbereich 5 Universität Siegen Telefon: +49 (0) 271 / 23 67 660 Mobil: +49 (0) 176 / 700 17 17 8 Uni: +49 (0) 271/ 740 - 3382 eMail: matthias.k...@uni-siegen.de ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
[Newbies] Resizing a form to specific width and height
Hi, how can I resize a form to a specific width and height by either stretching it on one axis or cropping it on the other axis. I create the form with Form classfromBinaryStream: from a background image (.jpg) The messages in Form don't really seem to help or am I missing an obvious one? Thanks, Matthias ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Re: [Newbies] Coloring images with transparant parts
Hi Bert, I have quite a hard time understanding how to use color maps. And I really did not find any helpful documentation on them for Squeak. One example I found in the image is in BitBlt classexampleColorMap. But I don't know how to use it with a Form/BitBlt, well, and what the heck they are actually doing there... In most occasions they used the Bitmap class instead of ColorMap and I couldn't find anything to convert. Could you provide a simple code example on how to modify the color map of a Form? Or any other pointers Thanks a lot, Matthias Am Sat, 22 Nov 2008 01:58:33 +0100 schrieb Bert Freudenberg [EMAIL PROTECTED]: On 22.11.2008, at 01:15, Matthias Korn wrote: Hi, thanks for your hints. I also found ColorFormreplaceColor:with: which does what you describe. But it is unfortunately not what I was looking for. I wasn't very clear in my original post: I (now) have a gray-scale image which I want to colorize, that is I want to change the hue of the image and not just replace a color with another (or floodfill for that matter). Hope you guys have some ideas. I tried searching with the Method Finder, but my poor english didn't take me very far. Use a color map. Your grayscale image could be 8 bits, so with a 256 entries palette you can map that to any color(s) you want. Color maps are used in ColorForm, or directly with BitBlt. - Bert - ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners -- Matthias Korn Institut für Wirtschaftsinformatik Fachbereich 5 Universität Siegen Telefon: +49 (0) 271 / 23 67 660 Mobil: +49 (0) 176 / 700 17 17 8 Uni: +49 (0) 271/ 740 - 3382 eMail: [EMAIL PROTECTED] ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
[Newbies] Resources with Monticello
Hi all, how does one work with resources (e.g. image files (GIFs, ...)) used in the application when working with Monticello and in general? Right now I have them on my hard drive and they are read live into Squeak when they are needed. Of course, others don't have the files at hand when working in a distributed fashion. What are the best practices in regard of distribution/packaging as well as performance? Thanks, Matthias -- Matthias Korn Institut für Wirtschaftsinformatik Fachbereich 5 Universität Siegen Telefon: +49 (0) 271 / 23 67 660 Mobil: +49 (0) 176 / 700 17 17 8 Uni: +49 (0) 271/ 740 - 3382 eMail: [EMAIL PROTECTED] ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Re: [Newbies] Coloring images with transparant parts
Hi, thanks for your hints. I also found ColorFormreplaceColor:with: which does what you describe. But it is unfortunately not what I was looking for. I wasn't very clear in my original post: I (now) have a gray-scale image which I want to colorize, that is I want to change the hue of the image and not just replace a color with another (or floodfill for that matter). Hope you guys have some ideas. I tried searching with the Method Finder, but my poor english didn't take me very far. Thanks a lot. Matthias Am Tue, 18 Nov 2008 15:08:27 +0100 schrieb Matthias Korn [EMAIL PROTECTED]: Hi all, I have a .png or .gif image (e.g. an ImageMorph) with transparent parts (e.g. a circle where the outer part is transparent). I now want to have this one image and color it programmatically with other colors (e.g. the circle appearing in slight red, green, blue ...). Is this possible to do with Squeak/Morphic? How? Thanks, Matthias ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners -- Matthias Korn Institut für Wirtschaftsinformatik Fachbereich 5 Universität Siegen Telefon: +49 (0) 271 / 23 67 660 Mobil: +49 (0) 176 / 700 17 17 8 Uni: +49 (0) 271/ 740 - 3382 eMail: [EMAIL PROTECTED] ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
[Newbies] Coloring images with transparant parts
Hi all, I have a .png or .gif image (e.g. an ImageMorph) with transparent parts (e.g. a circle where the outer part is transparent). I now want to have this one image and color it programmatically with other colors (e.g. the circle appearing in slight red, green, blue ...). Is this possible to do with Squeak/Morphic? How? Thanks, Matthias ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Re: [Newbies] Porting an old app to a recent image
Wow! That's great. I managed to fileIn the class now. They did quite a lot of this variable saving stuff... Am Fri, 10 Oct 2008 13:24:09 -0700 schrieb Yoshiki Ohshima [EMAIL PROTECTED]: ScratchFrameMorph class-readPaintSkinFrom.st Cool, it is a fun class to work on. I tried to file it in to 3.10.2 and did get the Syntax Error panel properly. How do you get the Syntax Error panel? Is that a special tool? I'm only getting the debugger where I navigated to the message you told me... Thanks, Matthias The trouble seems to me that in the following part and after, variable n is used but it is a block local variables in the previous blocks. -- n _ root, part. -- which is in: -- resizeable button/typein forms #(paintUtilityButton) do: [:root | #(Left Middle Right) do: [:part | n _ root, part. pressed _ root, part, 'Pressed'. ScratchSkin at: n asSymbol put: (Utilities form: n from: aDirectory). root ~= #typein ifTrue: [ ScratchSkin at: pressed asSymbol put: (Utilities form: pressed from: aDirectory)]]]. -- If you look at the Syntax Error window, there is out of scope - indication in front of n. In the older image like the MIT Squeak, it was forgiven but not anymore in the newer images. So, rename the variable n in that part to something else and it should be fine. -- Yoshiki ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Re: [Newbies] learning Morphic
Hi, I am actually facing the same problem - not understanding the differences between all the morphs and what they actually do. Things I found most interesting so far (after asking here on the list): - the Morphic chapter by John Maloney: http://stephane.ducasse.free.fr/FreeBooks/CollectiveNBlueBook/morphic.final.pdf - this PluggableMorphs tutorial: http://wiki.squeak.org/squeak/2962 - and the various GUI builders: http://wiki.squeak.org/squeak/2914 (BobsUI) http://wiki.squeak.org/squeak/5607 (ToolBuilder) http://wiki.squeak.org/squeak/3836 (Maui) Hope there is more, though!? Regards, Matthias Am Fri, 10 Oct 2008 07:59:56 -0500 schrieb Mark Volkmann [EMAIL PROTECTED]: My GUI programming background is mainly Java Swing. I'm trying to get a feel for programming with Morphic. Browsing through the list of classes, I'm not seeing lots of basic things I'd expect. Maybe Morphic is dramatically different. I'm trying to find basic things like text fields, checkboxes, radio buttons, push buttons, lists, tables, trees, etc. I've searched for Morphic tutorials. Most seem to focus on custom graphics rather than these basic GUI widgets. Where should I start? --- Mark Volkmann ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Re: [Newbies] learning Morphic
Hi, Am Fri, 10 Oct 2008 09:41:22 -0500 schrieb Mark Volkmann [EMAIL PROTECTED]: [..] - this PluggableMorphs tutorial: http://wiki.squeak.org/squeak/2962 The descriptions of the demos sound good, but code is only provided for the button demos. It's not clear how to get to other demo code. In the .pr file there is the code for all three types (Buttons, TextBox, Lists). I guess the other PluggableMorphs are similar. Regards, Matthias ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Re: [Newbies] Porting an old app to a recent image
Hi, Am Thu, 9 Oct 2008 16:32:40 -0700 schrieb Yoshiki Ohshima [EMAIL PROTECTED]: At Thu, 9 Oct 2008 15:37:39 +0200, Matthias Korn wrote: [1 text/plain; US-ASCII (7bit)] Hi, I already tried to fileIn a minimal part (one Morph class) of the application I want to port and started resolving the errors in the debugger one by one. Still, now I am stuck with the following error: Metaclass(Object)doesNotUnderstand: #category (the full Stack Trace is attached) [..] This apparently happens after some syntax error already happened. I re-checked the errors I got before this one and I think I solved them alright. So the method being compiled has an issue. Then the question is to find out which method. In the debugger that produced the stack trace, visit somewhere at the bottom and see the content of aStream variable for Compilertranslate:noPattern:ifFail:. The method should have some problem. I checked the method in the ReadStream of message, but couldn't make out any problems (it is attached, though). But it could be a subtle one... You could also define #category method at Metaclass that simply returns nil and then try to file in, I think. I tried that before (with returning self though), but without any luck (I am getting: Metaclass(Object)error: ... Error: Instances of Metaclass are not indexable). -- Yoshiki Thanks, Matthias ScratchFrameMorph class-readPaintSkinFrom.st Description: Binary data ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Re: [Newbies] Porting an old app to a recent image
Hi, I already tried to fileIn a minimal part (one Morph class) of the application I want to port and started resolving the errors in the debugger one by one. Still, now I am stuck with the following error: Metaclass(Object)doesNotUnderstand: #category (the full Stack Trace is attached) Were there some changes in the Metaclass between V2 and V3 that explain this error? Thanks for the hint, though Karl. I didn't know about that possibility. Regards, Matthias Am Wed, 8 Oct 2008 18:07:55 +0200 schrieb Karl Ramberg [EMAIL PROTECTED]: Matthias Korn wrote: Hi all, is there some documentation, help, tools, etc. to port a Squeak app written in SqueakV2.sources to a recent image? fileOut - fileIn gives me all sorts of error messages I cannot understand/debug. I actually just want to port parts of the app to re-use the code. But it proofs really difficult for me Hi, in FileList you can try to look at the code with the CodeBrowser. Select the file you want to load, press the code button, or select browse code from the context menu. This will load the code in a temporary way and you can browse it and see the methods that change, and file in the parts you want. KarlSubject: [BUG]Metaclass(Object)doesNotUnderstand: #category 9 October 2008 3:22:39 pm VM: unix - a SmalltalkImage Image: Squeak3.10beta [latest update: #7159] SecurityManager state: Restricted: false FileAccess: true SocketAccess: true Working Dir /home/matsch/apps/sq3.10-7159dev08.03.1 Trusted Dir /home/matsch/apps/sq3.10-7159dev08.03.1/secure Untrusted Dir /home/matsch/apps/sq3.10-7159dev08.03.1/My Squeak Metaclass(Object)doesNotUnderstand: #category Receiver: ScratchFrameMorph class Arguments and temporary variables: aMessage: category Receiver's instance variables: superclass: Morph class methodDict: a MethodDictionary(#includeInNewMorphMenu-a CompiledMethod (127) #...etc... format: 156 instanceVariables: nil organization: ('class initialization' initialize) ('instance creation' includeI...etc... thisClass: ScratchFrameMorph traitComposition: nil localSelectors: nil Parsernotify:at: Receiver: a Parser Arguments and temporary variables: string: 'out of scope' location: 1653 Receiver's instance variables: source: a ReadStream 'readPaintSkinFrom: aDirectory Read the Forms for my pai...etc... mark: 1657 hereChar: $, aheadChar: Character space token: 'root' tokenType: #word currentComment: nil buffer: a WriteStream 'root' typeTable: #(#xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xB...etc... here: #_ hereType: #leftArrow hereMark: 1655 hereEnd:1655 prevMark: 1653 prevEnd:1653 encoder:{an Encoder} requestor: nil parseNode: {#(#Left #Middle #Right )} failBlock: [] in Compilertranslate:noPattern:ifFail: {[^ failBlock value]} requestorOffset:0 tempsMark: 452 doitFlag: false properties: a MethodProperties category: #'scratch skin' Parsernotify: Receiver: a Parser Arguments and temporary variables: aString:'out of scope' Receiver's instance variables: source: a ReadStream 'readPaintSkinFrom: aDirectory Read the Forms for my pai...etc... mark: 1657 hereChar: $, aheadChar: Character space token: 'root' tokenType: #word currentComment: nil buffer: a WriteStream 'root' typeTable: #(#xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xB...etc... here: #_ hereType: #leftArrow hereMark: 1655 hereEnd:1655 prevMark: 1653 prevEnd:1653 encoder:{an Encoder} requestor: nil parseNode: {#(#Left #Middle #Right )} failBlock: [] in Compilertranslate:noPattern:ifFail: {[^ failBlock value]} requestorOffset:0 tempsMark: 452 doitFlag: false properties
[Newbies] Porting an old app to a recent image
Hi all, is there some documentation, help, tools, etc. to port a Squeak app written in SqueakV2.sources to a recent image? fileOut - fileIn gives me all sorts of error messages I cannot understand/debug. I actually just want to port parts of the app to re-use the code. But it proofs really difficult for me Thanks, Matthias ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
[Newbies] Base64 conversion for images
Hi, I want to transfer thumbnails as one part of some more structured data via XML. I thought about embedding the thumbs encoded in Base64 directly into the XML file rather than transferring them separately. How can I decode the string from within the XML file to use and display the thumbs in Squeak (they are either gif, jpg or png). I had a look at Base64MimeConverter but couldn't quite figure it out Another use case is converting thumbs on my hard drive to a Base64 string (i.e. encoding...). From a FileStream..? I guess Base64MimeConverter is the right thing. Is there some documentation on how to use it? Thanks, matsch ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
[Newbies] SqueakSVN installation problems
Hi, I was trying to install SqueakSVN from the sar-file provided by HPI at http://www.swa.hpi.uni-potsdam.de/projects/ssvn/index.html After installing I get the message Everything was installed correctly but the SqueakSVN VMPlugin could not be loaded Consequently, when trying to create a new project in the SVNProjectBrowser I'm getting Error: a primitive has failed. Does anyone have an idea on how to fix the VMPlugin? I am using sq3.10-7159dev08.03.1.image on Debian Linux with squeak-vm 1:3.9.8-5. Thanks, Matthias ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Re: [Newbies] Adv. Morphic Tutorials
Thanks David and Karl! I think doing all the little tutorials and looking at BobsUI (which is quite nice) also brought me forward quite a bit. I guess I have to do an overview of all Morphs my self. If I actually come around to do it I will share in the squeak swiki... Until then, I'll have to do name guessing and searching in http://www.oldenbuettel.de/squeak-doku/class_index.html Cheers. Matthias Am Sun, 21 Sep 2008 15:40:45 +0200 schrieb Matthias Korn [EMAIL PROTECTED]: Hi all, I was trying to get a grip of Morphic for the last several weeks. Without much luck. I was doing several Morphic tutorials, checked the Squeak By Example book and the Maloney chapter in the Guzdial/Rose book. But all just cover the very basics of Morphic by combining some geometrical shapes or the very basic counter tutorial (Maloney has some more advanced aspects, but really not much). What I could use now is a more advanced Morphic tutorial for building like real more complex UIs - actual applications - but smaller widgets are also something I have to look after. An overview of the most important/common Morphs out there would also help a lot, but as far as I understood this doesn't exist yet!? Looking at the code alone doesn't really do it for me, since, besides Morphic, I am also a Smalltalk/Squeak beginner. Are there any valuable resources I have overlooked so far? Thanks, Matthias ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
[Newbies] Adv. Morphic Tutorials
Hi all, I was trying to get a grip of Morphic for the last several weeks. Without much luck. I was doing several Morphic tutorials, checked the Squeak By Example book and the Maloney chapter in the Guzdial/Rose book. But all just cover the very basics of Morphic by combining some geometrical shapes or the very basic counter tutorial (Maloney has some more advanced aspects, but really not much). What I could use now is a more advanced Morphic tutorial for building like real more complex UIs - actual applications - but smaller widgets are also something I have to look after. An overview of the most important/common Morphs out there would also help a lot, but as far as I understood this doesn't exist yet!? Looking at the code alone doesn't really do it for me, since, besides Morphic, I am also a Smalltalk/Squeak beginner. Are there any valuable resources I have overlooked so far? Thanks, Matthias ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners