pharo

How to find which was the wrong message in a Message Not Understood message?

和自甴很熟 提交于 2019-12-22 10:49:54
问题 I want to find the name of the message that triggered the MNU , how do I do that ? For example if I do Transcript explode . This will trigger a MNU because method explode does not exist but how do I find that the name of the message that triggered MNU is "explode" ? 回答1: If I DoIt that, I get a debugger. The title there is MessageNotUnderstood: ThreadSafeTranscript>>explode When I select the first element, I get to see the doesNotUnderstand: aMessage, where aMessage is the message 回答2: Try

Smalltalk Pharo ZdcSecureSMTPClient not showing html formatting in GMail?

ⅰ亾dé卋堺 提交于 2019-12-22 08:52:11
问题 I'm using ZdcSecureSMTPClient to send an html formatted string to a gmail account. But when I send it it displays the html encoding as plain text. ie) mailMessage := MailMessage empty. mailMessage setField: 'subject' toString: 'Trying to send html '. mailMessage body: (MIMEDocument contentType: 'text/html\n' content: '<html><head><b> Dear </b></head></html>' This shows is Gmail as: 'html> head> Dear /b>/head>/html>' Using Seaside/Pharo 2.0 one click image. 回答1: What you use to set the mime

Smalltalk Pharo ZdcSecureSMTPClient not showing html formatting in GMail?

邮差的信 提交于 2019-12-22 08:50:41
问题 I'm using ZdcSecureSMTPClient to send an html formatted string to a gmail account. But when I send it it displays the html encoding as plain text. ie) mailMessage := MailMessage empty. mailMessage setField: 'subject' toString: 'Trying to send html '. mailMessage body: (MIMEDocument contentType: 'text/html\n' content: '<html><head><b> Dear </b></head></html>' This shows is Gmail as: 'html> head> Dear /b>/head>/html>' Using Seaside/Pharo 2.0 one click image. 回答1: What you use to set the mime

How do I ask the user for a file name?

邮差的信 提交于 2019-12-22 07:24:11
问题 Searching for the call of a FileDialog I would like to ask the user for a file name in Pharo 4.0 Through the spotter I found class FileDialogWindow with a method answerFileName Looking for the senders of #answerFileName I get to class UITheme where it is called in the method chooseFileNameIn: aThemedMorph title: title extensions: exts path: path preview: preview And from there I come to class TEasilyThemed with the method chooseFileName: title extensions: exts path: path preview: preview From

Squeak or Pharo for the beginning Smalltalker?

核能气质少年 提交于 2019-12-20 10:17:36
问题 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? 回答1: To certain extent, it is a matter of

How can I add an item in the World-menu of Pharo 4.0?

两盒软妹~` 提交于 2019-12-18 04:59:13
问题 How can I add a new item - Workspace openLabel: 'Workspace' - to the World-menu of Pharo 4.0 ? (What can I say... I prefer Workspace over the new what's-it-called. :-) I've looked at several menu-related items in the Browser, but couldn't really make head or tails of it. I also tried to find where the menu is stored (it must be somewhere, right?), but couldn't find it. Also, how would I go about to add it to one of the existing sub-menues of World-menu, and how could I create a new sub-menu

Is it possible to extend an individual object in Smalltalk

烂漫一生 提交于 2019-12-18 03:36:27
问题 I'm doing research in Smalltalk reflection, and I was wondering if it was possible to extend an individual object like that would be possible for instance in Ruby. With this I mean a selector that only particular objects respond to. Here is some Ruby code that states what I mean. For clarification: in Ruby this open a virtual class for this object, and extends it with a new definition. The vital part here is that nothing changes to the class definition! o = Object.new o.instance_eval {def foo

Why shouldn't I store into literal arrays in Smalltalk?

不想你离开。 提交于 2019-12-17 20:13:49
问题 Some style-guides and idioms suggest that you should not mutate literal arrays, like in this case: MyClass>>incrementedNumbers | numbers | numbers := #( 1 2 3 4 5 6 7 8 ). 1 to: numbers size: do: [:index | numbers at: index put: (numbers at: index) + 1]. ^ numbers Why should I not do that? 回答1: Note: The following is implementation dependent. The ANSI Smalltalk Standard defines: It is unspecified whether the values of identical literals are the same or distinct objects. It is also unspecified

Pharo Smalltalk - How can I check if a message conforms to a protocol defined in another object's Class?

和自甴很熟 提交于 2019-12-12 10:58:22
问题 I'm looking at this form an Objective-C background so be gentle. The experiment looks like this: Object1 has an instance variable named delegate. Object1 receives a message and the proceeds to check if delegate implements a specific protocol (whose name is known beforehand), if it does, then it checks if the message is among the protocol's implemented methods. It then makes a decision on how to interact with the delegate and so on. In Objective-C one has to define clear Protocols, usually

Keyword messages in smalltalk (Beginner)(Pharo)

五迷三道 提交于 2019-12-11 13:38:36
问题 I am trying to create a keyword message style method, but I can't figure out how to access the Receiver from inside the method. I am sure this is simple, however I can't find the answer anywhere. What I am trying to implement is redundant, but I would still like to know how it works. subst: i1 by: i2 ^ self copyReplaceAll: i1 with: i2. It would be called in the workspace as follows: string1 := 'Lemon'. string2 := 'm'. string3 := 'ss'. string1 subst: string2 by: string3. Error msg: