answerstu

smalltalk - Squeak or Pharo for the beginning Smalltalker?

I am a Rubyist that is just starting to dabble in Smalltalk and am trying to chose an implementation to experiment with. It seems like Squeak or Pharo would be a good choice, but I'm having trouble finding current information to help decide which one would be better. Much of what I find via Google searches is from a couple of years ago and may no longer be relevant.Is there a clear favorite these days? If not, what are the pros and cons of each?...Read more

smalltalk - Morphic: Automatically resize contained group box in a scroll pane?

Testing with Pharo 1.4 summer. I think is better to explain it using screenshots, code is below.This is my initial state (what I'm getting now with my code):I want the group box morph to be filled horizontally on opening, like this:And after resizing, I want the group box morph to maintain the bounds, i.e.:This is the code I've tried:| s morph1 morph2 row groupBox scroller |s := ScrollPane new.morph1 := BorderedMorph new.morph2 := BorderedMorph new.row := UITheme builder newRow: {morph1 . morph2}.groupBox := UITheme builder newGroupbox: 'Group ...Read more

pharo smalltalk Window closing

I am using Pharo Smalltalk version 4.0 to build a simple GUI app. I wish to make sure that "StandardWindow" that I have created does not close when the user clicks on the "X" button in the top corner. Hence, I am sending the message "mustNotClose" to my window object, which is an instance variable of the superclass SystemWindow. However, the window still closes when I click on the "X" button. Any ideas about what am I missing? Any help will be greatly appreciated....Read more

Smalltalk Pharo

Read from StringMorph, how to write code for doing math. contents := InputField contents asNumberHow could I then add a math function to this - (1.8 + 32) to change the number from the string? I'm struggling to find examples online....Read more

creation of a class in Pharo Smalltalk?

I have been following the example of making a class in Pharo from the following link:https://ci.inria.fr/pharo-contribution/job/UpdatedPharoByExample/lastSuccessfulBuild/artifact/book-result/PharoObjectModel/PharoObjectModel.html#fig:colorInstanceClassSideIt is the example of making a Dog and a Hyena class. First I created a package called TestC and in the Instance class I have made the following:For what I know, and correct me if I am wrong, the instance side is where I create the methods that will work when I instantiate an object while the c...Read more

smalltalk - Finding the Pharo documentation for the compile & evaluate methods, etc. in the compiler class

I've got an embarrassingly simple question here. I'm a smalltalk newbie (I attempt to dabble with it every 5 years or so), and I've got Pharo 6.1 running. How do I go about finding the official standard library documentation? Especially for the compiler class? Things like the compile and evaluate methods? I don't see how to perform a search with the Help Browser, and the method comments in the compiler class are fairly terse and cryptic. I also don't see an obvious link to the standard library API documentation at: http://pharo.org/documentatio...Read more

How to delete a VA Smalltalk edition of method

I am using VA Smalltalk and I want to understand how to delete particular editions of any method which I have created by mistake, they are not duplicate methods but are unwanted as well. please let me know if there is a way to do so, I dont want to delete all the previous edition only few selected editions...Read more

Smalltalk weird printing error

In order to "pad" a number I'm printing so that it's always a fixed number of characters, I'm making a padding string based off how many integers and in the given number:pad := ' '.(freqVal < 10) ifTrue: [ pad := ' ' ].((freqVal < 100) & (freqVal > 9)) ifTrue: [ pad := ' ' ].((freqVal < 1000) & (freqVal > 99)) ifTrue: [ pad := ' ' ].stdout<<pad<<freqVal<<<<nlHowever, the printed result always makes the variable pad into a letter instead of spaces like I'm assigning its value to. If I add pad ...Read more

visualworks - How to sort according to key in an Ordered Collection in Smalltalk

I am trying to sort an OrderedCollection via its keys, but this method returns just the keys. I want to get both keys and values, but sorted based on keys.aAssociation:= Association new.aAssociation key:6 value:7.aOrderedCollection:= OrderedCollection new.aOrderedCollection addFirst: aAssociation.aAssociation1:= Association new.aAssociation1 key:5 value:9.aOrderedCollection addLast: aAssociation1.aAssociation2:= Association new.aAssociation2 key:8 value:4.aOrderedCollection addLast: aAssociation2.aSortedCollection:= (aOrderedCollection sort: #k...Read more

smalltalk - What could be wrong with this syntax pharos?

I am trying to create a method that logs to a server, grabs the json file it found, then selects 4 of each element and sends it to an address. My code below seems to work when I give it only a single data known for each format in the send link rather than a loop that should select each at a time. The error I'm getting is: instance of smallInteger did not understand #readStream. What is causing this error? How else can I automate these requests?1 to: 4 do: [ :each | each. a := ZnClient new. a get: 'https://MyServer/'. a headerAt: 'refere...Read more