Re: [Pharo-users] Creating a BaselineOf from a ConfigurationOf>>#baselineXyz:

2017-06-06 Thread Nicolai Hess
Hi Sean,

2017-06-04 5:48 GMT+02:00 Sean P. DeNigris :

> I'm trying to write a rewrite rule, but can't quite get it.
>
> I first want to remove `spec blessing: #baseline.`
>
> I tried the following with no effect:
>
> RBParseTreeRewriter new
> replace: '`@expr blessing: `#lit'
> with: '';
> executeTree: methodTree;
> tree.
>

This works for me, but ...


>
> NB: If I try to edit the expression instead of remove, by passing something
> like '`@expr assert: `#lit' for #with:, it works
>
> What am I missing here?
>
> Thanks!
>
>

keep in mind some odds about the caching on ast nodes.

Working with the tree rewriter directly on the method ast
(MyClass>>#myMethod) ast

- will modify the "cached" method ast, that means,  on code browser,  you
do not see the change.
- the #source method of the ast, again only shows a cached source
  (MyClass>>#myMethod) ast source -> "old source"
- printing the formatted code will finally step into the (modified) method
source nodes
  (MyClass>>#myMethod) ast formattedCode -> "new source code"










>
>
> -
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/
> Creating-a-BaselineOf-from-a-ConfigurationOf-baselineXyz-tp4949192.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] Traits, method flatten

2017-06-08 Thread Nicolai Hess
2017-06-08 6:00 GMT+02:00 Sean P. DeNigris :

> HilaireFernandes wrote
> > I made another attempt to
> > persist this time with filetree://. The net result is the same, the
> > Traits logic is lost in the classes using the Traits: all traits methods
> > are duplicated !!
>
> I just got burned by this in ##50768. Methods inherited from traits were
> saved as part of the package containing the extended class, as well as the
> package containing the Trait itself. Ugh. Was this ever fixed by Pharo 6?
>

yes, it should. See issue
 19938 
Traits methods flattened (now in Pharo 60466 )
19974

backport Traits methods flattened (case 19938)  (now in Pharo 50772 )

But AFAIK the bug, that new trait methotds are put into the "RPackage" of
the trait that is "using" this trait , still exists.
We only reject this entities when building the mc-package



>
>
>
> -
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/Traits-method-flatten-
> tp4941799p4950378.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] Rewriting question

2017-06-12 Thread Nicolai Hess
2017-06-10 21:16 GMT+02:00 werner kassens :

> On 06/10/2017 04:07 PM, werner kassens wrote:
>
>> On 06/10/2017 03:37 PM, werner kassens wrote:
>>
>>> Hi,
>>>
>>> i have a private rewriting rule. unfortunately it shows up in the lower
>>> pane of the SystemBrowser which makes no sense at all, since it is not
>>> intended for use outside of the program using it. how do i make it
>>> invisible for that part of the systembrowser? and btw where are the rules
>>> collected for that part?
>>>
>>> werner
>>>
>> i should add that it only shows up after i used it.
>> werner
>>
> and i use this way:
> b:=MyRBTransformationRule new runOnEnvironment: a.
> b builder changes do:[:r|r execute].
> and afterwards MyRBTransformationRule also appears in the lower
> SystemBrowser pane if applicable.
>


Maybe all transformation rules are defaults to "visible rule classes"
(see ReRuleManager allRules)

@Yuriy
can you check
ReRuleManager classAdded: aClassAddedAnnouncement
I am not sure the (aClassAddedAnnouncement classAdded isKindOf:
RBLintRule) works as intended.


Re: [Pharo-users] Autoformatting in SystemBrowser

2017-06-17 Thread Nicolai Hess
Can you check your sources or changes files. Maybe they are missing or
corrupted.


Am 17.06.2017 11:35 vorm. schrieb "Marc Hanisch via Pharo-users" <
pharo-users@lists.pharo.org>:

>
>
> -- Weitergeleitete Nachricht --
> From: Marc Hanisch 
> To: Any question about pharo is welcome 
> Cc:
> Bcc:
> Date: Sat, 17 Jun 2017 10:56:35 +0200
> Subject: Autoformatting in SystemBrowser
> Hello,
>
> since Pharo6 my method comments in the SystemBrowser gets automatically
> removed. My arguments get also removed, so when I type:
>
> SomeClass >> name: aString
>   "sets the name instance variable"
>   name := aString
>
> it gets corrected to:
>
> SomeClass >> name: arg1
>   name := arg1
>
> How can I configure this behaviour? I could not find the related
> settings... :-/
>
> Thanks,
> Marc
>
>


Re: [Pharo-users] Morph layout changes in P4, P5 or P6

2017-06-17 Thread Nicolai Hess
2017-06-17 19:35 GMT+02:00 Hilaire :

> Found, it is the Layout protocol. It seems to behave differently, at least:
>
> LayoutFrame fractions: fractionsOrNil offsets: offsetsOrNil
>
> does not behave the same
>
> Le 17/06/2017 à 18:40, Hilaire a écrit :
> > I think the changes originated more likely in P4.
>
> --
> Dr. Geo
> http://drgeo.eu
>
>
>
Do you know how to fix it ?

Replacing code like

self window addMorph: treeMorph
fullFrame: (LayoutFrame
fractions: (0@0 corner: 0.2@1)
offsets: (0 @ menuBarShiftY
corner: 0@statusHeight negated)).


with


self window addMorph: treeMorph
fullFrame: ((0@0 corner: 0.2@1) asLayoutFrame
topLeftOffset: (0 @ menuBarShiftY) ;bottomRightOffset:  (0@statusHeight
negated)).

works for me.


Re: [Pharo-users] Regression with PNGReaderWriter in P6

2017-06-18 Thread Nicolai Hess
2017-06-18 14:01 GMT+02:00 Hilaire :

> The code bellow decodes the PNG picture just fine in P3, in P6 it can't!
>
> I suspect changes in PNGReaderWriter>>nextImage
> However the version shows no history of edit :(
>
> One should add this code below in a test for PNG.
>
>
> PNGReadWriter createAFormFrom: #(137 80 78 71 13 10 26 10 0 0 0 13 73 72
> 68 82 0 0 0 48 0 0 0 48 16 6 0 0 0 7 146 37 196 0 0 0 6 98 75 71 68 255
> 255 255 255 255 255 9 88 247 220 0 0 0 9 112 72 89 115 0 0 0 72 0 0 0 72
> 0 70 201 107 62 0 0 1 153 73 68 65 84 120 218 237 155 73 110 195 48 12
> 69 227 162 183 211 9 180 11 130 220 77 39 208 249 210 77 181 8 81 69 19
> 39 169 255 109 12 35 137 197 255 105 81 244 144 219 13 0 0 0 0 0 116 16
> 66 8 33 188 94 214 113 120 99 214 151 111 238 1 115 206 57 231 235 178
> 54 68 10 238 19 112 58 1 189 1 238 158 16 233 25 255 37 117 224 221 141
> 215 210 193 158 128 83 140 215 210 181 156 0 26 216 169 139 180 155 210
> 218 50 184 124 126 74 34 122 245 204 234 101 207 224 41 221 145 150 14
> 49 67 118 77 132 118 220 98 93 208 168 64 107 172 226 18 63 19 91 194
> 172 103 132 117 124 106 194 117 132 210 227 215 143 103 109 124 65 173 4
> 181 4 173 149 128 254 223 121 49 190 160 190 6 212 4 126 22 94 12 163 91
> 173 241 229 112 219 141 188 51 106 184 223 46 139 162 62 3 164 137 49
> 198 24 253 117 89 219 241 183 145 181 82 180 94 154 192 47 212 248 247
> 253 209 45 152 102 205 120 36 130 137 182 193 159 19 5 22 233 53 158 126
> 31 48 209 54 190 181 15 8 189 247 215 71 141 174 25 127 218 243 137 105
> 168 17 53 99 164 140 247 154 8 183 119 67 139 177 41 165 148 210 117 209
> 125 233 241 181 16 187 18 158 21 254 124 62 30 247 251 186 241 173 113
> 122 227 148 70 237 145 100 175 33 210 120 139 207 205 237 232 255 22 71
> 129 45 16 60 3 158 163 123 6 140 214 74 239 198 207 198 201 189 102 12
> 151 32 26 128 155 23 150 22 105 189 96 38 181 88 31 211 206 113 163 165
> 151 109 17 182 110 231 118 213 193 222 5 237 154 8 171 184 217 254 31
> 176 123 9 114 255 146 177 187 128 224 3 0 0 0 0 192 198 252 0 102 116 72
> 96 211 171 62 8 0 0 0 0 73 69 78 68 174 66 96 130) asByteArray
>
>
>
> --
> Dr. Geo
> http://drgeo.eu
>
>
>


Works for me in windows 32.
Maybe it is an 32/64 bit vm issue ?


Re: [Pharo-users] WrapAthen, World coordinate?

2017-06-18 Thread Nicolai Hess
Done:

 20166

wrong cliprect on transformed athens canvas

Although I don't know how we handle fixes for Athens, as the current
repository and in-image version already diverged again.



2017-06-19 8:15 GMT+02:00 Stephane Ducasse :

> Hi hilaire
>
> Can you add a bug entry in the pharo bug tracker?
> We cannot look at bugs that are not listed there.
>
> Stef
>
> On Sun, Jun 18, 2017 at 4:11 PM, Hilaire  wrote:
> > Only the picture I sent previously, but Nicolas tracked the problem in
> > the clipping default choices:
> >
> > https://bugs.launchpad.net/drgeo/+bug/1698582
> >
> > Le 18/06/2017 à 15:41, Stephane Ducasse a écrit :
> >> Do you have an expression showing the problem?
> >
> > --
> > Dr. Geo
> > http://drgeo.eu
> >
> >
>
>


Re: [Pharo-users] P6: How to get focus for mouse wheel event

2017-06-20 Thread Nicolai Hess
2017-06-20 14:14 GMT+02:00 Hilaire :

> Hi,
>
> With Dr. Geo under P6 I have a usability regression with the
> GeneralScrollPane of the File thumbnail dialog:
>
> This dialog does not have any more the focus when open by default.
>
> It is a problem when the user wants to browse with mouse wheel the
> sketch previews. Indeed he needs to first click on the dialog then he
> can browser with the mouse wheel.
>
> The user click should be unnecessary.
>
> How to ensure the mouse wheel event are sent by default to the
> GeneralScrollPane?
>
> It was the case with P3.
>

Hmm.
We fixed the mousefocus handling for openModal
(see case 14629

Morphic click event and modal windows get stuck)

But I guess , this now does not work as expected when the actual  mouse
focus should be nil.
Because now the DrGeoThumbnailDialog holds the mouse focus and does not
react on scroll events. Only if the
current mouse focus is nil the scrollevents are handled by the scrollpane)


>
> Hilaire
>
>
> --
> Dr. Geo
> http://drgeo.eu
>
>
>


Re: [Pharo-users] P6: How to get focus for mouse wheel event

2017-06-21 Thread Nicolai Hess
2017-06-21 6:48 GMT+02:00 Hilaire :

> Is there a way I can manualy change it by code? I did have success to
> find it.
>
>
Ugly hack:

DrGFileThumbnailDialog>>#handleFocusEvent: anEvent
(anEvent isMouse and: [ anEvent isMouseWheel ])
ifTrue: [ self activeHand releaseMouseFocus: self ].
^ super handleFocusEvent: anEvent

I guess, this will swallow the first scroll event, but all following are
handled by the scroll pane.

We should fix the openModal: method, to only change the mouse focus if the
active focus holder isn't nil.



> Le 20/06/2017 à 21:23, Nicolai Hess a écrit :
> > Hmm.
> > We fixed the mousefocus handling for openModal
> > (see case 14629
> > <https://pharo.fogbugz.com/f/cases/14629/Morphic-click-
> event-and-modal-windows-get-stuck>
> > Morphic click event and modal windows get stuck)
> >
> > But I guess , this now does not work as expected when the actual  mouse
> > focus should be nil.
> > Because now the DrGeoThumbnailDialog holds the mouse focus and does not
> > react on scroll events. Only if the
> > current mouse focus is nil the scrollevents are handled by the
> scrollpane)
> >
>
> --
> Dr. Geo
> http://drgeo.eu
>
>
>


Re: [Pharo-users] Autoformatting in SystemBrowser

2017-06-21 Thread Nicolai Hess
2017-06-21 11:57 GMT+02:00 Marc Hanisch via Pharo-users <
pharo-users@lists.pharo.org>:

>
>
> -- Weitergeleitete Nachricht --
> From: Marc Hanisch 
> To: Any question about pharo is welcome 
> Cc:
> Bcc:
> Date: Wed, 21 Jun 2017 11:57:53 +0200
> Subject: Re: [Pharo-users] Autoformatting in SystemBrowser
> Hello,
>
> it's me again still struggeling with the same issue on two different
> machines: Ubuntu 16.04 and Fedora 25. On all machines the same
> behaviour, I'm getting the error:
>
> "Information
> Pharo cannot locate the sources file named
> /home/marc/PharoWorkspace/Pharo/pharo6.0/bin/lib/pharo/
> 5.0-201705310241/PharoV60.sources.
>
> Please check that the file is named properly and is in the
> same directory as this image."
>
> I'm wondering why Pharo is looking in this folder, because the source
> file is present in the shared folder, where also the default
> Pharo6.0.image and Pharo6.0.changes live in:
>
> /home/marc/PharoWorkspace/Pharo/pharo6.0/PharoWorkspace/
> Pharo/pharo6.0/shared/PharoV60.sources
>
> Any ideas? I'm a little helpless... ;-) Btw. this is Pharo 64bit...
>

Hi, I just tried to reproduce this error, but it is working for me.
I downloaded the
pharo6 image & changes zip
the virtual machin
and the source

from http://pharo.org/download
Unzip all in one directory
start pharo by
./pharo Pharo-6501.image

And I was able to save the image with "save as ..."

How did you installed pharo and how do you start it ?



> Best regards,
> Marc
>
> 2017-06-18 20:46 GMT+02:00 Marc Hanisch via Pharo-users
> :
> >
> >
> > -- Weitergeleitete Nachricht --
> > From: Marc Hanisch 
> > To: Any question about pharo is welcome 
> > Cc:
> > Bcc:
> > Date: Sun, 18 Jun 2017 20:46:31 +0200
> > Subject: Re: [Pharo-users] Autoformatting in SystemBrowser
> > Hi Stephane,
> >
> > Yes it seems to be an issue with the sources file. Maybe my workflow is
> wrong? When I want to store an image somewhere else, I always left+click
> and select save as... to save my image. As far as I understand Pharo, it
> then saves the image and a changes file in the selected directory. The
> sources file should stay in the Pharo distribution folder, under the share
> directory, shouldn't it? The sources file is present in my share folder, I
> don't know why Pharo looks into pharo6.0-64/bin/lib/pharo/5.0-
> > 201705310241/ (that's the path from the error message).
> >
> > ...BTW I'm wondering why the mailing list sends my mails as .eml
> attachments? Did you received my previous mail?
> >
> > Best regards,
> > Marc
> >
>
>
>


Re: [Pharo-users] Custom Glamour browser for Dr. Geo scripting

2017-07-01 Thread Nicolai Hess
2017-06-30 9:55 GMT+02:00 Hilaire :

> I extended the browser definition with:
>
> browser transmit
> from: #scripts;
> from: #categories;
> to: #methods;
> when: [ :a :b |  a isMeta not ];
> andShow: [:a | self methodsIn: a  ].
> browser transmit
> from: #scripts;
> from: #categories;
> to: #methods;
> when: [ :a | a isMeta ];
> andShow: [:a | self classMethodsIn: a  ].
>
>
> However it does not work as #when: message always receive a class, so
> the wrong methods a re list in the method pane.
>
> I enclosed a Fileout of the browser. It works independently of DrGeo.
> When one select class methods, still the instance methods are displayed
> in right most pane.
>
> Any tips?
>

I don't have a solution. I just want to make more clear what the problem is.
See attached screenshot.
The question is, is it possible to make the population of the "methods" list
dependent of the focused "Instance Methods"/"Class Methods" pane ?

I tried to wire a "#focus" port, but I don't think the "categories"-pane
exports
any port that could be used to distinguish between the selected tabs.






>
> Thanks
>
> Hilaire
>
>
> Le 29/06/2017 à 14:59, Hilaire a écrit :
> > but something is missing to get the listed method right depending on the
> > category is instance or class side. I don't how to do it.
>
> --
> Dr. Geo
> http://drgeo.eu
>
>


Re: [Pharo-users] Glamour: update presenter with new text

2017-07-05 Thread Nicolai Hess
2017-07-05 19:43 GMT+02:00 Juraj Kubelka :

> I think the issue is how to update a browser when a method is modified.
> There is a script:
>
> -=-=-=-=-
> browser := GLMTabulator new
> column: #one;
> column: #two;
> column: #three;
> yourself.
> browser transmit to: #one; andShow: [ :composite |
> composite fastList ].
>
> browser transmit from: #one; to: #two; andShow: [ :composite |
> composite wrapper
> title: [ 'Instance' translated ];
> show: [ :wrapper |
> wrapper fastList
> display: [ :aClass | aClass methods ];
> format: [ :aCompiledMethod | aCompiledMethod selector asString ] ].
> composite wrapper
> title: [ 'Class side' translated ];
> show: [ :wrapper |
> wrapper fastList
> display: [ :aClass | aClass class methods ];
> format: [ :aCompiledMethod | aCompiledMethod selector asString ] ].
> *composite updateOn: MethodModified from: [ SystemAnnouncer uniqueInstance
> ].*
> composite onChangeOfPort: #activePresentation act: [ :presentation |
> (presentation pane port: #activePresentation) value
> ifNotNil: [ :activePresentation |
> ((browser paneNamed: #two) port: #selection) value: (activePresentation
> defaultPane port: #selection) value ] ] ].
>
> browser transmit
> from: #two; to: #three;
> andShow: [ :composite | composite text
> display: [ :aCompiledMethod | aCompiledMethod sourceCode ];
> updateOn: MethodModified from: [ SystemAnnouncer uniqueInstance ]. ].
>
> browser openOn: Collection allSubclasses.
> -=-=-=-=-
>

I have some strange behavior with this example.
Saving the edited method in this browser does not actually change the code
shown in a "real" browser.
Saving the edited method in a "real" browser may update the code in this
browser, but sometimes not, and sometimes it even
shows the code from a different method.



>
> I have added the bold line from the previous post: http://forum.world.st/
> Custom-Glamour-browser-for-Dr-Geo-scripting-tp4952920p4953209.html
>
> But it is not perfect, because it does not keep the selection.
>
> Hilaire, it looks like you are going to end up with a simplified
> Nautilus/Calypso system editor.
> Maybe it is possible to take Calypso and find out how to simplify it for
> your needs?
> Well, I am writing it without understanding your goal :-)
>
> Cheers,
> Juraj
>
>
> El 05-07-2017, a las 19:24, Tudor Girba  escribió:
>
> Hi Hilaire,
>
> I think it does fit your problem.
>
> However, I am not sure what the current problem is. Could you describe it
> again in more details?
>
> Cheers,
> Doru
>
>
> On Jul 5, 2017, at 5:10 PM, Hilaire  wrote:
>
> May be my use case does not fit to Glamour, but I am tempted to think it
> does. I really need help on that to make progress.
>
> Thanks
>
> Hilaire
>
> Le 04/07/2017 à 23:08, Hilaire a écrit :
>
> I added these lines of code, but it is not that yet:
>
> browser
> updateOn: GLMItemAdded from: #yourself;
> updateOn: GLMItemRemoved from: #yourself.
>
>
>
> --
> Dr. Geo
>
> http://drgeo.eu
>
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "It's not how it is, it is how we see it."
>
>
>
>


Re: [Pharo-users] The method Form>>rotateBy: slows down if applied several times to the same form

2017-07-10 Thread Nicolai Hess
2017-07-04 23:54 GMT+02:00 Matteo via Pharo-users <
pharo-users@lists.pharo.org>:

>
>
> -- Weitergeleitete Nachricht --
> From: Matteo 
> To: "Pharo is welcome (ML)" 
> Cc:
> Bcc:
> Date: Tue, 4 Jul 2017 23:54:06 +0200
> Subject: The method Form>>rotateBy: slows down if applied several times to
> the same form
> Dears,
>applying the method "Form>>rotateBy:" several times, to the same
> form, the system slows down dramatically, even imposing a 0° rotation.
>
> Below you can find a code snippet, to be run on the playground:
>
> |aForm |
> aForm:= ImageReadWriter formFromFileNamed: 'pharo.png'.
> 10 timesRepeat: [ aForm := aForm rotateBy:90 ].
>
>
> Increasing the number of repetitions the delay get worse.
>
> Does someone else get the same issue?
> Is there something wrong on my code, or in the way I'm using the method?
>
>
>
Hi Matteo,

thanks for this contribution.
It is good that you found out the reason for the slowing down (repeatly
creating a bigger form is of course not good).

I looked at your fix, it seems to work but both new methods are nearly
identically, maybe it would be better to create another method for the
common parts.

And I saw that there is another method

Form
rotateBy: direction centerAt: aPoint

with direction could be either #left or #right and it will rotate cw/ccw by
90 degree

would this be useable for your use case?

nicolai



>
> The test has been launched in a Pharo 6.0 image, Latest update: #60499,
> under Linux 64bit.
>
>
> For this question I opened the FogBugz case n°20216
>
> https://pharo.fogbugz.com/f/cases/20216#BugEvent.190469
>
>
> Thanks,
> Matteo
>
>
>


Re: [Pharo-users] The method Form>>rotateBy: slows down if applied several times to the same form

2017-07-15 Thread Nicolai Hess
2017-07-11 20:59 GMT+02:00 Matteo :

>
>
> On 10/07/17 21:54, Nicolai Hess wrote:
>
>
>
> 2017-07-04 23:54 GMT+02:00 Matteo via Pharo-users <
> pharo-users@lists.pharo.org>:
>
>>
>>
>> -- Weitergeleitete Nachricht --
>> From: Matteo 
>> To: "Pharo is welcome (ML)" 
>> Cc:
>> Bcc:
>> Date: Tue, 4 Jul 2017 23:54:06 +0200
>> Subject: The method Form>>rotateBy: slows down if applied several times
>> to the same form
>> Dears,
>>applying the method "Form>>rotateBy:" several times, to the same
>> form, the system slows down dramatically, even imposing a 0° rotation.
>>
>> Below you can find a code snippet, to be run on the playground:
>>
>> |aForm |
>> aForm:= ImageReadWriter formFromFileNamed: 'pharo.png'.
>> 10 timesRepeat: [ aForm := aForm rotateBy:90 ].
>>
>>
>> Increasing the number of repetitions the delay get worse.
>>
>> Does someone else get the same issue?
>> Is there something wrong on my code, or in the way I'm using the method?
>>
>>
>>
> Hi Matteo,
>
> thanks for this contribution.
> It is good that you found out the reason for the slowing down (repeatly
> creating a bigger form is of course not good).
>
> I looked at your fix, it seems to work but both new methods are nearly
> identically, maybe it would be better to create another method for the
> common parts.
>
> And I saw that there is another method
>
> Form
> rotateBy: direction centerAt: aPoint
>
> with direction could be either #left or #right and it will rotate cw/ccw
> by 90 degree
>
> would this be useable for your use case?
>
> nicolai
>
>
>
>
>
> Hi Nicolai,
> you're right: my methods "rotateByQuarterCCW" and "rotateByQuarterCW"
> are redundant.
>
> The method "rotateBy: direction centerAt: aPoint" does the same thing.
>
>
> Sorry for the trouble, but I got misled be the selectors:
> "rotateBy:"
> "rotateBy:smoothing:"
> "rotateBy:magnify:smoothing:"
>
> that works differently than "rotateBy:centerAt:".
>
>
>
> What should I do with the fogbugz n° 20216?
>
> Thanks,
> Matteo
>

Yes, I think it is Ok, to close the issue (as you already did).
And it is good to comment why this is closed and what method can be used
instead.

Thank you Matteo.






>
>
>
>


Re: [Pharo-users] How to run a window in full-screen mode?

2017-07-17 Thread Nicolai Hess
2017-07-17 15:50 GMT+02:00 Luke Gorrie :

> Hoi!
>
> I am looking for a way to run a window in full-screen mode in Pharo. That
> is it should maximize, beyond the bounds that the expand button usually
> takes, and it should automatically resize when the world does.
>
> I'm thinking of the GTInspector but a custom class would be fine too.
>
> Is there a simple solution?
>
> On Discord I got a partial solution:
>
> window := GTInspector openOn: self.
> window
>   removeBoxes;
>   beSticky;
>   bounds: window world clearArea.
>
> but the main problem here is that it doesn't resize when the world does.
>
> I wonder if it would make more sense to avoid the SystemWindow and embed
> the inspector directly in the World somehow...?
>
> Cheers!
> -Luke
>
>
There is a FullscreenMorph

see for example
StandardWindow>>#openFullscreen


Re: [Pharo-users] could not find module vm-display-X11

2017-07-19 Thread Nicolai Hess
Looks like libgl is the issue


Am 19.07.2017 9:47 vorm. schrieb "Hilaire" :

> Hi,
>
> It does not work on a new installed system. It is related to the installed
> system, other report it to me with the same system
>
> Le 19/07/2017 à 00:01, Alistair Grant a écrit :
>
> Is this something that was working and has suddenly stopped, or a new
> install that doesn't work?
>
> Assuming that it is installed correctly, can you provide the output of:
>
> cd /to/where/the/pharo/exe/is
> ldd pharo
>
> ldd pharo
> linux-gate.so.1 =>  (0xf000)
> libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7705000)
> libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf770)
> libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf76e2000)
> libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf752c000)
> /lib/ld-linux.so.2 (0x5655a000)
>
> ldd vm-display-X11
>
> ldd vm-display-X11
> linux-gate.so.1 =>  (0xf773a000)
> libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf76e4000)
> libGL.so.1 => not found
> libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xf7598000)
> libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf73e2000)
> /lib/ld-linux.so.2 (0x56649000)
> libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf73bc000)
> libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf73b7000)
> libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xf73b3000)
> libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf73ab000)
>
>
>
>
> Cheers,
> Alistair
>
>
> --
> Dr. Geohttp://drgeo.eu
>
>


Re: [Pharo-users] Pharo 6, scrolling with 2 fingers on a Mac trackpad is very erratic

2017-07-23 Thread Nicolai Hess
2017-07-23 17:41 GMT+02:00 Tim Mackinnon :

> Hi - I’m wondering if anyone else has noticed that in Pharo 6, when you
> scroll on a MacBook trackpad with 2 fingers, that strange things happen,
> particularly if you do it quickly.
>
> For example, in a system browser if you expand the configurations tree and
> scroll through it, it very often just suddenly closes that tree and just
> selects the “Last Modified Methods” and “Configurations” list items. OR it
> will keep jumping to the top of the list and start scrolling down again. I
> see this latter behaviour when scrolling through methods of a class as well.
>
> I haven’t noticed it in other applications, and its possible its my laptop
> or maybe settings I have on it - but I’m curious if others have seen the
> same behaviour?
>
> I will go back and check a Pharo 3 or 5 image and see if its the same back
> there.
>
> Tim
>

there is (or was ? ) an issue on fogbugz about this.


Re: [Pharo-users] Issue with the --headless option on Windows 10

2017-07-26 Thread Nicolai Hess
2017-07-26 11:53 GMT+02:00 Sven Van Caekenberghe :

>
> > On 25 Jul 2017, at 19:46, Cyril Ferlicot D. 
> wrote:
> >
> > Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :
> >> Hi,
> >>
> >> User Herby Vojčík seems to have an issue with the --headless option on
> Windows 10
> >>
> >> https://pharo.fogbugz.com/f/cases/20271/ZnServer-
> managedServers-disappear-when-headless-mode-used
> >>
> >> I cannot reproduce his problem.
> >>
> >> Maybe there are Windows users out there who can have a look and help
> him ?
>
> Anyone ?
>
> >> Thx,
> >>
> >> Sven
> >>
> >>
> >
> > Hi,
> >
> > I am not sure but I think that in Windows the option to use is not
> > --headless but --nodisplay.
>
> I just tried a bit using Pharo 6.1 on Windows 10 in command line mode
> (Command Prompt). It seems that apart from starting an image (and executing
> a .st file) not much else works. I can't get any of the normal Pharo
> command line handling to work, it feels as if none of the VM flags have any
> effect. Output is only written to a file. The windows with the World always
> opens. I can't see a difference between Pharo.exe and PharoConsole.exe
>
> Even the simplest thing like
>
>   Pharo.exe Pharo.image eval '1+2'
>
> Doesn't work as expected.
>
> Quite unusable.
>
> Maybe this is not supposed to work ?
>
> Can anyone help a bit here ?
>

I can not test Windows 10 at the moment, but on windows 7

pharo --headless Pharo6.1.image eval "DateAndTime now"

Works, no window opens, and it puts the output of the evaluation in a
stdout-file.






>
> > --
> > Cyril Ferlicot
> > https://ferlicot.fr
> >
> > http://www.synectique.eu
> > 2 rue Jacques Prévert 01,
> > 59650 Villeneuve d'ascq France
> >
>
>
>


Re: [Pharo-users] Issue with the --headless option on Windows 10

2017-07-26 Thread Nicolai Hess
2017-07-26 12:09 GMT+02:00 :

>
>
> On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe <
> s...@stfx.eu> wrote:
> >
> >> On 25 Jul 2017, at 19:46, Cyril Ferlicot D.
> > wrote:
> >>
> >> Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :
> >>> Hi,
> >>>
> >>> User Herby Vojčík seems to have an issue with the --headless option
> >on Windows 10
> >>>
> >>>
> >https://pharo.fogbugz.com/f/cases/20271/ZnServer-
> managedServers-disappear-when-headless-mode-used
> >>>
> >>> I cannot reproduce his problem.
> >>>
> >>> Maybe there are Windows users out there who can have a look and help
> >him ?
> >
> >Anyone ?
> >
>

I can reproduce the strange output:

pharo --headless Pharo.image st sample.st

with sample.st contains

(ZnServer startOn: ) register.
Smalltalk snapshot: true andQuit: true.

Now starting the pharo image in gui mode

pharo --headless Pharo.image

I can access localhost:

but
ZnServer managedServers evaluates to "an IdentitySet()"

running

pharo --headless Pharo.image eval "ZnServer managedServers" shows
an IdentitySet(a ZnManagingMultiThreadedServer(stopped ))

running eval without headless option:

pharo Pharo.image eval "ZnServer managedServers"
the set is again empty:
an IdentitySet()


Re: [Pharo-users] Issue with the --headless option on Windows 10

2017-07-26 Thread Nicolai Hess
2017-07-26 13:08 GMT+02:00 Herby Vojčík :

> Nicolai Hess wrote:
>
>>
>>
>> 2017-07-26 12:09 GMT+02:00 mailto:he...@mailbox.sk>>:
>>
>>
>>
>> On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe
>> mailto:s...@stfx.eu>> wrote:
>> >
>> > > On 25 Jul 2017, at 19:46, Cyril Ferlicot D.
>> >mailto:cyril.ferli...@gmail.com>> wrote:
>> > >
>> > > Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :
>> > >> Hi,
>> > >>
>> > >> User Herby Vojčík seems to have an issue with the --headless
>> option
>> >on Windows 10
>> > >>
>> > >>
>> >https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedSer
>> vers-disappear-when-headless-mode-used
>> <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedSer
>> vers-disappear-when-headless-mode-used>
>> > >>
>> > >> I cannot reproduce his problem.
>> > >>
>> > >> Maybe there are Windows users out there who can have a look and
>> help
>> >him ?
>> >
>> >Anyone ?
>> >
>>
>>
>> I can reproduce the strange output:
>>
>> pharo --headless Pharo.image st sample.st <http://sample.st>
>>
>> with sample.st <http://sample.st> contains
>>
>> (ZnServer startOn: ) register.
>> Smalltalk snapshot: true andQuit: true.
>>
>> Now starting the pharo image in gui mode
>>
>> pharo --headless Pharo.image
>>
>
> This should probably be without --headless to be less strange (running in
> gui mode does not need --headless, if --headless starts gui without cli
> args in Win, that is probably another issue that should be raised for win
> vm)
>

Oh, yes of course, I meant running
pharo Pharo.image


>
> I can access localhost:
>>
>> but
>> ZnServer managedServers evaluates to "an IdentitySet()"
>>
>> running
>>
>> pharo --headless Pharo.image eval "ZnServer managedServers" shows
>> an IdentitySet(a ZnManagingMultiThreadedServer(stopped ))
>>
>
> Wow, it did not come to my mind to check that. That means it is indeed the
> headless to gui transition that is problematic as headless to headless is
> fine.
>
> running eval without headless option:
>>
>> pharo Pharo.image eval "ZnServer managedServers"
>> the set is again empty:
>> an IdentitySet()
>>
>>
>>
> Thanks, Herby
>
>
It lools like ZnServer resets the ManagedServers variable, if the image
starts without the headless option.


Re: [Pharo-users] Issue with the --headless option on Windows 10

2017-07-26 Thread Nicolai Hess
2017-07-26 13:16 GMT+02:00 Herby Vojčík :

> Nicolai Hess wrote:
>
>>
>>
>> 2017-07-26 13:08 GMT+02:00 Herby Vojčík > <mailto:he...@mailbox.sk>>:
>>
>> Nicolai Hess wrote:
>>
>>
>>
>> 2017-07-26 12:09 GMT+02:00 > <mailto:he...@mailbox.sk> <mailto:he...@mailbox.sk
>> <mailto:he...@mailbox.sk>>>:
>>
>>
>>
>>  On July 26, 2017 11:53:41 AM GMT+02:00, Sven Van Caekenberghe
>> mailto:s...@stfx.eu> <mailto:s...@stfx.eu
>> <mailto:s...@stfx.eu>>> wrote:
>> >
>> >  > On 25 Jul 2017, at 19:46, Cyril Ferlicot D.
>> >mailto:cyril.ferli...@gmail.com>
>> <mailto:cyril.ferli...@gmail.com
>> <mailto:cyril.ferli...@gmail.com>>> wrote:
>> >  >
>> >  > Le 25/07/2017 à 19:37, Sven Van Caekenberghe a écrit :
>> >  >> Hi,
>> >  >>
>> >  >> User Herby Vojčík seems to have an issue with the
>> --headless option
>> >on Windows 10
>> >  >>
>> >  >>
>> >https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedSer
>> vers-disappear-when-headless-mode-used
>> <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedSer
>> vers-disappear-when-headless-mode-used>
>> <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedSer
>> vers-disappear-when-headless-mode-used
>> <https://pharo.fogbugz.com/f/cases/20271/ZnServer-managedSer
>> vers-disappear-when-headless-mode-used>>
>> >  >>
>> >  >> I cannot reproduce his problem.
>> >  >>
>> >  >> Maybe there are Windows users out there who can have a look
>> and help
>> >him ?
>> >
>> >Anyone ?
>> >
>>
>>
>> I can reproduce the strange output:
>>
>> pharo --headless Pharo.image st sample.st <http://sample.st>
>> <http://sample.st>
>>
>> with sample.st <http://sample.st> <http://sample.st> contains
>>
>>
>> (ZnServer startOn: ) register.
>> Smalltalk snapshot: true andQuit: true.
>>
>> Now starting the pharo image in gui mode
>>
>> pharo --headless Pharo.image
>>
>>
>> This should probably be without --headless to be less strange
>> (running in gui mode does not need --headless, if --headless starts
>> gui without cli args in Win, that is probably another issue that
>> should be raised for win vm)
>>
>>
>> Oh, yes of course, I meant running
>> pharo Pharo.image
>>
>>
>> I can access localhost:
>>
>> but
>> ZnServer managedServers evaluates to "an IdentitySet()"
>>
>> running
>>
>> pharo --headless Pharo.image eval "ZnServer managedServers" shows
>> an IdentitySet(a ZnManagingMultiThreadedServer(stopped ))
>>
>>
>> Wow, it did not come to my mind to check that. That means it is
>> indeed the headless to gui transition that is problematic as
>> headless to headless is fine.
>>
>> running eval without headless option:
>>
>> pharo Pharo.image eval "ZnServer managedServers"
>> the set is again empty:
>> an IdentitySet()
>>
>>
>>
>> Thanks, Herby
>>
>>
>> It lools like ZnServer resets the ManagedServers variable, if the image
>> starts without the headless option.
>>
>
> The problem is not image started without headless. It works fine if it
> started without headless, just the sample.st must also be run without
> headless. Only problem is sample.st run with headless and subsequently
> image run without headless.
>
> It unregisters it as a result of [ :each | each start ] during startup
> phase in which the server(s) is(are) already in running state, as shown in
> my last pharodebug.log posted here.
>
> Maybe it launches startup phase twice, first doing it correctly, second
> time failing it because start message is in fact
> startWhenStoppedButRestartAndUnregisterWhenRunnning.
>
> Herby
>
>
Another interesting observation:

pharo Pharo.image
-> The window opens
now use the maximize window icon (on the pharo main window titlebar). Save
and quit

pharo --headless Pharo.image eval "3+4"
-> the window opens for a short time

pharo Pharo.image
-> the window opens
now, even so the main window has the same same, it is not "maximized",
don't change this, just do again a save and quit

pharo --headless Pharo.image eval "3+4"
-> now window opens, it just evaluates the command line


Re: [Pharo-users] Loading PharoJS Re: PharoJS

2017-08-16 Thread Nicolai Hess
Hi Pierce

2017-06-25 13:07 GMT+02:00 Pierce Ng :

> Just tried loading PharoJS with this snippet:
>
>   Gofer it
> smalltalkhubUser: 'noury' project: 'PharoJS';
> configuration;
> loadStable
>
> Loaded cleanly on a fresh 32-bit Pharo-50772 image. Ran almost half the
> tests
> during which it created/deleted tabs on my open Chromium browser
> repeatedly.
> Then the tests started a new instance of my default browser (which happens
> to
> be Midori) and here seemingly the web socket stuff didn't work so well, so
> I
> aborted the tests, but this I attribute to Midori not PharoJS.
>
> On a fresh 64-bit Pharo-60501 image, while loading
> PharoJSBridge-NouryBouraqadi-120, error encountered:
>
>   SyntaxError: Variable or expression expected
>   Object as yet unclassified makeInspect
>
>   makeInspect.
> Variable or expression expected->  blah blah
> }'>
>
>
I think the problem is the '.' dot after the selector name.
This is not valid code for a method definition.
I think this was an error on this parser to allow the code in the first
place. Now we
"fixed" the parser to indicate this as an error.

Of course it would be good to replace / fix the method definition right on
this debugger window, and move on with loading th
code. But I am afraid this does not work.
So, someone (with an older Pharo version where this code gets compiled)
need to load the package and fix the method



> Closing the error alert box brought up a debugger at
> RBParser>>parserError:.
>
> Any idea what to fix, anyone?
>
> Pierce
>
>
>


Re: [Pharo-users] Pharo 6.1 debugger - suggestions break once, does funny things?

2017-09-12 Thread Nicolai Hess
2017-09-11 1:26 GMT+02:00 Tim Mackinnon :

> While I’m on a debugger trip… anyone else also notice that the
> Suggestions, Break once debug option acts weirdly? I seem to get a debugger
> but it halts several lines after where I have said, and if I start stepping
> the debugger seems to jump to funny places and show values that don’t line
> up with what I know is happening? If I use Suggestions, Break it seems to
> work correctly (apart from the Step Through I mentioned in another thread).
>
> Tim
>


Thats because the "Break once" creates a MetaLink that when executing this
Metalink it removes itself from the methode prior to the break-command. If
now  the debugger opens the method, it executes a context to a method that
already had changed. (the actual method bytecode only exists in the current
context).

You can see the "real" bytecode of the contexts method if you select GTs
bytecode view.


Re: [Pharo-users] Iceberg and proxy

2017-10-04 Thread Nicolai Hess
2017-10-03 20:58 GMT+02:00 Guillermo Polito :

> Well, LGitFetchOptions has a proxy options property of type LGitProxyOptions,
> and this one a property type of type LGitProxyTypeEnum. I did not try it
> but maybe it should look something like:
>
> fetchOptions prim_proxy_opts prim_type: LGitProxyTypeEnum git_proxy_auto.
>
> ?
>
> if fetchOptions is null you'll have to instantiate one. The same if a
> fresh fetchOptions does not have a prim_proxy_opts
>


And how to do a initial copy of a remote repository, if we are behind a
proxy?

@vito, who did you created the clone ? I can not clone a repository when I
am behind a proxy.


>
> On Tue, Oct 3, 2017 at 6:36 PM, Vitor Medina Cruz 
> wrote:
>
>> Couldn't figure out how to configure a LGitFetchOptionswith a
>> LGitProxyOptions accepting one of the auto/none/specified from
>> LGitProxyTypeEnum. Can you provide an example?
>>
>> On Tue, Oct 3, 2017 at 1:06 PM, Guillermo Polito <
>> guillermopol...@gmail.com> wrote:
>>
>>> I know, but a LGitProxyOptions accepts one.
>>>
>>> On Tue, Oct 3, 2017 at 5:57 PM, Vitor Medina Cruz 
>>> wrote:
>>>
 Nope, auto/none/specified returned objects are not compatible to the
 expected one received by prim_proxy_opts:

 On Tue, Oct 3, 2017 at 11:16 AM, Guillermo Polito <
 guillermopol...@gmail.com> wrote:

> Check that LGitFetchOptions has a pair of accessors prim_proxy_opts.
> Maybe you can configure it with a LGitProxyTypeEnum which has values
> auto/none/specified?
>
> On Tue, Oct 3, 2017 at 3:52 PM, Vitor Medina Cruz <
> vitormc...@gmail.com> wrote:
>
>> I got to this point:
>>
>> remote_fetch: remote refspecs: refspecs opts: opts reflog_message:
>> reflog_message
>>
>>  ^ self
>>  call:
>>  #(LGitReturnCodeEnum git_remote_fetch #(self , void * refspecs ,
>> LGitFetchOptions * opts , String reflog_message))
>>  options: #(optCoerceNilToNull)
>>
>> This seams like a call to a native C code. The opts has an
>> authentication callback, which should be called, but it is not. Any leads
>> on what I can do from here to figure out what is happening?
>>
>> On Tue, Oct 3, 2017 at 9:09 AM, Guillermo Polito <
>> guillermopol...@gmail.com> wrote:
>>
>>> Looks like it's an iceberg/libgit problem. We should set the proxy
>>> to libgit :)
>>>
>>> https://libgit2.github.com/libgit2/#HEAD/search/proxy
>>>
>>> On Tue, Oct 3, 2017 at 2:03 PM, Vitor Medina Cruz <
>>> vitormc...@gmail.com> wrote:
>>>
 Yes, I already done that. I am behind a NTLM proxy, so I set up a
 cntlm proxy and configured Pharo settings accordingly. It is working
 because I can use Zinc directly, but Iceberg cannot pull/push. I tried 
 the
 same at home without a proxy and I could not pull/push either, so it
 probably has nothing to do with the proxy.

 I will investigate more….

 On Tue, Oct 3, 2017 at 5:31 AM, Guillermo Polito <
 guillermopol...@gmail.com> wrote:

> You should probably set the proxy in the Pharo settings. Pharo
> does not recognize the system's proxy (so far).
>
> Could you try with that?
>
> Guille
>
> On Mon, Oct 2, 2017 at 4:35 PM, Vitor Medina Cruz <
> vitormc...@gmail.com> wrote:
>
>> git push via command line works fine. When I try to pull, for
>> example, from Iceberg it says "a connection with the server cannot be
>> estabilished". I am using a cntlm bypass proxy with loggin on, and 
>> Iceberg
>> is using it, but it fails while normal Zinc usage is ok.
>>
>> I will try to understand better what is happening
>>
>> On Mon, Oct 2, 2017 at 3:59 PM, Esteban Lorenzano <
>> esteba...@gmail.com> wrote:
>>
>>> hi,
>>>
>>> if you have the ssh port restricted, you need to use one that is
>>> not…but then, is not clear how it will work on server side.
>>> can you try if you can do command line git push in your project?
>>>
>>> Esteban
>>>
>>> On 2 Oct 2017, at 19:57, Vitor Medina Cruz 
>>> wrote:
>>>
>>> Hello!
>>>
>>> Iceberg don’t work behind a proxy? I have made proper proxy
>>> configuration, if I use Zinc, for example, the proxy information is 
>>> used,
>>> but that don’t seems to be the case for Iceberg.
>>>
>>> Regards,
>>>
>>> Vito
>>>
>>>
>>>
>>
>
>
> --
>
>
>
> Guille Polito
>
> Research Engineer
>
> Centre de Recherche en Informatique, Signal et Automatique de Lille
>
> CRIStAL - UMR 9189
>
> French National Center f

Re: [Pharo-users] [Ann] PharoLauncher v1.0.1 released!

2017-10-07 Thread Nicolai Hess
Just starting pharolauncher on windows still does not work (if you put it
into the default "program" folder).
On start, it tries to create a local direcitory "pharo-local" and does not
have the permission to do so.
You need to start it with admin-rights.

2017-10-06 22:43 GMT+02:00 Gabriel Cotelli :

> I've tried running it from the terminal and it works!.
>
> If I double-click it from the file manager and choose "Run in Terminal" it
> gives the previously commented error.
>
>
>
> On Fri, Oct 6, 2017 at 5:35 PM, Christophe Demarey <
> christophe.dema...@inria.fr> wrote:
>
>> Hi Gabriel,
>>
>> Le 6 oct. 2017 à 15:48, Gabriel Cotelli  a écrit :
>>
>> I've tried it on Linux, and after the download has finished it cannot
>> launch a Pharo 6.1 image. Find attached the PharoDebug.log
>>
>> Seems it's searching for the sources file in a wrong location.
>> *Pharo cannot locate the sources file named
>> /home/gcotelli/Pharo/pharo-launcher/bin/lib/pharo/5.0-201707201942/PharoV60.sources.*
>>
>>
>> Strange indeed!
>> I’m not able to reproduce it on my ubuntu vm.
>>
>> It’s surprising that sources file is search in the folder of the VM
>> shipped with the launcher. Images are run with VM downloaded in the VM
>> store ($HOME/Pharo/vms) and sources file is search in the vm directory.
>> Could you tell me if you run the launcher from a terminal? Could you send
>> me your environment variables to see if I can find something relevant there?
>>
>
>


Re: [Pharo-users] [Ann] PharoLauncher v1.0.1 released!

2017-10-07 Thread Nicolai Hess
2017-10-07 9:38 GMT+02:00 Nicolai Hess :

> Just starting pharolauncher on windows still does not work (if you put it
> into the default "program" folder).
> On start, it tries to create a local direcitory "pharo-local" and does not
> have the permission to do so.
> You need to start it with admin-rights.
>


Starting images for different vms works great.
No more need to manually fight with downloading vms or source files :)
Great!


>
> 2017-10-06 22:43 GMT+02:00 Gabriel Cotelli :
>
>> I've tried running it from the terminal and it works!.
>>
>> If I double-click it from the file manager and choose "Run in Terminal"
>> it gives the previously commented error.
>>
>>
>>
>> On Fri, Oct 6, 2017 at 5:35 PM, Christophe Demarey <
>> christophe.dema...@inria.fr> wrote:
>>
>>> Hi Gabriel,
>>>
>>> Le 6 oct. 2017 à 15:48, Gabriel Cotelli  a écrit :
>>>
>>> I've tried it on Linux, and after the download has finished it cannot
>>> launch a Pharo 6.1 image. Find attached the PharoDebug.log
>>>
>>> Seems it's searching for the sources file in a wrong location.
>>> *Pharo cannot locate the sources file named
>>> /home/gcotelli/Pharo/pharo-launcher/bin/lib/pharo/5.0-201707201942/PharoV60.sources.*
>>>
>>>
>>> Strange indeed!
>>> I’m not able to reproduce it on my ubuntu vm.
>>>
>>> It’s surprising that sources file is search in the folder of the VM
>>> shipped with the launcher. Images are run with VM downloaded in the VM
>>> store ($HOME/Pharo/vms) and sources file is search in the vm directory.
>>> Could you tell me if you run the launcher from a terminal? Could you
>>> send me your environment variables to see if I can find something relevant
>>> there?
>>>
>>
>>
>


Re: [Pharo-users] Behold Pharo: The Modern Smalltalk

2017-10-12 Thread Nicolai Hess
2017-10-12 9:28 GMT+02:00 Dimitris Chloupis :

>
>
>
>> This is what Smalltalk gives you for free.
>>
> Sorrry for being rude but I wll use the two usually heavily annoying word,
> at least for me :D
>
> It depends
>
> See there is a problem for Python here. Ideology.
>
> The zen of python has been both a joke a serious mantra in the python
> world . Its a joke because its obviously oversimplify decision making in
> such a complex subject as language designe but is serious because it
> clearly illustrates the philosophy of its creator, Guido van Rossum.
>
> https://www.python.org/dev/peps/pep-0020/
>
>  Guido is not any less of a rock star to Pythoners than Alan Kay is for
> Smalltalkers. The zen has become so popular that is even included in python
> implementation and can be fetched as the link says using the "import this"
> in any implementation of Python. It's the very sould of python as messages
> and objects are the very soul of Smalltalk.
>
> So the problem here is that a live coding enviroment brakes the second
> rule. "explicit is better than implicit". Because live coding in Pharo and
> Smaltalk is about replacing old instances with new while keeping the state
> it non the less an implicit behavior and especially become is a no go
> scenario for python because not only replaces references to an object it
> also breaks the references to the other object. Of course the old object is
> garbage collected and RIP. Python follows this rule very strictly.
>
> Thus means that not only that Python will not offer a live coding
> enviroment in the future as the basis of its implementation . It means it
> does not want to. It may offer it as part of its extensive library.
>
> That also leads us to the inescapable conclusion that nothing comes free,
> everything has a cost. Because there will be scenarios you dont want to
> lose your old instances or not affect them at all and instead affect only
> the classes or maybe you dont even want to do that and want to do something
> else.
>


Hm, we have our own Pharo Zen, which includes a
Explicit is better than implicit.
So we are violating our own (zen)rules :)

in my point of view, live or interactive coding has not much to do with
explicit or implicit program code.


Re: [Pharo-users] Behold Pharo: The Modern Smalltalk

2017-10-13 Thread Nicolai Hess
Am 13.10.2017 5:50 PM schrieb "Andrew Glynn" :

I can't remember ever using API docs in *any* language, dynamic or not.
They give you the method signatures, but if you have, say, methodX(int,
int, String), how are you supposed to guess what ints and what String the
method actually needs,


Isn't this exactly what an apidoc is for? Additional documentation to
describe the methods and   arguments purpose.

Maybe you have just seen poorly documented libraries?


One of my favourite language fails can be reproduced by doing this:

Declare a field private final in Java, initializing it either in the
declaration or the constructor, and provide only a getter. Use the getter
from another class and change the value of the local variable. Then use the
getter again, but assign the value to a new local variable, and check the
value.


Maybe you should re-read about javas  final keyword.
It is not to meant making something immutable ,
you can just not reassign a new value.

Java final != c++ const


Re: [Pharo-users] Behold Pharo: The Modern Smalltalk

2017-10-13 Thread Nicolai Hess
2017-10-13 22:04 GMT+02:00 Andrew Glynn :

> I understand why it occurs, both the private and the final keyword
> affect the reference rather than the object. However, to quote someone
> else "That the value of a private field can be changed without a public
> setter implies that encapsulation is weak at best, and shouldn't be
> counted on to protect key values, even in combination with the final
> keyword." Even that comment, though, brings in the notion of a 'value'
> that's not an object.
>

and who did you quote ?



>
> My point initially was not about the code, but about the Java API doc
> that also claims attempting to change the *value* will result in a compile
> error. Although keywords affect references, the documentation states
> that it affects 'the value', which is at best ambiguous.
>

I can not see what is wrong here.
You are problably confused by
- the value of a *variable*
- and the value an *object* represents (its object state)
the first can not be changed for a final variables
the last can only be preserved, if the object is immutable.



> There are also numerous issues around type erasure
>

... this seems a bit off topic


> I'd rather have *no* API documentation than documentation of the sort
> represented by the Java API doc.
>

I  think a java api doc like documentation would help.
For newcomers, that not yet know ( or know how to find) the in-image help.
And even so we can easily browse our code with comments and class comments,
an API-doc could provide the help from a different view (group by
collaboration rather
then by class hierarchy or packages), give an "overall" view or provide
additional code examples.



> Not that I think it's all
> intentional, though perhaps the primitives and scalars that are in fact
> objects
>

How are java primitives "in fact" objects ? They are "in fact" primitives.
This is different from
smalltakl where some *objects* like Smallinteger are implemented as
primitives (or immediates)
but still objects on the (smalltalk) code level.


> and collections may have been to muffle wailing from C/C++
> programmers that the lack of primitives and scalars would kill
> performance. I suspect it's more often a result of unsuccessfully
> mode-switching, though, between the rules of the language you're
> implementing and those of the language you're implementing *in*, but that
> only makes the case for languages implemented in themselves stronger.
>
> Andrew
>
>
> -Original Message-
>
> Date: Fri, 13 Oct 2017 18:39:59 +0200
> Subject: Re: [Pharo-users] Behold Pharo: The Modern Smalltalk
> To: Any question about pharo is welcome 
> Reply-to: Any question about pharo is welcome  us...@lists.pharo.org>
> From: Nicolai Hess 
>
>
> Am 13.10.2017 5:50 PM schrieb "Andrew Glynn" :
> I can't remember ever using API docs in any language, dynamic or not.
> They give you the method signatures, but if you have, say, methodX(int,
> int, String), how are you supposed to guess what ints and what String
> the method actually needs,
>
>
> Isn't this exactly what an apidoc is for? Additional documentation to
> describe the methods and   arguments purpose.
>
> Maybe you have just seen poorly documented libraries?
>
>
> One of my favourite language fails can be reproduced by doing this:
>
> Declare a field private final in Java, initializing it either in the
> declaration or the constructor, and provide only a getter. Use the getter
> from another class and change the value of the local variable. Then use the
> getter again, but assign the value to a new local variable, and check the
> value.
>
>
>
> Maybe you should re-read about javas  final keyword.
> It is not to meant making something immutable ,
> you can just not reassign a new value.
>
> Java final != c++ const
>
>
>
>


Re: [Pharo-users] Using a TreePresenter

2017-12-10 Thread Nicolai Hess
2017-11-27 20:40 GMT+01:00 Prof. Andrew P. Black :

> I'm trying to use a (subclass of a) TreePresenter that is populated with
> FileReferences. I see that the current selection is, reasonably enough, a
> TreeNodePresenter, so I'm assuming that to *set* a selection
> programatically, I'm going to have to find the right TreeNodePresenter.
>
> So I've assumed a method allItemsDo: that I'm trying to write on my
> subclass of TreePresenter that will iterate through all of the TreeNodes
> and let me do stuff, such as looking at their #content to see if this is a
> node that I'm interested in.
>
> But I can't! The #roots method of TreePresenter doesn't give me the root
> TreeNodePresenters; it gives me the file references that they contain. How
> do I iterate over the TreeNodePresenters? Or am I going about this in
> entirely the wrong way?
>

I find the way the TreeNodeModel (or TreeNodePresenter) is used strange too.
I think it is to tightly bound to the underlaying morphic tree ui.
(seems a TreeNode is only created during morphic interaction).

What I have seen on some other projects (pharo launcher for example). They
are creating a TreeNode when building the root of the tree itself.

tree roots: (something that creates the root "raw nodes") collect:[:item |
build a TreeNode with this content].

But this does not fully work, as for example

tree root last selected:[true] "< really selects the item"

tree root last selectAllChildren "< still does not change the selection of
the nodes in the tree morph."




>
> Andrew
>
>


Re: [Pharo-users] Athens error

2017-12-26 Thread Nicolai Hess
Running your drgeo.image on a recent linux pharo 64 bit vm gives this error
message first:

/home/nicolai/devel/pharo/Pharo7.0-32bit-52a28a8.sources.

With pharo 7, every (bootstrapped)image needs its own sources file?


2017-12-26 11:59 GMT+01:00 Hilaire :

> Just make a drgeo build with latest image as of today, the problem is the
> same with latest image, as long as the source file is not present. Here is
> the newest built[1]
>
> Hilaire
>
>
> [1] https://www.dropbox.com/s/wc18e21p371z28f/DrGeo.app-18.01a.zip?dl=0
>
> Le 26/12/2017 à 11:15, Pavel Krivanek a écrit :
>
>> Hi Hilaire
>>
>> your P7 image is older and has problems with FreeType fonts
>> initialization that should be fixed in the newest builds. Maybe that is
>> cause of the Athens issues you are facing. Please upgrade.
>>
>>
> --
> Dr. Geo
> http://drgeo.eu
>
>
>
>


Re: [Pharo-users] Breakpoints in Pharo

2017-12-27 Thread Nicolai Hess
Works for me too (on windows).
But sometimes, a change and accept of the current method, does not removes
the "Breakpoint"-Icon.
So, it looks like there is a breakpoint, but isn't anymore and the code of
course does not trigger the debugger.
The icon vanishes, if I unselect and select the current method.

2017-12-27 10:27 GMT+01:00 kmo :

> Just tried it in Pharo 6.1 on Linux 32 bit. Breakpoints work. So presumably
> this is a Pharo on Windows issue.
>
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] Breakpoints in Pharo

2017-12-27 Thread Nicolai Hess
2017-12-27 10:49 GMT+01:00 Denis Kudriashov :

>
> 2017-12-27 10:37 GMT+01:00 Nicolai Hess :
>
>> Works for me too (on windows).
>> But sometimes, a change and accept of the current method, does not
>> removes the "Breakpoint"-Icon.
>> So, it looks like there is a breakpoint, but isn't anymore and the code
>> of course does not trigger the debugger.
>> The icon vanishes, if I unselect and select the current method.
>>
>
> I think it is fixed in Calypso
>

In Nautilus, I traced this bug back to

NautilusUI>>methodModified: anAnnouncement
...

(selectedMethod  = oldMethod  )
ifTrue: [
self sourceTextModel hasUnacceptedEdits
ifTrue: [
self forceSelectedMethod: method.
self updateCategoryAndMethodList.
self highlightCategory: method]
ifFalse: [

self selectedMethod: method.
self updateCategoryAndMethodList ]]
ifFalse: [self updateCategoryAndMethodList
]"<<< If compiled method changed, we do not call
forceSelectMethod, which would reset the icon styler"













>
> 2017-12-27 10:27 GMT+01:00 kmo :
>>
>>> Just tried it in Pharo 6.1 on Linux 32 bit. Breakpoints work. So
>>> presumably
>>> this is a Pharo on Windows issue.
>>>
>>>
>>>
>>>
>>> --
>>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>>
>>>
>>
>


Re: [Pharo-users] Is there a way to set form colours using a 'fuzzy' option?

2017-12-28 Thread Nicolai Hess
You can draw a new form with copybits and use your own color mapping.

First, I thought there would be a bitblt operation that you could use
without explicit calculating the color mapping, a paint operation that
would convert a gray-value to an alpha value. But I could find it.

In this special case (black text on white background) you can use an
existing method for calculating this color map. This method is used by
strike font to create apropriate glyph forms from its font bitmap. (A large
bitmap with black characters on a white background.)

Here is an example that first, creates a form with black text on white
background, and than computes the color map and copys the source form in a
new form:

"create a test form "
sourceForm := Form extent: 300@150 depth: 32.
sourceForm fillColor: Color white.

"draw some black, bold text"
text := 'Hello World' asText.
text addAttribute: (TextFontReference toFont: (LogicalFont familyName:
'Source Sans Pro' pointSize: 32)).
text addAttribute: (TextColor color: Color black).
text addAttribute: (TextEmphasis bold).
text asMorph drawOn: sourceForm getCanvas.

"create a morph for displaying this form"
sourceImageMorph := ImageMorph withForm: sourceForm.
sourceImageMorph openInWorld; topLeft: 300@300.

"calculate the colormap"
colorMap := Color computeColorConvertingMap: Color black from: 32 to: 32
keepSubPixelAA: false.

"copy the source form bits to a new form of the same size"
newForm := sourceForm deepCopy copyBits: sourceForm boundingBox from:
sourceForm at: 0@0 colorMap: (colorMap).

"create a morph for displaying this form"
newImageMorph := ImageMorph withForm: newForm.
newImageMorph openInWorld; topLeft: 300@500.







2017-12-27 22:43 GMT+01:00 Andy Burnett :

> I have an image with black text, and a white background. I would like to
> set the white pixels to transparent. I worked out how to do this, but of
> course it leaves me with a white halo around the text, where the border
> pixels are almost white, but not quite.
>
> In googling about this, I discovered that RMagick has the idea of
> replacing pixels which are almost any particular colour. I didn't find
> anything similar in the ColorForm class. Is there a way to do this within
> Pharo?
>
> Cheers
> Andy
>


Re: [Pharo-users] Running headless on Windows

2017-12-29 Thread Nicolai Hess
2017-12-29 3:07 GMT+01:00 Andrei Stebakov :

> Pierce, I tried all of those "no display" options, the result is the same
>
> On Dec 28, 2017 8:37 PM, "Pierce Ng"  wrote:
>
>> On Wed, Dec 27, 2017 at 04:58:39PM +0100, Cyril Ferlicot D. wrote:
>> > On 12/27/2017 04:39 PM, Andrei Stebakov wrote:
>> > > When I run Pharo 6.1 with -- headless option on Windows, it executes
>> the
>> > > eval command as expected but during the execution (which lasts 4 sec)
>> it
>> > > opens the Pharo GUI.
>> > > Is it expected? I thought headless means that the whole execution
>> would
>> > > happen in the background
>> >
>> > I think that currently Pharo does not have a "real" headless. But I
>> > heard there was work on that part for Pharo 7.
>>
>> I know OP is talking about Windows...  I've been running server
>> applications on
>> Linux without X11 with -vm-display-null and in-image RFBServer for access
>> to
>> Pharo over VNC. This works very well for me.
>>
>> I believe "real" headless means GUI is not run at all and therefore does
>> not
>> consume CPU cycles, which is very welcome. Meanwhile, maybe
>> -vm-display-null
>> works on Windows for scripting purposes?
>>
>> Pierce
>>
>>
>>

Hi Andrei,

can you try this:

Open Pharo normal (no headless option).
Change the window size to "not-maximized" (eve if it is actually not
maximized, maximize it ones and change it back to "not-maximized")
Save and quit the image.

After that, a call like

pharo --headless pharo.image eval "DateAndTime now"

will write the output to the stdout file, without opening a window.


Re: [Pharo-users] How to declare a do:[] loop for a matrix to read and acces its elements?

2018-01-15 Thread Nicolai Hess
2018-01-15 15:29 GMT+01:00 Photon :

> Hello folks,
>
> I am trying since yesterday to make a game of life implemenation work. It
> looks all ok so far but in can`t figure out the final steps. I think I get
> the logic I have to use and if I imagine the code in C++ for example it
> would be pretty much straight forward. But with pharo I got trouble telling
> the machine what I want.
>
> In short I`m trying to make this method work:
>
>
>
> I wrote a test wich looks like this:
>
>
>
> I want to go trough each element of the matrix(cells), check its surounding
> cells if they are alive, and set its counter if there are any living
> neighbours. It should move like this through the whole matrix to set the
> neighbour counter for each element.
>
> In this method i just tried the implement the topLeft check yet but I think
> you get the idea. You can look at the comment  in the top section it shows
> where the neighbour indexes are.
>
> I tried so many things by now, did research read methods of the
> superclasses
> but I can`t make it work.
> I woud be really glad if someone gave me a little hint. What is wrong here?
>

I Photon, what exaclty get wrong ? Do you have an error message or is just
the result not what you expected?

Iterating over a matrix with do: would iterate over the whole contents of
the matrix and the do block gets only called
with a single value (the actual element).

If you want to iterate over the indices (x/y) you can take a look at the
method Matrix>>indicesDo: .
Or if it does not match what you are looking for, check out the other
methods in Matrix 'enumeration' protocol.

nicolai


>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] How to declare a do:[] loop for a matrix to read and acces its elements?

2018-01-15 Thread Nicolai Hess
2018-01-15 18:04 GMT+01:00 Photon :

> when I call the countNeighbours method i get an error: the block wants two
> arguments but I pass only one.
> This is probally because i want to pass x y but only really pass x wich
> ends
> up being a cell and not the index.
>
> I still have trouble thinking it trough. The indicieDo: method seems to
> make
> the matrix bigger?! I  don`t quite understand it.
>

It should not, and looking at the implementation, it just iterates with two
loops 1 to number of rows times 1 to number of columns and calls your
block argument with the pair of indexes.


>
> There must be an easy way to to figure out if the suroundings are alive or
> not. I mean its all there what I need and in my mind its so easy to
> discribe
> it with normal words. But to tell the machine witth syntax is another thing
> really :/
>

About the surroundings, there is a nice method in Point
Point>>eightNeighbors, that gives you the coordinates of the eight
surrounding fields
for example:
(5@7) eightNeighbors  "{(6@7). (6@8). (5@8). (4@8). (4@7). (4@6). (5@6).
(6@6)}"

with this method and if you iterate through all pairs of indices of the
matrix, you can
do your computation for every point, but you have to take care about the
points that don't
have valid matrix indices for some of their neighbours (like 0@0, the left
and top neighbours
may actually "on the other side of the matrix"). But you can take a look at
SequenceableCollection>>atWrap: how it deals with "wrapping around".




>
> what if i selected only one element with do:[] and let its tell me its
> idices. I store them in a temp object and then I check outside the block
> the
> neighbours and add to the counter. Once this is done I repeat as many times
> as their elements in the matrix?
>
> Greetings
>
>
>
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] [Vm-dev] Running headless on Windows

2018-01-18 Thread Nicolai Hess
2017-12-29 16:53 GMT+01:00 Denis Kudriashov :

> 2017-12-29 16:13 GMT+01:00 Andrei Stebakov :
>
>> Nicolai, the maximize/non-maximize trick worked! Thanks! I wonder if it's
>> an easy fix to put in Pharo.
>>
>
> So it means that something in image is not initialised. It can be another
> bug of wrong startup order
>


Maybe a problem on the image and the vm side.

Even in headless mode, starting pharo creates a window. Even if it is
hidden, it has some size.

Quit and Saving an image will write the current width/height into the image
file.

Starting the vm will create a window and set the size of the window to the
last size.
The window is always created in normal (not-maximized) mode and the
available size is a little bit smaller
than for a maximized window.

Now, the image checks for a change of the size of the current DisplayScreen
instance and the actual screen size.
If this is different (as in this case) a new DisplayScreen is initialized
which will call a full screen update (ioForceDisplayUpdate).

And this method will show a hidden (headless) image.






>
>
>>
>> On Fri, Dec 29, 2017 at 6:22 AM, p...@highoctane.be 
>> wrote:
>>
>>> I am using nssm because the service option is broken.
>>>
>>> The code seems to still be in the image but disabled (there are quite a
>>> few things like that actually).
>>>
>>> Phil
>>>
>>>
>>> On Fri, Dec 29, 2017 at 11:59 AM, Torsten Bergmann 
>>> wrote:
>>>
>>>>
>>>> Hi, (cross posting vm-dev)
>>>>
>>>> nssm is nice - but requires additional tools.
>>>>
>>>> Since the days of Squeak the windows VM had the
>>>>
>>>>  -service "ServiceName"
>>>>
>>>> option and one was able to run Squeak as a windows service out of the
>>>> box.
>>>>
>>>> See http://wiki.squeak.org/squeak/105 for details.
>>>>
>>>> This option allows to register/deregister with the windows service
>>>> manager and run
>>>> a headless image.
>>>>
>>>> I run a Squeak Wiki (Swiki/Comanche) since years with this and it is
>>>> very nice and stable.
>>>>
>>>> Unfortunately this is broken in recent Pharo VMs and so far Esteban or
>>>> others did not
>>>> have the time to look into this issue. Would be really nice if this
>>>> option could
>>>> be recovered in 2018. So one could easily deploy and run Seaside or
>>>> Teapot/Tealight
>>>> or Zinc/WebClient based web services on Windows.
>>>>
>>>> If we want to deploy Smalltalk based web applications or services on
>>>> Windows we
>>>> should support that. It will keep Windows administrators happy and we
>>>> would integrate with
>>>> the whole ecosystem (for instance you can start/stop a service using
>>>> Windows scripting for
>>>> doing backups, etc.) right out of the box.
>>>>
>>>> Bye
>>>> T.
>>>>
>>>>
>>>>
>>>> Gesendet: Freitag, 29. Dezember 2017 um 11:36 Uhr
>>>> Von: "p...@highoctane.be" 
>>>> An: "Any question about pharo is welcome" 
>>>> Betreff: Re: [Pharo-users] Running headless on Windows
>>>>
>>>> If you want to run Pharo as a service, I have found nssm to be working
>>>> well.
>>>>  https://nssm.cc
>>>>
>>>> Phil
>>>>
>>>> On Dec 29, 2017 09:25, "Nicolai Hess" >>> nicolaih...@gmail.com]> wrote:
>>>>
>>>>
>>>> 2017-12-29 3:07 GMT+01:00 Andrei Stebakov >>> lisper...@gmail.com]>:
>>>> Pierce, I tried all of those "no display" options, the result is the
>>>> same
>>>>
>>>>
>>>> On Dec 28, 2017 8:37 PM, "Pierce Ng" >>> pie...@samadhiweb.com]> wrote:On Wed, Dec 27, 2017 at 04:58:39PM
>>>> +0100, Cyril Ferlicot D. wrote:
>>>> > On 12/27/2017 04:39 PM, Andrei Stebakov wrote:
>>>> > > When I run Pharo 6.1 with -- headless option on Windows, it
>>>> executes the
>>>> > > eval command as expected but during the execution (which lasts 4
>>>> sec) it
>>>> > > opens the Pharo GUI.
>>>> > > Is it expected? I thought headless means that the whole execution
>>>> would
>>>> > > happen in the background
>>>> >
>>>> > I think that currently Pharo does not have a "real" headless. But I
>>>> > heard there was work on that part for Pharo 7.
>>>>
>>>> I know OP is talking about Windows...  I've been running server
>>>> applications on
>>>> Linux without X11 with -vm-display-null and in-image RFBServer for
>>>> access to
>>>> Pharo over VNC. This works very well for me.
>>>>
>>>> I believe "real" headless means GUI is not run at all and therefore
>>>> does not
>>>> consume CPU cycles, which is very welcome. Meanwhile, maybe
>>>> -vm-display-null
>>>> works on Windows for scripting purposes?
>>>>
>>>> Pierce
>>>>
>>>>
>>>>
>>>> Hi Andrei,
>>>>
>>>> can you try this:
>>>>
>>>> Open Pharo normal (no headless option).
>>>> Change the window size to "not-maximized" (eve if it is actually not
>>>> maximized, maximize it ones and change it back to "not-maximized")
>>>> Save and quit the image.
>>>>
>>>> After that, a call like
>>>>
>>>> pharo --headless pharo.image eval "DateAndTime now"
>>>> will write the output to the stdout file, without opening a window.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>


Re: [Pharo-users] How can I outsource instance data ?

2018-01-18 Thread Nicolai Hess
2018-01-18 0:24 GMT+01:00 Photon :

> Hello,
>
> I am messing around with an ordered collection of a class wich contains a
> matrix. As it the size grew I started to wonder if my code was something
> one
> should not do or if one would maybe outsource some data.
> I don`t know if it`s just in the RAM if iI start the VM. In that case i
> would overkill it at some point or not?
>
> So i thought of storing the data on harddrive to be able to recall it later
> when I need to but get it out of the running VM for the moment.
> Maybe you can enlighten me regarding this.
>
> In this picture you can see that my data is basicly stored inside of a
> inspector at the moment. So it would be cool to store the whole thing on
> harddrive.
>
> 
>

I am not sure, but it looks like you are using Morphs for every Cell and
every Cell in the generations collections.
These would be many (unnecessary) Morph objects.

Maybe it would be better to only store the cells (or cell states) and use
only one grid of Morphs to show the current generation.




>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] Controlling the Pharo window

2014-09-22 Thread Nicolai Hess
NB?
on Windows:
NBWin32Window getActiveWindow moveWindowX:10 y:10 width:500 height:150

2014-09-22 9:59 GMT+02:00 kilon alios :

> Is there a way to move the pharo window around, resize it and generally
> control it ?
>


Re: [Pharo-users] Controlling the Pharo window

2014-09-22 Thread Nicolai Hess
Another solution could be the HostWindowPlugin.
Look at DisplayScreen class >> hostWindow
This could be platform independent but I don't know if it works on all
platforms:
12231 
DisplayScreen hostWindowTitle: not working on Linux (ubuntu)




2014-09-22 11:26 GMT+02:00 Hilaire :

> Le 22/09/2014 11:20, Hilaire a écrit :
> > Le 22/09/2014 10:55, kilon alios a écrit :
> >> I was talking about something cross platform but NB is good too. Makes
> me
> >> wonder the potential of hacking the pharo window, maybe for embedding
> QT to
> >> it or what else.
> >
> > You can wrap this in a Plateform hierarchy to make it crossplateform
> > from the Ephaistos perspective.
> > I think there are such example in Pharo itself, you can also check the
> > DrGPlateform hierarchy in DrGeo or iStoa
> >
> > Hilaire
> >
>
>
> In Pharo you can check for OSPlatform and add accordingly the operation
> you want to do in your host window, for each specific OS.
>
> Then, in your appls will do something like:
>
> Smalltalk os maximiseHostWindow
> [...]
>
> Hilaire
>
>
> --
> Dr. Geo - http://drgeo.eu
> iStoa - http://istao.drgeo.eu
>
>
>


Re: [Pharo-users] FFI examples on Linux don't work

2014-09-22 Thread Nicolai Hess
2014-09-22 18:10 GMT+02:00 p...@highoctane.be :

> I've been able to reproduce this.
>
> Well, my CentOS thing requires me for some reason to put
> /usr/lib/libX11.so.6 in the module name (doing these kind of things looks
> like usual for lib names with FFI from what I saw from old Squeak threads).
>

Yes, I read this threads too, I solved it by
LD_LIBRARY_PATH= ./pharo 

but no matter which of this (LD_LIBRARY_PATH or full name in the ffi
pragma) the call throws the
"could not coerce arguments"- error.

But the Sample class>>callC: method you wrote in the other mail works.


>
> XCreateGC: xDisplay with: aDrawable with: valueMask with: values
>  '/usr/lib/libX11.so.6'>
>
> Now, other internal FFIPrims tests do work.
>
> So, it is X11 or something else, I do not know.
>
> Phil
>
>
> On Mon, Sep 22, 2014 at 4:39 PM, Ben Coman  wrote:
>
>> Annick Fron wrote:
>>
>>> Hi,
>>>
>>> I have posted a bug about this in fogbugz.
>>> FFI example on Linux don’t work
>>>
>>> X11Display coloredRectangles
>>> raises an error « coud not coerce arguments ».
>>> In fogbugz, I was asked to raise this question in the mailing list, to
>>> know if it comes from the VM or from FFI.
>>>
>>> Annick
>>>
>>>
>>>
>> Hi Annick,
>> Sorry I don't know anything about this topic to help, just a minor
>> observation that a link to the fogbugz issue would help streamline things
>> for someone who does.
>> :)
>> cheers -ben
>>
>>
>>
>>
>


Re: [Pharo-users] Ridiculous we are

2014-09-22 Thread Nicolai Hess
There is a similar issue for windows

13127 
can not (always) read permissions for directoryentries on a path with
nonascii characters


2014-09-22 23:21 GMT+02:00 Hilaire :

> Le 22/09/2014 23:14, p...@highoctane.be a écrit :
> > Also, sometimes things do look like "Téléchargement" but are still
> > Downloads under the hood as the OS translates the UI.
>
> Yes, I check within another path of my own like 'été', still same issue.
> Strange is I have no issue to search for sketch file with accent. Only
> when loading the font.
> Hilaire
>
>
> --
> Dr. Geo - http://drgeo.eu
> iStoa - http://istoa.drgeo.eu
>
>
>


Re: [Pharo-users] FFI examples on Linux don't work

2014-09-22 Thread Nicolai Hess
Ah, got the examples working :)

I replaced all X11Drawable arguments in the ffi call signature to ulong
and replace the call ... drawable ... with ... drawable xid ...

attached is the changeset
(who maintains the FFI-Package and  the X11 examples?)




2014-09-22 23:10 GMT+02:00 p...@highoctane.be :

> I passed 'localhost:0:0' in the XWindows example and this gave me a window
> reference.
>
> The next problem was that it broke after that. But I got the handle.
>
> Try with that, it may help.
>
> Phil
>
>
> On Mon, Sep 22, 2014 at 10:02 PM, Annick Fron  wrote:
>
>> Thanks you
>> The problem is I wanted to use X windows !
>> Otherwise I have managed to use FFI on Linux.
>> Perhaps there is a glitch when passing nil as argument. It is not clear
>> whether we have to use nil or 0 (as a null pointer).
>> This is really my point, I sometimes need to pass NULL.
>> Annick
>>
>> Le 22 sept. 2014 à 21:22, Nicolai Hess  a écrit :
>>
>>
>> 2014-09-22 18:10 GMT+02:00 p...@highoctane.be :
>>
>>> I've been able to reproduce this.
>>>
>>> Well, my CentOS thing requires me for some reason to put
>>> /usr/lib/libX11.so.6 in the module name (doing these kind of things looks
>>> like usual for lib names with FFI from what I saw from old Squeak threads).
>>>
>>
>> Yes, I read this threads too, I solved it by
>> LD_LIBRARY_PATH= ./pharo 
>>
>> but no matter which of this (LD_LIBRARY_PATH or full name in the ffi
>> pragma) the call throws the
>> "could not coerce arguments"- error.
>>
>> But the Sample class>>callC: method you wrote in the other mail works.
>>
>>
>>>
>>> XCreateGC: xDisplay with: aDrawable with: valueMask with: values
>>> >> '/usr/lib/libX11.so.6'>
>>>
>>> Now, other internal FFIPrims tests do work.
>>>
>>> So, it is X11 or something else, I do not know.
>>>
>>> Phil
>>>
>>>
>>> On Mon, Sep 22, 2014 at 4:39 PM, Ben Coman  wrote:
>>>
>>>> Annick Fron wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have posted a bug about this in fogbugz.
>>>>> FFI example on Linux don’t work
>>>>>
>>>>> X11Display coloredRectangles
>>>>> raises an error « coud not coerce arguments ».
>>>>> In fogbugz, I was asked to raise this question in the mailing list, to
>>>>> know if it comes from the VM or from FFI.
>>>>>
>>>>> Annick
>>>>>
>>>>>
>>>>>
>>>> Hi Annick,
>>>> Sorry I don't know anything about this topic to help, just a minor
>>>> observation that a link to the fogbugz issue would help streamline things
>>>> for someone who does.
>>>> :)
>>>> cheers -ben
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>
'From Pharo3.0 of 18 March 2013 [Latest update: #30854] on 23 September 2014 at 12:08:02.915403 am'!

!X11GC methodsFor: 'drawing' stamp: 'NicolaiHess 9/23/2014 00:05'!
drawOval: aRectangle
	self
		XDrawArc: self display
			with: drawable xid
			with: self
			with: aRectangle left
			with: aRectangle top
			with: aRectangle width
			with: aRectangle height
			with: 0
			with: 64*360! !

!X11GC methodsFor: 'drawing' stamp: 'NicolaiHess 9/23/2014 00:06'!
fillRectangle: aRectangle
	self
		XFillRectangle: self display
			with: drawable xid
			with: self
			with: aRectangle left
			with: aRectangle top
			with: aRectangle width
			with: aRectangle height! !

!X11GC methodsFor: 'drawing' stamp: 'NicolaiHess 9/23/2014 00:06'!
drawRectangle: aRectangle
	self
		XDrawRectangle: self display
			with: drawable xid
			with: self
			with: aRectangle left
			with: aRectangle top
			with: aRectangle width
			with: aRectangle height! !

!X11GC methodsFor: 'drawing' stamp: 'NicolaiHess 9/23/2014 00:04'!
fillOval: aRectangle
	self
		XFillArc: self display
			with: drawable xid
			with: self
			with: aRectangle left
			with: aRectangle top
			with: aRectangle width
			with: aRectangle height
			with: 0
			with: 64*360! !

!X11GC methodsFor: 'drawing' stamp: 'NicolaiHess 9/23/2014 00:07'!
drawLineFrom: pt1 to: pt2
	self XDrawLine: self display 
			with: drawable xid
			with: self 
			with: pt1 x 
			with: pt1 y 
			with: pt2 x 
			with: pt2 y! !

!X11GC methodsFor: 'xlib calls' stamp: 'NicolaiHess 9/23/2014 00:06'!
XDrawRectangle: xDisplay with: xDrawable with: xGC 

Re: [Pharo-users] [ANN] I stop maintaining the Ubuntu packages

2014-09-24 Thread Nicolai Hess
Count me in. I still have a ubuntu installation.
Don't know what I have to do, but I'll try it.

2014-09-24 9:41 GMT+02:00 Damien Cassou :

> Dear all,
>
> I've recently switched my Linux distribution from Ubuntu to NixOS.
> This means I can no longer maintain the Ubuntu packages and their PPA
> (https://launchpad.net/~pharo/).
>
> These packages need a maintainer!
>
> The good side of it is that it is not a lot of work as I did all the
> automating infrastructure:
> https://github.com/pharo-project/pharo-ubuntu. Basically, the
> maintainer will have to launch a few shell scripts regularly (once a
> month for example). I will obviously be available to help the new
> maintainer.
>
> The community needs *you*.
>
> Good news is: I packaged the Pharo VM for the Nix package manager
> which can be installed on many Unix (e.g., Linux, MacOS X, FreeBSD).
> And NixOS will have the Pharo VM package in its next release in
> October!
>
> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Success is the ability to go from one failure to another without
> losing enthusiasm."
> Winston Churchill
>
>


Re: [Pharo-users] FFI on Linux again

2014-09-25 Thread Nicolai Hess
Am 25.09.2014 17:25 schrieb "Annick Fron" :
>
> Hi,
>
> I Have tried the following code on Linux , but the call breaks. Is it
because of the X11Window structure missing or else ?
>
> Annick
> 
> testGetOurWindowLocation
>"self new testGetOurWindowLocation"
>
>| display ourWindow aParent anX anY aWidth aHeight aBorderWidth aDepth
|
>display := X11Display XOpenDisplay: nil.
>ourWindow := display ourWindow.
>(Alien lookup: 'XGetGeometry' inLibrary: 'X11')
>primFFICallResult: nil
>withArguments:
>{display.
>ourWindow.
>(aParent := Alien new: 4).
>(anX := Alien new: 4).
>(anY := Alien new: 4).
>(aWidth := Alien new: 4).
>(aHeight := Alien new: 4).
>(aBorderWidth := Alien new: 4).
>(aDepth := Alien new: 4)}.
>(anX unsignedLongAt: 1) inspect

withArguments ...
ourWindow xid
...
?


Re: [Pharo-users] How to set a white background with Spec ?

2014-09-26 Thread Nicolai Hess
Changes on a widget attributes can be defined when it is build.
To hook into this, use #whenBuiltDo:

|t|
t:= TextModel new.
t whenBuiltDo:[:a | a widget color: Color gray].
t openWithSpec.





2014-09-26 15:51 GMT+02:00 Johan Fabry :

>
> I have not tried this, I just browsed the documentation, but I am putting
> it here as this process usually is the right way to find answers to these
> questions: I looked at the spec class for windows: WindowModel and the
> ‘protocol' protocol to see its configuration options. None mention color. I
> looked at the superclass: AbstractWindowModel, and the ‘protocol’ protocol
> does have a color: setter.
>
> So if you have a reference to the WindowModel for the window you are
> using, you should be able to set the color. Please tell me if this works
> for you. I think this question is a good candidate for updating the
> documentation.
>
> On Sep 26, 2014, at 6:11 AM, Annick Fron  wrote:
>
> > Hi,
> >
> >   I am using a window with spec, where can I define a white
> background for it ?
> >
> > Annick
> >
>
>
>
> ---> Save our in-boxes! http://emailcharter.org <---
>
> Johan Fabry   -   http://pleiad.cl/~jfabry
> PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile
>
>
>


Re: [Pharo-users] How to create a package via code correctly ?

2014-10-04 Thread Nicolai Hess
2014-10-04 8:45 GMT+02:00 Esteban Lorenzano :

> (RPackage named: 'ABC') register.
>
> or
>
> RPackageOrganizer default registerPackage: (RPackage named: 'ABC’).
>
> or
>
> RPackageOrganizer default registerPackageNamed: ‘ABC’.
>
> the 3 ways work (just tested).
> If you are not succeeding probably there is another, previous problem
> (like de-sync caused by some failed operation made before)…
>
> cheers,
> Esteban
>

Does this include the SystemOrganization part?
(SystemOrganization addCategory: 'Keks4')
Or is this not neccessary anymore?



>
>
> > On 04 Oct 2014, at 08:30, Ben Coman  wrote:
> >
> > itli...@schrievkrom.de wrote:
> >> How can I create a package correctly via code ?
> >> I tried stuff like
> >> PackageOrganizer default registerPackageNamed: 'Keks4'
> >> SystemOrganization addCategory: 'Keks4'
> >> but the package does not appear in the browser.
> >> Marten
> >
> > I don't have a direct answer for you, since I don't know - but I can
> tell you how to discover the answer yourself (or at least how I would go
> about it myself)
> >
> > 1. Right-click in the package pane, and then bring up the Halos[1] on
> the menu-item-of-interest e.g. "Add package..."
> >
> > 2. From the Debug (spanner) halo menu choose "Inspect morph". Scroll
> down until you see something that looks like a method being called.  Go to
> that method and put a "self halt" at the top.
> >
> > 3. Invoke the menu-item-of-interest, then in the debugger step through
> what it does, and copy that for your own purpose.
> >
> > Please report back if you succeed with this, or otherwise feel free to
> ask for more assistance.  I just believe it helps you more to teach you how
> to fish :) rather than just give you one someone else caught.
> >
> > cheers -ben
> >
> > [1] http://web.cecs.pdx.edu/~black/OOP/Tutorial/Morphic%20Worksheet.html
> >
>
>
>


Re: [Pharo-users] Trouble opening large files

2014-10-14 Thread Nicolai Hess
2014-10-14 6:38 GMT+02:00 Evan Donahue :

> Hi, thanks for the reply.
>
> The response is the same: "MessageNotUnderstood:
> False>>humanReadableSIByteSize."
>
> This happens both to print-it as well as to do-it-and-go. Running the
> command on the neighboring "wiki.torrent" torrent file yields the correct
> 54kb.
>
> Thanks,
> Evan
>
> On Tue, Oct 14, 2014 at 12:24 AM, Tudor Girba 
> wrote:
>
>> Hi,
>>
>> If I understand correctly, the failure occurs while navigating in the
>> "Items" presentation.
>>
>> I cannot reproduce this problem because I do not have enough disk space
>> for such a large file :). But, could you do the following and let me know
>> what the outcome is:
>>
>> 'path/to/your/large/file.xml' asFileReference humanReadableSize
>>
>> ?
>>
>> Cheers,
>> Doru
>>
>>
>>
>> On Tue, Oct 14, 2014 at 2:27 AM, Evan Donahue  wrote:
>>
>>> Hello, I've run into some odd behavior and wanted to check whether I
>>> might be missing something:
>>>
>>> I have downloaded a copy of the english wikipedia as an xml file and am
>>> hoping to (sax) parse it. However, I can't even seem to get pharo to
>>> recognize that the file exists.
>>>
>>> If I open FileSystem disk root in the playground and naigate, attempting
>>> to enter the folder containing the (57G) xml file fails with
>>> "MessageNotUnderstood: False>>humanReadableSIByteSize." Likewise if I get a
>>> FileReference with FileSystem disk root / 'path' / 'to' / 'file' then self
>>> exists returns false and the parser fails.
>>>
>>> Am I doing something wrong? Should I be able to do this?
>>>
>>> The version number is #40283
>>>
>>> Thanks,
>>> Evan
>>>
>>
>>
>>
>> --
>> www.tudorgirba.com
>>
>> "Every thing has its own flow"
>>
>
>

Which OS ?
Can you check with other programs if this file is readable at all?




Nicolai


Re: [Pharo-users] Trouble opening large files

2014-10-14 Thread Nicolai Hess
Easiest way: download the generated source from
http://files.pharo.org/vm/src/vm-unix-sources/blessed/

2014-10-14 22:35 GMT+02:00 Evan Donahue :

> 64 bits! That makes sense. I don't generally work with large files either.
> I have been getting my vm from get.pharo.org, so I will need to get the
> source to build the vm in the first place. A quick survey over the last few
> hours has revealed a multitude of vms, projects, platforms, repositories,
> and versions that I, in my pharo ignorance, cannot differentiate. Could
> someone please point me to the source I should be using to build the vm for
> the pharo40 image I have been pulling of get.pharo.org?
>
> Thank you,
> Evan
>
> On Tue, Oct 14, 2014 at 3:02 PM, Nicolai Hess  wrote:
>
>> Rebuild pharo vm with D_FILE_OFFSET_BITS=64 option:
>> Reading list directories with (very) large files working now.
>>
>>
>>
>> 2014-10-14 20:26 GMT+02:00 Nicolai Hess :
>>
>>> There is a bug report on mantis for squeaks unix vm.
>>> I think this applies to pharo too, although I don't know if this
>>> bug is still valid on recent squeak vm.
>>>
>>> http://bugs.squeak.org/view.php?id=7522
>>>
>>> 2014-10-14 17:43 GMT+02:00 Evan Donahue :
>>>
>>>> The OS is Arch Linux.
>>>>
>>>> I can read the file with less.
>>>>
>>>> The problem, insofar as I can trace it, seems to stem from this line in
>>>> UnixStore:
>>>>
>>>> Primitives lookupDirectory: encodedPath filename: encodedBasename
>>>>
>>>> When I have my 57G file there this line returns nil. If I move the 57G
>>>> file and create a small file with the same name, the same command
>>>> successfully finds the file. I am not sure how large a file must be to
>>>> cause this issue, but A 1.5G file works fine.
>>>>
>>>> On Tue, Oct 14, 2014 at 8:17 AM, Nicolai Hess 
>>>> wrote:
>>>>
>>>>> 2014-10-14 6:38 GMT+02:00 Evan Donahue :
>>>>>
>>>>>> Hi, thanks for the reply.
>>>>>>
>>>>>> The response is the same: "MessageNotUnderstood:
>>>>>> False>>humanReadableSIByteSize."
>>>>>>
>>>>>> This happens both to print-it as well as to do-it-and-go. Running the
>>>>>> command on the neighboring "wiki.torrent" torrent file yields the correct
>>>>>> 54kb.
>>>>>>
>>>>>> Thanks,
>>>>>> Evan
>>>>>>
>>>>>> On Tue, Oct 14, 2014 at 12:24 AM, Tudor Girba 
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> If I understand correctly, the failure occurs while navigating in
>>>>>>> the "Items" presentation.
>>>>>>>
>>>>>>> I cannot reproduce this problem because I do not have enough disk
>>>>>>> space for such a large file :). But, could you do the following and let 
>>>>>>> me
>>>>>>> know what the outcome is:
>>>>>>>
>>>>>>> 'path/to/your/large/file.xml' asFileReference humanReadableSize
>>>>>>>
>>>>>>> ?
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Doru
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Oct 14, 2014 at 2:27 AM, Evan Donahue 
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hello, I've run into some odd behavior and wanted to check whether
>>>>>>>> I might be missing something:
>>>>>>>>
>>>>>>>> I have downloaded a copy of the english wikipedia as an xml file
>>>>>>>> and am hoping to (sax) parse it. However, I can't even seem to get 
>>>>>>>> pharo to
>>>>>>>> recognize that the file exists.
>>>>>>>>
>>>>>>>> If I open FileSystem disk root in the playground and naigate,
>>>>>>>> attempting to enter the folder containing the (57G) xml file fails with
>>>>>>>> "MessageNotUnderstood: False>>humanReadableSIByteSize." Likewise if I 
>>>>>>>> get a
>>>>>>>> FileReference with FileSystem disk root / 'path' / 'to' / 'file' then 
>>>>>>>> self
>>>>>>>> exists returns false and the parser fails.
>>>>>>>>
>>>>>>>> Am I doing something wrong? Should I be able to do this?
>>>>>>>>
>>>>>>>> The version number is #40283
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Evan
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> www.tudorgirba.com
>>>>>>>
>>>>>>> "Every thing has its own flow"
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> Which OS ?
>>>>> Can you check with other programs if this file is readable at all?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Nicolai
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>


Re: [Pharo-users] FFI syntax

2014-10-16 Thread Nicolai Hess
Yes, for pharo this is easy.
For squeak, it took me some time to get it "working"  (at least the tests
are green, examples do not work).


2014-10-16 8:49 GMT+02:00 Torsten Bergmann :

> >I can not even find up to date information on how to *install* current
> >working FFI
>
> In Pharo 3.0 open the world menu, then "Tools", then "Config browser"
> and there look for "FFI" in the list ...
>
> If people would care on providing easy access to own packages
> life would be easy for all.
>
> Bye
> T.
>
>


Re: [Pharo-users] Meaning of icons in Nautilus

2014-10-18 Thread Nicolai Hess
2014-10-18 4:57 GMT+02:00 nacho <0800na...@gmail.com>:

> Hi there!
> I was wondering about the meaning of some of the icons in Nautilus.
> I know C stands for Class T for Trait but there are some that I don't know.
> For instance those classes that have three dots (orange, green and yellow).
> Also where can I search about Nautilus plug-ins?
> Thanks in advance!
> best regards
> Nacho
>
>
>
>
> -
> Nacho
> Smalltalker apprentice.
> Buenos Aires, Argentina.
> --
> View this message in context:
> http://forum.world.st/Meaning-of-icons-in-Nautilus-tp4785250.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>
Hi,

There is a small Help browser:
World menu -> Help -> Help Browser

And there is a "Icon" category:
Pharo Environment Help -> Icons

For instance in Nautilus Class pane the three dots icon means:
- 3 Coloured Balls: a Collection


For the Nautilus plugins, I don't know. The only source of Information I
know
of, are the existing plugins in Package 'NautilusCommon-Plugin'

nicolai


Re: [Pharo-users] Meaning of icons in Nautilus

2014-10-18 Thread Nicolai Hess
Yes, it is only in Pharo 4.0:
Nautilus class pane icons:
- Red exclamation mark: a missing class comment. The pharo team reccommend
that all classes should describe their intent with a comment.
- Gray dot: a TestCase
- Yellow Lightening bolt: an Exception
- 3 Coloured Balls: a Collection
- Blue Speech bubble: an Announcement
- Blue Paragraph symbol: a String
- Gray Epsilon symbol: a Magniture
- Blue Matrix box: a graphcial Morph
- Purple Ball with T: a Trait





2014-10-18 15:21 GMT+02:00 Ignacio Matías Sniechowski <0800na...@gmail.com>:

> I don't know why but I can't find Icons in the Help Browser.
> I'm using Pharo 3.0
> Thanks!
>
>
> *Lic. Ignacio Sniechowski, MBA*
> *Prosavic SRL*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Sat, Oct 18, 2014 at 6:38 AM, Nicolai Hess  wrote:
>
>> 2014-10-18 4:57 GMT+02:00 nacho <0800na...@gmail.com>:
>>
>>> Hi there!
>>> I was wondering about the meaning of some of the icons in Nautilus.
>>> I know C stands for Class T for Trait but there are some that I don't
>>> know.
>>> For instance those classes that have three dots (orange, green and
>>> yellow).
>>> Also where can I search about Nautilus plug-ins?
>>> Thanks in advance!
>>> best regards
>>> Nacho
>>>
>>>
>>>
>>>
>>> -
>>> Nacho
>>> Smalltalker apprentice.
>>> Buenos Aires, Argentina.
>>> --
>>> View this message in context:
>>> http://forum.world.st/Meaning-of-icons-in-Nautilus-tp4785250.html
>>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>>>
>>>
>> Hi,
>>
>> There is a small Help browser:
>> World menu -> Help -> Help Browser
>>
>> And there is a "Icon" category:
>> Pharo Environment Help -> Icons
>>
>> For instance in Nautilus Class pane the three dots icon means:
>> - 3 Coloured Balls: a Collection
>>
>>
>> For the Nautilus plugins, I don't know. The only source of Information I
>> know
>> of, are the existing plugins in Package 'NautilusCommon-Plugin'
>>
>> nicolai
>>
>>
>>
>


Re: [Pharo-users] How to force FFI to load a library

2014-10-22 Thread Nicolai Hess
2014-10-22 14:50 GMT+02:00 Annick Fron :

> Hi,
>
> I have one library which depends from another one.
> How can I force pharo to load the dependent library ?
>
> Annick
>
>

I don't think it is necessary to force pharo to load the libraries. AFAIR
the VM on linux uses dlopen() to load a module
and that should load the dependent libraries as well, *if* the library, you
are using, is linked against the others.

For example, you want to load library "testlib" which depends on "helperlib"
you have to compile and link the testlib and helperlib as follows

gcc -shared -o libhelperlib.so helperlib.c
gcc -shared -o libtestlib.so testlib.c -L. -lhelperlib

now you should be able to load testlib from pharo.

you can test if your dependent libraries can be automatically found by
dlopen with:
ldd 


nicolai


Re: [Pharo-users] Athens do not work on Image 40316+

2014-10-22 Thread Nicolai Hess
2014-10-23 0:16 GMT+02:00 Jan Blizničenko :

> Hello
>
> On image 40315 everything working.
> On image 40316-40320 (latest) parts of Athens do not work, tried by running
> Athens Tutorial and Roassal 2, which are both based on Athens.
> Problem is on both Windows and Linux (unable to test on any Mac)
> Instead of describing the error, here is a link to download the image after
> downloading Athens-Tutorial and clicking on "do it" on Step 2 of tutorial:
> http://www.mediafire.com/download/va5wbm0qix3aqh2/PharoAthensBugWindows.zip
>
> Hope it helps
>
> Jan Blizničenko
>
>
>
> --
> View this message in context:
> http://forum.world.st/Athens-do-not-work-on-Image-40316-tp4786099.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>

I think you can skip the first part: "ConfigurationOfAthens loadVersion:
'2.0'."
because Athens is already in the image and the version on smalltalkhub is
not
uptodate with the one in the image.


Re: [Pharo-users] Athens do not work on Image 40316+

2014-10-23 Thread Nicolai Hess
2014-10-23 8:50 GMT+02:00 Jan Blizničenko :

> Nicolai Hess wrote
> > I think you can skip the first part: "ConfigurationOfAthens loadVersion:
> > '2.0'."
> > because Athens is already in the image and the version on smalltalkhub is
> > not
> > uptodate with the one in the image.
>
> I've never did the step one because of that reason.
> Just as I said, to reproduce just download clean image, run Gofer it
> package
> Athens-Tutorial, run AthensTutorial new openWithSpec, press "next" arrow,
> press "do it", that's all. Then this error appears. Or you can download
> Roassal 2 and open Roassal examples, same error. Or our project based on
> Roassal.
> On linux there is a little different error, but both are somehow similar
> (something about nativeboost, athens, cairo, etc.)
>
>
>
> --
> View this message in context:
> http://forum.world.st/Athens-do-not-work-on-Image-40316-tp4786099p4786136.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>
I can not reproduce the error on a clean pharo image:
"Pharo4.0 Latest update: #40320"
Gofer it smalltalkhubUser: 'Pharo' project: 'Athens';
package:'Athens-Tutorial'; load.
AthensTutorial new openWithSpec.
-> works


Re: [Pharo-users] Athens do not work on Image 40316+

2014-10-23 Thread Nicolai Hess
2014-10-23 10:04 GMT+02:00 Jan B. :

> Ok, I give up, it seems like gods just don't like me. I'm gonna stick with
> 40315.
>

Never give up!

Be sure you have a valid PharoV30.sources file.





>
> Thanks for your time
> Jan
>
>
>
> --
> View this message in context:
> http://forum.world.st/Athens-do-not-work-on-Image-40316-tp4786099p4786157.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] Slow at browsing

2014-10-25 Thread Nicolai Hess
Maybe this one:

12535  To many updates on the
methods list


2014-10-25 12:06 GMT+02:00 Thierry Goubier :

> Hi Hilaire,
>
> maybe profiling could show something. Nautilus could benefit from some
> love in making it faster :)
>
> I know that my browser, AltBrowser, is a lot faster on a slow machine (x7
> faster on startup time compared to Nautilus, x3 faster than the old system
> browser). So it could be done.
>
> (and Spur could give us a x2 boost on top of all those times :) :) )
>
> Thierry
>
> Le 25/10/2014 11:55, Hilaire a écrit :
>
>  Hello,
>>
>> In Pharo 3.0 (and with Pharo 2.0), I noted an important slowness when
>> browsing importantly populated class.
>>
>> For example, clicking on a method category of the Morph class, it takes
>> about 3 seconds to reveals its methods. With Pharo 1.4 it is immediate
>> with the same Morph class.
>>
>> My computer is a slow dog but it is not a good reason for this slowness.
>>
>> Hilaire
>>
>>
>>
>
>


Re: [Pharo-users] AST tokens question

2014-10-28 Thread Nicolai Hess
2014-10-27 19:36 GMT+01:00 Mark Rizun :

> Hi all,
>
> Trying to understand here how tokens are used in AST.
> So far I can not see any order in usage of tokens.
> For instance, why RBValueNode doesn't have token? Is it haow it's supposed
> to be?
>

RBValueNode is an abstract class.


>
> Cheers,
> Mark
>


Re: [Pharo-users] Zoomable & Infinitely scrollable PasteupMorph

2014-11-02 Thread Nicolai Hess
2014-11-02 15:22 GMT+01:00 Thierry Goubier :

> Le 02/11/2014 15:15, stepharo a écrit :
>
>>
>>  I gave up on zoomability (with the idea to revisit after Athens is
>>> integrated),
>>>
>>
>> Athens is integrated. Now if the community does not help redefining the
>> drawnOn: methods using athens then it will not happen.
>>
>
> And, speaking of infinite zoomability, you have a few surprises waiting
> for you in Athens :( (some are from Athens design, others may be linked to
> Cairo).
>

?
What exactly?




>
> Thierry
>
>


Re: [Pharo-users] Bug? in Filein

2014-11-02 Thread Nicolai Hess
2014-10-31 0:11 GMT+01:00 José Comesaña :

> I see. But WATestError it is in the same package it is "Fileing", on line
> 3284 and is referenced many times before. I am sorry I have not enough
> knowledge about the internals to do more debugging.
>
> Seems to be a lack of coordination between FileOut and FileIn. Maybe
> nothing to do...
>
> Now a simpler and clearer test:
>
> 1. Back to the original situation.
> 2. FileOut *only* WAContextTest. It has a comment: "I am the base class
> for all tests that need a WARequestContext present.", in .st file in line 8.
> 3. Remove it.
> 4. FileIn again. No errors on Transcript BUT no comment appears for
> WAContextTest.
>
> Maybe, if I get a couple of free hours I could dare to debug a little
>
> Best
>
>
> 2014-10-30 23:30 GMT+01:00 stepharo :
>
>>  It says that the class WATestError is not available.
>>
>>
>>
>>  Yes, I did. It is in the .st file
>>
>>
>>
>>> c. You get a bunch of errors in Transcript while filing in

>>>  No magic ball so we cannot guess.
>>>
>>>
>>  Example of Transcript messages (in case it helps):
>> WADocumentHandlerResponseTest>>createAndVerifyBinaryDocumentNamed:hasAttachment:
>> (WATestingFiles is Undeclared)
>>
>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>> Undeclared)
>>
>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>> Undeclared)
>>
>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>> Undeclared)
>>
>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>> Undeclared)
>>
>>  WAExceptionHandlerTest>>testInternalError (WATestError is Undeclared)
>>
>>
>>  It happens in more cases. I just took this one because this is a
>> package anyone can install in order to reproduce the problem.
>>
>>  Thanks
>>
>>
>>
>

Yes, it is a bug. Verified on Pharo4 with class ZnMessageBenchmark. The
class has a comment, after fileout/remove class/filein this class is
without a comment.
I'll open a bug report.


Re: [Pharo-users] Bug? in Filein

2014-11-02 Thread Nicolai Hess
Actually it is a bug in FileOUT!

14377 <https://pharo.fogbugz.com/default.asp?14377>
FileOut creates invalid comment entries for classes with class side methods


2014-11-02 17:42 GMT+01:00 Nicolai Hess :

> 2014-10-31 0:11 GMT+01:00 José Comesaña :
>
>> I see. But WATestError it is in the same package it is "Fileing", on line
>> 3284 and is referenced many times before. I am sorry I have not enough
>> knowledge about the internals to do more debugging.
>>
>> Seems to be a lack of coordination between FileOut and FileIn. Maybe
>> nothing to do...
>>
>> Now a simpler and clearer test:
>>
>> 1. Back to the original situation.
>> 2. FileOut *only* WAContextTest. It has a comment: "I am the base class
>> for all tests that need a WARequestContext present.", in .st file in line 8.
>> 3. Remove it.
>> 4. FileIn again. No errors on Transcript BUT no comment appears for
>> WAContextTest.
>>
>> Maybe, if I get a couple of free hours I could dare to debug a little
>>
>> Best
>>
>>
>> 2014-10-30 23:30 GMT+01:00 stepharo :
>>
>>>  It says that the class WATestError is not available.
>>>
>>>
>>>
>>>  Yes, I did. It is in the .st file
>>>
>>>
>>>
>>>> c. You get a bunch of errors in Transcript while filing in
>>>>>
>>>>  No magic ball so we cannot guess.
>>>>
>>>>
>>>  Example of Transcript messages (in case it helps):
>>> WADocumentHandlerResponseTest>>createAndVerifyBinaryDocumentNamed:hasAttachment:
>>> (WATestingFiles is Undeclared)
>>>
>>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>>> Undeclared)
>>>
>>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>>> Undeclared)
>>>
>>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>>> Undeclared)
>>>
>>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>>> Undeclared)
>>>
>>>  WAExceptionHandlerTest>>testInternalError (WATestError is Undeclared)
>>>
>>>
>>>  It happens in more cases. I just took this one because this is a
>>> package anyone can install in order to reproduce the problem.
>>>
>>>  Thanks
>>>
>>>
>>>
>>
>
> Yes, it is a bug. Verified on Pharo4 with class ZnMessageBenchmark. The
> class has a comment, after fileout/remove class/filein this class is
> without a comment.
> I'll open a bug report.
>
>


Re: [Pharo-users] Bug? in Filein

2014-11-04 Thread Nicolai Hess
Fixed and integrated (pharo 40350)
I'll open another issue for backporting to pharo3

2014-11-02 22:24 GMT+01:00 Nicolai Hess :

> Actually it is a bug in FileOUT!
>
> 14377 <https://pharo.fogbugz.com/default.asp?14377>
> FileOut creates invalid comment entries for classes with class side methods
>
>
> 2014-11-02 17:42 GMT+01:00 Nicolai Hess :
>
>> 2014-10-31 0:11 GMT+01:00 José Comesaña :
>>
>>> I see. But WATestError it is in the same package it is "Fileing", on
>>> line 3284 and is referenced many times before. I am sorry I have not enough
>>> knowledge about the internals to do more debugging.
>>>
>>> Seems to be a lack of coordination between FileOut and FileIn. Maybe
>>> nothing to do...
>>>
>>> Now a simpler and clearer test:
>>>
>>> 1. Back to the original situation.
>>> 2. FileOut *only* WAContextTest. It has a comment: "I am the base class
>>> for all tests that need a WARequestContext present.", in .st file in line 8.
>>> 3. Remove it.
>>> 4. FileIn again. No errors on Transcript BUT no comment appears for
>>> WAContextTest.
>>>
>>> Maybe, if I get a couple of free hours I could dare to debug a little
>>>
>>> Best
>>>
>>>
>>> 2014-10-30 23:30 GMT+01:00 stepharo :
>>>
>>>>  It says that the class WATestError is not available.
>>>>
>>>>
>>>>
>>>>  Yes, I did. It is in the .st file
>>>>
>>>>
>>>>
>>>>> c. You get a bunch of errors in Transcript while filing in
>>>>>>
>>>>>  No magic ball so we cannot guess.
>>>>>
>>>>>
>>>>  Example of Transcript messages (in case it helps):
>>>> WADocumentHandlerResponseTest>>createAndVerifyBinaryDocumentNamed:hasAttachment:
>>>> (WATestingFiles is Undeclared)
>>>>
>>>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>>>> Undeclared)
>>>>
>>>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>>>> Undeclared)
>>>>
>>>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>>>> Undeclared)
>>>>
>>>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>>>> Undeclared)
>>>>
>>>>  WAExceptionHandlerTest>>testInternalError (WATestError is Undeclared)
>>>>
>>>>
>>>>  It happens in more cases. I just took this one because this is a
>>>> package anyone can install in order to reproduce the problem.
>>>>
>>>>  Thanks
>>>>
>>>>
>>>>
>>>
>>
>> Yes, it is a bug. Verified on Pharo4 with class ZnMessageBenchmark. The
>> class has a comment, after fileout/remove class/filein this class is
>> without a comment.
>> I'll open a bug report.
>>
>>
>


Re: [Pharo-users] Bug? in Filein

2014-11-05 Thread Nicolai Hess
14405 <https://pharo.fogbugz.com/default.asp?14405>
(backport pharo3) FileOut creates invalid comment entries for classes with
class side methods
fix in pharo3inbox

2014-11-04 22:51 GMT+01:00 Nicolai Hess :

> Fixed and integrated (pharo 40350)
> I'll open another issue for backporting to pharo3
>
> 2014-11-02 22:24 GMT+01:00 Nicolai Hess :
>
>> Actually it is a bug in FileOUT!
>>
>> 14377 <https://pharo.fogbugz.com/default.asp?14377>
>> FileOut creates invalid comment entries for classes with class side
>> methods
>>
>>
>> 2014-11-02 17:42 GMT+01:00 Nicolai Hess :
>>
>>> 2014-10-31 0:11 GMT+01:00 José Comesaña :
>>>
>>>> I see. But WATestError it is in the same package it is "Fileing", on
>>>> line 3284 and is referenced many times before. I am sorry I have not enough
>>>> knowledge about the internals to do more debugging.
>>>>
>>>> Seems to be a lack of coordination between FileOut and FileIn. Maybe
>>>> nothing to do...
>>>>
>>>> Now a simpler and clearer test:
>>>>
>>>> 1. Back to the original situation.
>>>> 2. FileOut *only* WAContextTest. It has a comment: "I am the base class
>>>> for all tests that need a WARequestContext present.", in .st file in line 
>>>> 8.
>>>> 3. Remove it.
>>>> 4. FileIn again. No errors on Transcript BUT no comment appears for
>>>> WAContextTest.
>>>>
>>>> Maybe, if I get a couple of free hours I could dare to debug a
>>>> little
>>>>
>>>> Best
>>>>
>>>>
>>>> 2014-10-30 23:30 GMT+01:00 stepharo :
>>>>
>>>>>  It says that the class WATestError is not available.
>>>>>
>>>>>
>>>>>
>>>>>  Yes, I did. It is in the .st file
>>>>>
>>>>>
>>>>>
>>>>>> c. You get a bunch of errors in Transcript while filing in
>>>>>>>
>>>>>>  No magic ball so we cannot guess.
>>>>>>
>>>>>>
>>>>>  Example of Transcript messages (in case it helps):
>>>>> WADocumentHandlerResponseTest>>createAndVerifyBinaryDocumentNamed:hasAttachment:
>>>>> (WATestingFiles is Undeclared)
>>>>>
>>>>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>>>>> Undeclared)
>>>>>
>>>>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>>>>> Undeclared)
>>>>>
>>>>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>>>>> Undeclared)
>>>>>
>>>>>  WAExceptionHandlerTest>>testCommaReturnsExceptionSet (WATestError is
>>>>> Undeclared)
>>>>>
>>>>>  WAExceptionHandlerTest>>testInternalError (WATestError is
>>>>> Undeclared)
>>>>>
>>>>>
>>>>>  It happens in more cases. I just took this one because this is a
>>>>> package anyone can install in order to reproduce the problem.
>>>>>
>>>>>  Thanks
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>> Yes, it is a bug. Verified on Pharo4 with class ZnMessageBenchmark. The
>>> class has a comment, after fileout/remove class/filein this class is
>>> without a comment.
>>> I'll open a bug report.
>>>
>>>
>>
>


Re: [Pharo-users] FileBrowser confusion

2014-11-06 Thread Nicolai Hess
2014-11-06 23:25 GMT+01:00 Tudor Girba :

> Hi,
>
>
> On Thu, Nov 6, 2014 at 10:50 PM, Peter Uhnák  wrote:
>
>> > It is indeed known that Pharo cannot open files larger than 4GB (even
>> that after you setup the VM specifically).
>> It seems like Pharo bug
>>
>> 1. FileReference>>gtInspectorItemsIn: composite
>> ...
>> column: 'Size' evaluated: [:each | each humanReadableSize] width: 100;
>> ...
>>
>> 2. FileReference>>humanReadableSize
>> ^ self size humanReadableSIByteSize
>>
>> 3. MessageNotUnderstood: False>>humanReadableSIByteSize
>> because "self size" returns false for files > 4GB so it fails and thus I
>> cannot navigate to folders with such files (for example my home directory).
>>
>
> Ok. Could you please open a bug report on that for the inspector?
>
>

This is an issue for the linux vm :
"14250  Enable large file
support on linux"

on windows, you can list directories with files > 2G

FileSystemStore returns false on #size, if the file can not be found. Thats
the reason why the inspector shows the "MessageNotUnderstood:
False>>humanReadableSIByteSize" error.
And the files can not be found, because the unix VM uses lstat on the
directory entries to retrieve the file attributes. And lstat does not work
for files with sizes larger than 32Bit.


[Pharo-users] question on syntax "negate numbers"

2014-11-08 Thread Nicolai Hess
Old compiler refuses to accept this code:

- 4 @ -5
^-- nothing more expected

Opal compiler does just fine:

- 4 @ -5 -> (-4@ -5)

who is right?


Re: [Pharo-users] question on syntax "negate numbers"

2014-11-21 Thread Nicolai Hess
2014-11-10 12:47 GMT+01:00 Werner Kassens :

> >3 @ -  5 is what I object to (and Opal allows)
> with this i have no problems, it follows simple obvious rules as long as
> one knows that #@ cant be an unary operator.
> >is 4 - 5 two literals, or is it two literals separated by the - operator ?
> but then there is no situation in which the - operator can really operate
> and where a sequence of literals is at the same time possible. ok there is
> #(4 - 5), but in this case the operator cant operate and first the
> #()-thing is parsed and then its elements.
> what has not been mentioned is: 4 -- 5, which in a certain way was (?)
> problematic: my (old) pharobook (p.64) says: "Note that −− is not allowed
> for parsing reasons". in this case it should be seen as 4 - -5 and one
> needed to keep this special case in his mind, but i had no problems
> defining a #--, which simplifies everything: if there is no special case,
> then -- has to be parsed as one binary operator. and i only have an old
> pharobook, a newer one perhaps (?) doesnt state this.
>
> all this just from my simple user perspective of course, but i guess the
> question was not posed without reason in Pharo-Users. and this simple user
> prefers freedom over paternalism anyday.
> werner
>
>

Thanks for all the answers,
so, for better portability, maybe we should dissallow opals current
behavior and only accept "-5" and not "- 5" as negative numbers?

Nicolai


Re: [Pharo-users] question on syntax "negate numbers"

2014-11-22 Thread Nicolai Hess
2014-11-22 13:23 GMT+01:00 Werner Kassens :

> >Thanks for all the answers,
> >so, for better portability, maybe we should dissallow opals current
> behavior
> >and only accept "-5" and not "- 5" as negative numbers?
>
> Hi Nicolai,
> perhaps. if you mean portability pharo->otherLanguage certainly. if you
> mean otherLanguage->pharo, well you are the specialist, i only know pharo
> and squeak as smalltalk dialects. of course you know that there exist
> non-OO-languages that return the same result as opal if you enter "1 + - 2
> -->-1". and of course i know that if i want to translate something from
> those other languages, deleting a  is the most simple of my problems.
>

portability pharo -> other smalltalk languages. Consider you have a library
that could be used on other smalltalk systems. And it just don't work
because there is a space between the number and the sign.



>
> changing the pov slightly, when do you have to enter a negative number in
> a program by hand? essentially only if you use that number as a constant
> (apart from tests of course). numbers are entered often automatically from
> outside files. ok, then you have those parsers that read in a string in a
> more flexible way. but wouldnt it make sense if the compiler reacts
> somewhat similar to those parsers? i for example do have a program, where
> the user, admittedly not a usual user but essentially me, enters simple
> inequalities (and here negative numbers are very common) as strings and the
> compiler eats those strings more or less directly without any additional
> parser put in between.
>
> i realize that with your reply you'd prefer a fact based argumentation and
> i readily admit that as a simple user, i see it simple stupid emotionally.
> if i understand pharo's history correctly, it came into existence because
> some language developers wanted more freedom. of course syntax controls
> thinking. i dont have any real problems if you disallow - 5, i use -5
> anyway, if it makes sense do it, you are the specialist. but what comes
> next? will everything you enter into nautilus automatically be
> pretty-printed? i understand that pharo has grown up now, and it makes
> complete sense to me that it wants to play with the big boys. perhaps you
> need a clear-cut simple structured syntax to get accepted by the business
> community, but not every businessman is a complete idiot and for example
> mathematica, which understands "1 + - 2", _is_ occasionally used to make
> some real money. i'd think about how far i'd wanna go with this thought
> control thing. so much  for my personal pov.
> werner
>
>
thank you werner, for your point of view.

If someone came up with a good reason why opals behavior is actually wrong,
I would change it. But I think now, it is not that important. We have much
more things with higher priority.


nicolai


Re: [Pharo-users] layout and other potential class-side variables

2014-11-23 Thread Nicolai Hess
2014-11-23 15:15 GMT+01:00 Peter Uhnák :

> So I accidentally assigned some content to 'layout' variable in class side
> and realized much later that it has overridden some Slot's FixedLayout.
>
> Looking up the inheritance chain (Object & ProtoObject) I couldn't find
> anything so I don't know where is this coming from or how it is added there.
>
> But most importantly: are there more variable names that I should be aware
> of that could get accidentally overridden?
>
> Thanks,
> Peter
>


Yes, that is a problem, and there is already an issue at fogbugz:

11783 
#layout should be renamed to e.g. #slotLayout
(actually, it is renamed to classLayout)

and there are other messages like #users for trait users
13274 
Replace users by traitUsers


Re: [Pharo-users] TextModel arrows controls

2014-11-24 Thread Nicolai Hess
2014-11-24 18:29 GMT+01:00 Mark Rizun :

> Hello!
>
> I stumbled on a strange problem, when was using TextModel widget.
> The problem is that I can't control I-beam pointer with arrow keys inside
> of
> TextModel.
> They just do not work. Maybe I have to set some methods?
>

No other methods are needed:

TextModel new text:'hello' ; openWithSpec

This opens a window with the text 'hello' and I can move the cursor with the
arrow keys (os: windows 7).
Can you give a minimal example that does not work for you.




>
> Best,
> Mark
>
>
>
> --
> View this message in context:
> http://forum.world.st/TextModel-arrows-controls-tp4792013.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] Emergency evaluator and GTGenericStackDebugger

2014-12-07 Thread Nicolai Hess
Hi,

what image do you use?
If it is pharo4, you can open the settings (World menu>System>Settings) and
disable GT playground and inspector (Glamorous Toolkit settings)




2014-12-07 6:08 GMT+01:00 Edward Povazan :

> Hello,
>
> I’ve been using Pharo for a while as my playground for trying things out,
> it’s a very soothing place to code and figure out algorithms (except that
> when I return to my “real world”, the friction with modern tools is
> amplified). I’m still a newb when it comes to knowing how things work
> deeper down.
>
> I’m a little stuck. I did something (can’t remember) and not realizing
> that I had a problem, saved my image too.
> Now when I try open a Workspace, I get a *** System error handling failed
> *** with a huge amount of text.
>
> I’ve uploaded a screen grab here: http://imgur.com/4ZwsF6e
>
> Is this worth debugging?
>
> My plan is to install the origin tools, and remove GToolkit. And then
> reinstall GToolkit.
> Would this help?
>
> And, how? I realize I don’t know what tools are in the default Pharo3
> image!
> Can someone tell me what they are called?
>
> Thanks! Can’t wait to get back to the happy place!
> -Ed
>


Re: [Pharo-users] modifying the compiler adding an alias for :=

2014-12-10 Thread Nicolai Hess
2014-12-10 13:32 GMT+01:00 Erik Itter :

>  Thanks, tried
>
> scanSpecialCharacter
> | character |
> currentCharacter = $:
> ifTrue: [
> self step.
> ^ currentCharacter = $=
> ifTrue: [
> self step.
> RBAssignmentToken start: tokenStart]
> ifFalse: [ RBSpecialCharacterToken value: $: start:
> tokenStart ]].
>
> currentCharacter = $:
> ifTrue: [
> self step.
> ^ currentCharacter = $>
> ifTrue: [
> self step.
> RBAssignmentToken start: tokenStart]
> ifFalse: [ RBSpecialCharacterToken value: $: start:
> tokenStart ]].
>
> currentCharacter = $_ ifTrue: [
> self step.
> ^ RBShortAssignmentToken start: tokenStart ].
>
> character := currentCharacter.
> self step.
> ^ RBSpecialCharacterToken value: character start: tokenStart
>
> but while it does not seem to shred my image to pieces it also seems to
> have no effect at all. I guess the UI components still check differently
> and neither workplace nor SystemBrowser allow me to write code using the :>
> operator
>
> Am 10.12.2014 um 13:11 schrieb Thierry Goubier:
>
>   Hi,
>
>  If you are using the OpalCompiler (Pharo4, sure, Pharo3, I'm not so
> sure), have a look at:
>
>  RBScanner>>scanSpecialCharacter
>
>  Thierry
>
> 2014-12-10 12:57 GMT+01:00 Erik Itter :
>
>> Hi,
>>
>> I need to modify the compiler adding ":>" as an alias for ":=" for
>> assignment. I have been reading all over the Compiler package but do not
>> find where a tokenizer parses for the assignement operator or where it is
>> defined.
>>
>> Any hint where to start or do it is appreciated.
>>
>> best regards
>> Erik
>>
>>
>
>
Hi Erik

with Opal resp. RBScanner (in pharo3 and pharo4)
There is a special handling for
k:=1
and
k := 1
because "k" can be an identifier, or the start of a selector (keyword
message) therefore you
have to change this too:

RBScanner>>#scanIdentifierOrKeyword

(currentCharacter = $: and: [stream peek ~= $=])"< add a test
for $>"
ifTrue: [^self scanKeyword].


and the browsers/editor source code panel uses SHParserST80 for the syntax
highlighting:

SHParserST80>>#isAssignment
^ currentToken = ':='
or: [currentToken = '_']   "< add atest for $> "



nicolai


Re: [Pharo-users] Problem with Spec icon

2014-12-14 Thread Nicolai Hess
2014-12-14 20:26 GMT+01:00 Tommaso Dal Sasso :
>
> I have a weird behavior building an interface with Spec.
>
> I have a window built with Spec, and I want to add a button that shows a
> dialog with some text.
> To display the dialog I use the following line:
>
> UIManager default longMessage: 'a text message' title: 'some title'.
>
> And I hooked this code to a widget through the #action: method.
> The problem is: If I use a ButtonModel, the code behaves correctly showing
> the dialog.
> If I use an instance of the class ImageModel to display an icon, the
> dialog is displayed but the interface "hangs", in the sense that the "ok"
> button won't close the dialog and every click would spawn a new dialog.
>
> I would like to use an icon because it integrates better with the
> interface.
> Do you know if it is a bug or if I am doing something wrong?
>
> Thanks,
> Tommaso
>
>
> P.s.: Steps to reproduce
>
> If you need a working example you can inspect the code on the bleeding
> edge version of ShoreLine Reporter by following these instructions:
> 1. download a recent Pharo 4 image;
> 2. open a workspace and run: ConfigurationOfShoreLineReporter
> loadBleedingEdge
> 3. trigger an exception (for example by running 3/0 in a workspace).
> 4. click 'Report'
> 5. click the '?' button on the right side of the window.
>
>


This is a known problem, if a modal dialog is opened from a "mouse
clicked"  event.


Re: [Pharo-users] Problem with Spec icon

2014-12-14 Thread Nicolai Hess
2014-12-14 22:14 GMT+01:00 Tommaso Dal Sasso :
>
>
> On 14/12/14 21:44, stepharo wrote:
>
>> I got the same problem when I put an Halt pressing on any button leads to
>> the opening of the same UI.
>> I wonder if there is not an interaction between spec and the UI modal
>> opening.
>> I read the code of ImageModel and I did not find anything special.
>>
>>  Yes, I thought as well that could be something regarding modal UI, but I
> have so little knowledge of Spec and the way it interacts with Morphic that
> I could not tell more.
> OK, it works correctly if I put the dialog code inside a block and i fork
> it, so probably the modal window blocks the way the action of the icon is
> triggered.
>


No, it is not related to spec, just the way the imagemodel adapter uses
morphics click event for the action dispatching.
You can simulate the same (buggy) behavior on pure morphic:

|m|
m:= Morph new.
m on:#click send:#value to:[m confirm:'Really?'].
m openInWorld.


MouseClickEvent processing and modal dialogs don't work.




>
> I'll try to investigate more.
> Thanks for the feedback,
>
> Tommaso
>
>
>  Stef.
>> Le 14/12/14 20:26, Tommaso Dal Sasso a écrit :
>>
>>> I have a weird behavior building an interface with Spec.
>>>
>>> I have a window built with Spec, and I want to add a button that shows a
>>> dialog with some text.
>>> To display the dialog I use the following line:
>>>
>>> UIManager default longMessage: 'a text message' title: 'some title'.
>>>
>>> And I hooked this code to a widget through the #action: method.
>>> The problem is: If I use a ButtonModel, the code behaves correctly
>>> showing the dialog.
>>> If I use an instance of the class ImageModel to display an icon, the
>>> dialog is displayed but the interface "hangs", in the sense that the "ok"
>>> button won't close the dialog and every click would spawn a new dialog.
>>>
>>> I would like to use an icon because it integrates better with the
>>> interface.
>>> Do you know if it is a bug or if I am doing something wrong?
>>>
>>> Thanks,
>>> Tommaso
>>>
>>>
>>> P.s.: Steps to reproduce
>>>
>>> If you need a working example you can inspect the code on the bleeding
>>> edge version of ShoreLine Reporter by following these instructions:
>>> 1. download a recent Pharo 4 image;
>>> 2. open a workspace and run: ConfigurationOfShoreLineReporter
>>> loadBleedingEdge
>>> 3. trigger an exception (for example by running 3/0 in a workspace).
>>> 4. click 'Report'
>>> 5. click the '?' button on the right side of the window.
>>>
>>>
>>>
>>>
>>
>>
>
>


Re: [Pharo-users] Problem with Spec icon

2014-12-14 Thread Nicolai Hess
2014-12-14 23:52 GMT+01:00 Tommaso Dal Sasso :
>
>
> On 14/12/14 22:59, Nicolai Hess wrote:
>
>> 2014-12-14 22:14 GMT+01:00 Tommaso Dal Sasso > <mailto:tommaso.dalsa...@gmail.com>>:
>>
>>
>> On 14/12/14 21:44, stepharo wrote:
>>
>> I got the same problem when I put an Halt pressing on any
>> button leads to the opening of the same UI.
>> I wonder if there is not an interaction between spec and the
>> UI modal opening.
>> I read the code of ImageModel and I did not find anything special.
>>
>> Yes, I thought as well that could be something regarding modal UI,
>> but I have so little knowledge of Spec and the way it interacts
>> with Morphic that I could not tell more.
>> OK, it works correctly if I put the dialog code inside a block and
>> i fork it, so probably the modal window blocks the way the action
>> of the icon is triggered.
>>
>>
>>
>> No, it is not related to spec, just the way the imagemodel adapter uses
>> morphics click event for the action dispatching.
>> You can simulate the same (buggy) behavior on pure morphic:
>>
>> |m|
>> m:= Morph new.
>> m on:#click send:#value to:[m confirm:'Really?'].
>> m openInWorld.
>>
>>
>> MouseClickEvent processing and modal dialogs don't work.
>>
>>  Sorry, I wrote it badly. Of course it is an issue of Morphic, thanks for
> your clarification.
> So, is it a bug or it just works that way and it is supposed to do so by
> architectural design?
>

I think it is a bug on morphics mouse click handling.

The UI-element for a ButtonModel is a PluggableButtonMorph, it already has
support for handling
"clicks", but it only acts on mouse up /(or mouse down)

An ImageMorph don't have this by default, so the ImageModel adapter
installs a eventhandler with
on:event do:action and the creator of Spec choosed #mouseUp for the mouse
event to act on.


Nicolai


>
> The interesting thing is that with a button it works.
>
> Tommaso
>
>
>
>>
>>
>> I'll try to investigate more.
>> Thanks for the feedback,
>>
>> Tommaso
>>
>>
>> Stef.
>> Le 14/12/14 20:26, Tommaso Dal Sasso a écrit :
>>
>> I have a weird behavior building an interface with Spec.
>>
>> I have a window built with Spec, and I want to add a
>> button that shows a dialog with some text.
>> To display the dialog I use the following line:
>>
>> UIManager default longMessage: 'a text message' title:
>> 'some title'.
>>
>> And I hooked this code to a widget through the #action:
>> method.
>> The problem is: If I use a ButtonModel, the code behaves
>> correctly showing the dialog.
>> If I use an instance of the class ImageModel to display an
>> icon, the dialog is displayed but the interface "hangs",
>> in the sense that the "ok" button won't close the dialog
>> and every click would spawn a new dialog.
>>
>> I would like to use an icon because it integrates better
>> with the interface.
>> Do you know if it is a bug or if I am doing something wrong?
>>
>> Thanks,
>> Tommaso
>>
>>
>> P.s.: Steps to reproduce
>>
>> If you need a working example you can inspect the code on
>> the bleeding edge version of ShoreLine Reporter by
>> following these instructions:
>> 1. download a recent Pharo 4 image;
>> 2. open a workspace and run:
>> ConfigurationOfShoreLineReporter loadBleedingEdge
>> 3. trigger an exception (for example by running 3/0 in a
>> workspace).
>> 4. click 'Report'
>> 5. click the '?' button on the right side of the window.
>>
>>
>>
>>
>>
>>
>>
>>
>
>


Re: [Pharo-users] Question about Morphic in Pharo 4

2014-12-19 Thread Nicolai Hess
Spec is all about *composing* models.
If you want a GUI with many UI elements and try to build this with
a single model, spec won't be much help.

2014-12-19 20:54 GMT+01:00 kilon alios :
>
> "Can you help me understand?"
>
> sure take this simple example I want to add a button for choosing
> background color, I am giving you the list of my problems
>
> 1) If I want to initialise it I cant use the initialise method of my class
> (why ? ) I have to use initializeWidgets
>

That's the distinction spec makes for composing models
MyModel>>initialize
"do whatever your model *implementation* needs
MyModel>>initializeWidget
"instantiate the (sub)models your model is build upon"
MyModel>>initializePresenter
"interconnect the internals of your (composed)model"


>
> 2)  Inside initializeWidget I create an array that describes the name of
> each button but no that is not enough
>
> 3) I have also have to initialise seperately the button with self
> newButton but wait that is not enough
>

Not both are needed, either you call newXmodel for every model or you call
instantatieModels with an array of "instanceVars and Models"


>
> 4) I have to define the action of the button the only step here that makes
> sense to me but even that is not enough
>
> 5) I have to create a method that returns the name of the button and to
> makes things even more verbose
>

spec is designed to provide *reusable* models.


>
> 6) I have to define a method at the class side for positioning the button
> . No idea why this goes to the class side
>

A model is defined by its structure and layout, if you want to use a
different layout, you can
subclass the model and define your own defaultSpec, or a pragma, or you
call it explicitly
#buildWithSpec:


>
> And all that so I can say to Spec take this button which has this label
> and will trigger this method and put it in that place. Java Swing is not
> that verbose.
>

Take a look at DynamicComposableModel (the examples in pharo or the
examples posted on this list), for a simple GUI you only need some few
lines of code.


>
> Generally I dont like this approach that I need to generate so many method
> and so many steps to define something so simple.
>
> So what happens right now is that I have a very simple GUI with 7 buttons
> and 6 moprh that i use to display colors , guess how many methods my class
> has .
>

Can you show me the UI (screenshot/ or a drawing of it) you try to develop?
I would love to see how I would construct the UI based on spec.


>
> 36 !!!
>
> By the way in case you wonder 90% of the code is just Spec. For me thats
> plain unacceptable.
>

That's not unusual. 90% spec means "not 90% morphic"


>
> So what happens if I have a GUI with over 100 buttons do I need 300
> methods just for Spec ? Really ??
>

If you have 100 buttons in one GUI without the possiblity to divide it in
small reusable
parts, then spec may be your smallest problem.


The existing API and implementation of spec is not well designed. Even
though it is meant
to be independent of the backend, the existing models and adapter pretty
much resemble
morphics (not well designed (or badly grown) ) api.

Some parts of the exising models looks like:
"hey look how easy it was to add this and that and ..."
(Just look at the number of instVars and announcers and different whenXDo:
methods)

Both, spec and morphic are grown, and that is bad for most frameworks.
Of course we can discuss this and try to fix bugs or cleanup the
implementation - > bugtracker.

The two years I am working with pharo and reading this list, I have read
more
complains than constructive critics (about morphic and spec).
We have the following options:
- complain
- constructive critics
- contribute
- develop a new framework (develop *active*)

choose wisely


Re: [Pharo-users] Spec: "pluggable" widgets / label-input layout?

2014-12-20 Thread Nicolai Hess
2014-12-20 5:49 GMT+01:00 Daniel Lyons :

> Supposing I have a domain model, Activity, which looks like this:
>
> Object subclass: #Activity
> instanceVariableNames: 'title cost'
> classVariableNames: ''
> category: 'PERT'
>
> Then I have the expected accessors for title and cost.
>
> I make a Polymorph dialog for editing one of these things like so:
>
> PolymorphEditActivity>>edit: anActivity
> | builder content dialog |
> activity := anActivity.
> builder := Smalltalk ui theme builder.
>
> content := builder newLabelGroup: {
> 'Title' -> (builder newTextEntryFor: self activity
> getText: #title setText: #title: help: 'The title of the activity').
> 'Cost' -> (builder newTextEntryFor: self activity getText:
> #cost setText: #cost: help: 'The cost of the activity')
> }.
> dialog := builder newPluggableDialogWindow: 'Edit activity' for:
> content.
> ^ builder openModal: dialog.
>
> *First question*: how do I return a value from the dialog?
>

You don't need the return something, you don't even need to use a separate
instvar in the PolymorphEditActivity.
If "anActivity" is a Activity with the accessor #title / #title:
#cost/#cost:, the PluggableDialogWindow will change this
attributes only if the dialog is closed with "OK"


| anActivity builder content dialog |
anActivity := Activity new.
anActivity title: 'what'.
anActivity cost: '100'.
builder := Smalltalk ui theme builder.
content := builder
newLabelGroup:
{('Title'
->
(builder
newTextEntryFor: anActivity
getText: #title
setText: #title:
help: 'The title of the activity')).
('Cost'
->
(builder
newTextEntryFor: anActivity
getText: #cost
setText: #cost:
help: 'The cost of the activity'))}.
dialog := builder newPluggableDialogWindow: 'Edit activity' for:
content.
   builder openModal: dialog.
anActivity inspect


Re: [Pharo-users] Spec: "pluggable" widgets / label-input layout?

2014-12-20 Thread Nicolai Hess
The spec part of your question:

2014-12-20 5:49 GMT+01:00 Daniel Lyons :

> Supposing I have a domain model, Activity, which looks like this:
>
> Object subclass: #Activity
> instanceVariableNames: 'title cost'
> classVariableNames: ''
> category: 'PERT'
>
> Then I have the expected accessors for title and cost.
>
> Now the Spec version of this I have looks like this:
>
> SpecEditActivity>>initializePresenter
> super initializePresenter.
> titleWidget whenTextChanged: [ :newText | activity title: newText
> ].
> costWidget whenTextChanged: [ :newCost | activity cost: newCost ]
>
> Then on the class side of things, I have this layout:
>
> SpecEditActivity class>>layout
> 
> ^ SpecLayout composed
> newColumn: [ :column |
> column
> newRow: [ :row |
> row
> add: #titleLabel;
> add: #titleWidget ];
> newRow: [ :row |
>  row
> add: #costLabel;
> add: #costWidget ] ];
> yourself
>
> I make all the expected "getter" methods.
>
> I can see how to get the model value out: I do something like this:
>
> activityDialog := SpecEditActivity new openDialogWithSpec; yourself.
> activityDialog model activity
>

First, please don't add a method #layout on the class side, this conflicts
with the notion of "Slots" (bug reported, but it is not fixed yet)



>
> I have two questions about the Spec side of the house:
>
> 1. The title/costWidget whenTextChanged: stuff. With Polymorph, I can just
> say, here's an object, here's the getter/setter, deal with it. Does Spec
> have anything like this, or do you have to do this manual data shuffling?
> Is there an example I can learn from?
>

If you just want to show an edit dialog, I would separate the
Acitivty-Model (two textfields) from your domain model "Activity". Then you
don't need this "whenTextChanged". This is only needed if other elements
from the model
depend on the textfield content.

Now you can use spec to only show a dialog and after closing this dialog
you can retrieve the values with

activitiy title: theDialogModel titleWidget text
activity cost:  theDialogModel costWidget text




>
> 2. This layout is a bit on the ugly side. I looked at the examples and saw
> usage of the expert layout with asking how tall a line is. Is that the best
> that can be done, or is there something more like Polymorph's label layout
> that can be used instead?
>

you can define the hight of the rows based on the inputfield default height
(based on the current theme) (ComposableModel class >>#defaultInputHeight

Take a look at Komitters CredentialEditor


> Thanks for your time and patience!
>
> —
> Daniel Lyons
>
>
>
>
>


Re: [Pharo-users] Question about Morphic in Pharo 4

2014-12-20 Thread Nicolai Hess
This is how I would do it. (see attachement)
What do you say? Is it clearer now what I meant with
compose and reusable models?

I am curios how would a pure morphic based solution look like.

As it is just a simple dialog, I think the pure morphic version would be
similar (in code size)
and of course, it can be build by small reusable parts as well.



2014-12-20 0:18 GMT+01:00 kilon alios :

> yes you can find my code here
>
> https://github.com/kilon/Nireas
>
>
>
> On Sat, Dec 20, 2014 at 12:17 AM, Johan Fabry 
> wrote:
>
>> 36 methods for your UI is way too much. I suppose you are doing something
>> wrong somewhere. You should not need all of these steps. It should be:
>>
>> First you add the instance var (e.g. button) and accessors (BTW: Generate
>> the accessors. It’s 3 keystrokes and a click), otherwise the UI object
>> cannot reference its widgets.
>>
>> For 1) see my previous mail. The idea is to have 1 clear responsibility
>> per method, it’s good software engineering principles to do that.
>>
>> You don’t need to do 2)
>>
>> 3) if you don’t put a specific object inside the variable there is no way
>> for the system to know what kind of widget you want.
>>
>> 4) yes this makes sense :-)
>>
>> I do not understand what you mean with 5), sorry. I don’t do anything
>> like that.
>>
>> 6) you have to state where this button has to go, there is no way around
>> that. Class side is not so intuitive, OK. But at least all the layout is in
>> one place so we have 1 clear responsibility for each method.
>>
>> To summarize, there are 4 steps and none of them can really be omitted.
>>
>> I would like to have a look at your UI class so I can figure out what’s
>> going on. Can you tell me where to find it?
>>
>> > On Dec 19, 2014, at 16:54, kilon alios  wrote:
>> >
>> > "Can you help me understand?"
>> >
>> > sure take this simple example I want to add a button for choosing
>> background color, I am giving you the list of my problems
>> >
>> > 1) If I want to initialise it I cant use the initialise method of my
>> class (why ? ) I have to use initializeWidgets
>> >
>> > 2)  Inside initializeWidget I create an array that describes the name
>> of each button but no that is not enough
>> >
>> > 3) I have also have to initialise seperately the button with self
>> newButton but wait that is not enough
>> >
>> > 4) I have to define the action of the button the only step here that
>> makes sense to me but even that is not enough
>> >
>> > 5) I have to create a method that returns the name of the button and to
>> makes things even more verbose
>> >
>> > 6) I have to define a method at the class side for positioning the
>> button . No idea why this goes to the class side
>> >
>> > And all that so I can say to Spec take this button which has this label
>> and will trigger this method and put it in that place. Java Swing is not
>> that verbose.
>> >
>> > Generally I dont like this approach that I need to generate so many
>> method and so many steps to define something so simple.
>> >
>> > So what happens right now is that I have a very simple GUI with 7
>> buttons and 6 moprh that i use to display colors , guess how many methods
>> my class has .
>> >
>> > 36 !!!
>> >
>> > By the way in case you wonder 90% of the code is just Spec. For me
>> thats plain unacceptable.
>> >
>> > So what happens if I have a GUI with over 100 buttons do I need 300
>> methods just for Spec ? Really ??
>>
>>
>>
>> ---> Save our in-boxes! http://emailcharter.org <---
>>
>> Johan Fabry   -   http://pleiad.cl/~jfabry
>> PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile
>>
>>
>>
>


theme_editor.cs
Description: Binary data


Re: [Pharo-users] How to open the Settings style dialog?

2014-12-20 Thread Nicolai Hess
2014-12-15 17:15 GMT+01:00 Rafael Luque :

> Hi all,
>
> I was reading about the Settings framework (Deep Into Pharo, chapter 5)
> and I don't find the way to popup the style dialog shown in Figure 5.11 in
> page 71 (
> https://books.google.es/books?id=Qki8BQAAQBAJ&lpg=PA68&dq=pharo%20the%20style%20load%20dialog%20with%20your%20own%20style&pg=PA71#v=onepage&q&f=false
> ).
>
> I'm using a Pharo 4 image.
>
> Thank you
>


The last occurence of the "Style" menu in the settings browser, I found, is
Pharo 1.3.


Re: [Pharo-users] CrossMorph in PBE and compositing bug

2014-12-27 Thread Nicolai Hess
2014-12-27 4:10 GMT+01:00 Edward Povazan :

> Thanks. It does work to add a little alpha to the colour, but is there no
> other way?
> If I want a solid colour, then what? I should be able to say “this is a
> weird shaped morph, not a rectangle”, but not seeing it.
>
> -Ed
>

Hi Edward
There are two possible solutions:

If you look at for example StringMorph, PolygonMorph or EllipseMorph and to
their "drawing" protocoll, you'll see they overwrite
areasRemainingToFill:
if you copy this method to the CrossMorph class, it will work as you want.

The reason for this is, the default morph uses its color to paint the whole
area and don't need
to care about the underlying area.

The second solution, as you may have seen from looking at the code in Morph
areasRemainingToFill:
is to use a transparent color ("Color transparent") for your morph (the
default color is "Color blue")
and use a different color actually for painting the cross.
(for example, you can add another instance variable "crossColor" and use
that one in the
drawOn: method.


nicolai






>
>
> > On Dec 26, 2014, at 11:58 AM, Hilaire  wrote:
> >
> > Hello,
> >
> > Morph color can be set to translucent, in your example it is problably
> > set with ColorTranslucent r:g:b or a similar class. Not sure about the
> name.
> >
> > Hilaire
> >
> > Le 26/12/2014 20:43, Edward Povazan a écrit :
> >> Hello,
> >>
> >> In the PBE example, and CrossMorph is created. As can be seen from its
> name, It is has a cross shape.
> >>
> >> When one adds keyboard handling to move it about, it seems the
> compositor thinks it is opaque, and doesn’t repaint the “not cross” areas
> with whatever is behind the morph.
> >>
> >> The result is the shape smears across the screen.
> >> This only occurs when moving exactly horizontally or vertically.
> >>
> >> I’ve been looking over the Morph API but can’t detect a method like
> #opaque: or #translucent: or similar.
> >>
> >> Is this a bug, or am I missing the correct way to deal with
> transparent/irregular shaped morphs?
> >>
> >> Thanks,
> >> -Ed
> >>
> >>
> >>
> >
> >
> > --
> > Dr. Geo - http://drgeo.eu
> > iStoa - http://istoa.drgeo.eu
> >
> >
>
>
>


Re: [Pharo-users] Problem with bugtracker

2015-01-05 Thread Nicolai Hess
Hi Mark,

I reviewed some of your changes for that issue, but it was difficult,
because you made
some new changes and it wasn't clear when it is ready or what was the
original error
and if it is solved now.

you can set the state to "resolved" again and wait for the monkey to
do the validation again. If there is still, there will be a new
"Issue Validation Failed"-result page.


nicolai


2015-01-05 20:10 GMT+01:00 Mark Rizun :

> Hello,
>
> While ago, I've resolved an issue  14254
> <
> https://pharo.fogbugz.com/f/cases/14254/AST-method-replaceWith-does-not-change-source-interval
> >
> and validation was successful. Since that time, I didn't check this issue
> as
> was busy. Turned out after successful validation, there was a failure,
> which
> I can't take a look at, because it's not found (404 error). Just wanted
> this
> slice to be included in Pharo4.
>
> Best,
> Mark
>
>
>
> --
> View this message in context:
> http://forum.world.st/Problem-with-bugtracker-tp4797910.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] Code highlight

2015-01-19 Thread Nicolai Hess
2015-01-19 14:36 GMT+01:00 Mark Rizun :

> Hi everyione,
>
> When one selects piece of code in any code editor pane, every other same
> piece is highlighted with less bright color.
> I'm using spec to build a UI and would like to know which event is
> responsible for this highlihts.
>

This is in TextMorphForEditView>>#selectionChanged.
Recognizing this change and searching/updating other selections are only
handled between the TextMorph and the Text Paragraph
(Paragraph>>#displayExtraSelectionOn:)
I don't think Spec (or  the TextModel class) is aware of this property.
(The same for findAndReplace-search results).


> For example, in TextModel there is one event that probably is related to my
> problem, but I'm not sure: #whenReadSelectionIsChanged:
> So, what I want is to use the event which is invoked when selection of code
> is changed - probably it is the name of event :)
>
> Mark
>
>
>
> --
> View this message in context:
> http://forum.world.st/Code-highlight-tp4800337.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] Centering a Label with Spec

2015-01-21 Thread Nicolai Hess
Hi Piotr,

like you already found out, you can use whenBuiltDo:
But instead of using #hResizing:  , which is not explicit in specs api
you can call the method hShrinkWrap (look in AbstractMorphicAdapter,
protocol 'protocol').

Here is a small example with centering a label:

| ui layout |

ui := DynamicComposableModel new.
ui title: 'hello'.
ui instantiateModels: #(
label LabelModel
check CheckBoxModel
text TextInputFieldModel
button ButtonModel ).
ui label text:'Hello World'.
ui label whenBuiltDo:[: widget |widget widget hShrinkWrap.].
layout := SpecLayout composed
newRow: [ :r | r add: #label] height: 25;
yourself.
ui openWithSpecLayout: layout.


the block arguemt for whenBuiltDo: is a WidgetBuilt announcement, that
gives you access to the model and the widget (-adapter)
that is used.


nicolai


pharo-users@lists.pharo.org

2015-01-24 Thread Nicolai Hess
Hi Piotr


2015-01-24 20:24 GMT+01:00 Piotr Klibert :

> Haha, ok, that's not exactly the answer I was hoping for, but well, I
> can't say it was a complete surprise ;-)
>
> I'll try grokking drag&drop implementation in Pharo next week and
> doing something with it. In my app I'm going to have one very long
> list as a source and a few other lists as destinations. To make it
> worthwhile I need to have support for dragging all items a current
>

The problem is, dragging stars after the mouse click on the list items
changes the selection. That means, selecting all items and after
that click on one item to start dragging, this item will be unselected.

You can select all but one item and then click AND drag the last item.



> selection and additionally a way to make selection non-continuous,
> essentially what most list widgets do with Ctrl+click.
>

This should work (justed test this with  a ListModel with multiselection
enabled)



>
> Any help appreciated!
>
>
> Best regards,
> Piotr Klibert
>
>
> 2015-01-24 19:52 GMT+01:00 stepharo :
> >
> > Le 24/1/15 18:27, Piotr Klibert a écrit :
> >>
> >> Hi,
> >>
> >> working towards my app I encountered another problem. It's about drag
> >> and drop support for lists in Spec and underlying Morphs.
> >>
> >> While multiple selection is well supported in PluggableListMorph,
> >> reading #startDrag: and #startDragExtended: led me to believe that
> >> there is no support for dragging a bunch of list elements at once.
> >
> >
> > The drag and drop support sucks. I'm sorry about it. But this is a
> reality.
> >
> >>   It
> >> looks like drag is always initialized for the element that was clicked
> >> (dragIndex := self rowAtLocation: evt position.) and I see no easy
> >> extension point for changing this to support dragging all selected
> >> items instead.
> >>
> >> Am I missing some methods or classes that would let me do this, or is
> >> this indeed not possible right now? How would I go about implementing
> >> it?
> >>
> >>
> >> Best regards,
> >> Piotr Klibert
> >>
> >>
> >>
> >
> >
>
>


Re: [Pharo-users] pharo _looks_ good, but can be improved ...

2015-01-25 Thread Nicolai Hess
Am 25.01.2015 16:20 schrieb "Esteban Lorenzano" :
>
> But next year we will have an Athens based UI, so the performance will
improve dramatically :)

Yes? What? Bloc or morphic on top of athens ?
And what makes you think, Athens is fast er?

> Real problem is to invest time (and talent) to improve current design...
It costs much more than you could believe.
>
> Esteban
>
>
>
> > On 25/1/2015, at 15:42, Mayuresh Kathe  wrote:
> >
> >> On Sun, Jan 25, 2015 at 03:35:40PM +0100, Aliaksei Syrel wrote:
> >>> On Sun, Jan 25, 2015 at 3:02 PM, Mayuresh Kathe 
wrote:
> >>>
> >>> http://www.google.com/design/spec/material-design/introduction.html
> >>
> >>
> >> It is almost impossible to do it like this in Pharo now because of low
> >> drawing performance and bad support of animations. Sad but true.
> >
> > thanks for the note.
> >
> > per you, how long would this low drawing performance and bad support for
> > animations issue hold true?
> >
> > ~mayuresh
> >
> >
>


Re: [Pharo-users] Pharo Sound of Silence

2015-01-25 Thread Nicolai Hess
on what platform ? linux , mac or windows?

2015-01-25 17:55 GMT+01:00 Evan Donahue :

> Hello,
>
> I'm trying to get sounds working in Pharo and I seem to be unable to
> locate a combination of PharoExtras/Sound and image/vm version that add up
> to audible sound.
>
> The best I've done so far is pharo3/sound6.1, which lets me beep, and
> write sounds to wav files, but the primitive for playing sounds fails
> silently. The pharo4/sound6 combination seems not to have a SoundService
> object that Beeper depends on, so I don't even get beeps.
>
> If anyone could help me figure out which version of what code is best
> supported right now, or why the sound playing primitive is failing, it
> would be most appreciated.
>
> Thank you,
> Evan
>


Re: [Pharo-users] UI framework&design options

2015-01-25 Thread Nicolai Hess
2015-01-25 18:52 GMT+01:00 Sebastian Heidbrink :

> Okay,  I am new to the UI implementations and options in the Pharo
> world and I am really confused.
>
> So, am I right to say.
> - Polymorph is no more really the way to go?
> - Spec is the official way to go right now?
>
- Roassal2 is the way to go for visualizations?
> - Athens is well, I can't even say hmm interesting when it comes to
> SVG?
>

athens is a api for doing 2d rendering (shapes, fill, strokes, ..).
Roassal2 is built with athens.
DrGeo (https://launchpad.net/drgeo) was ported to use athens.


> - Glamour has to be seen in conjunction with Moose? I had a look into
> GTSpotter and I have the feeling this took a long long time for
> implementation.
> - No e.g. Google material like UI possible since there are no frameworks
> available to do animation stuff didn't Squeak and E-Toys do that? Is
> there nothing left in Pharo?
> - Lumiere or Roassal3D when it come to sprites?
>
> Are all of these framework compatible to each other? How much maintenance
> and repair effort may I expect when I combine e.g. Spec with Morphic and
> Roassal2?
>
> VASmalltalk has a very strong separation of UI-View and UI-Control layers.
> Which Pharo framework could allow me t replace the look and feel of my
> application without loosing my event handling/ control layers?
>

The look: there are different themes. And you can even use different themes
per application (I think).
The feel: I think pharos theming is only for the look, maybe keymappings
are theme dependent.



>
> This is Smalltalk and this is objects, and I am bound so much to a
> windowing representation? There is nothing I could do like with HTML5 and
> css? Put some pictures in the world and just add event handlers to them?
>

This is, for sure, much more easier in squeak/pharo than with HTML5 and
css. You can attach an eventhandler to any
morph (ImageMorph for example). And you are not "bound to windowing
representation".
This is exactly what morphs are for: build, use and combine visible and
active elements directly on the screen.
(The problem is now, this is not what people expect. They expect an
"application" with buttons and list and textfields.
And this is why you need frameworks like polymorph, spec or glamour, in
order to use commonly known widgets).




>
> So I might go with Spec and Morphic then? Glamour is more Moose? Or is
> there a direction to deprecate one of them?
>
> Thanks for all you into so far. I'll carefully read all the so far
> provided resources.
>
> Sebastian
>
>
>
>
>
>
> On 2015-01-25 6:04 AM, Stephan Eggermont wrote:
>
>> That Maya Node Editor looks like a PasteUpMorph with Connectors to me.
>> You'd might want to wrap them (Morphic) in a  in a standard window
>> with menu bar and toolbar from either Spec or Glamour for now.
>>
>> And then follow Bloc developments to move there.
>>
>> Stephan
>>
>>
>>
>
>


Re: [Pharo-users] Pharo Sound of Silence

2015-01-25 Thread Nicolai Hess
I don't know exaclty why we don't build the pulse audio plugin for pharo.
But you can
take a squeak vm (Squeak-4.3-all-in-one) for example and copy the
Squeak-4.3-All-in-One/Contents/Linux-i686/lib/squeak/4.4.7-2357/so.vm-sound-pulse
in your pharo-vm directory
pharo-vm/vm-sound-pulse

after that, sound works at least on ubuntu 14.04 with latest pharo vm and
image and pharoextras/sound package




2015-01-25 19:11 GMT+01:00 Evan Donahue :

> 64-bit Arch linux 3.17.6-1-ARCH
>
> I seem to be running pulse-audio with alsa, and I believe I have all the
> 32-compadibility libraries installed, but my experience with linux sound is
> limited. What is Pharo expecting?
>
> Thanks,
> Evan
>
>
>
> --
> View this message in context:
> http://forum.world.st/Pharo-Sound-of-Silence-tp4801562p4801584.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] Making the halo around windows preview more contrasted

2015-01-26 Thread Nicolai Hess
2015-01-07 18:20 GMT+01:00 Offray Vladimir Luna Cárdenas 
:

> Hi all,
>
> As usual, when I put the mouse over the name of a window, a small preview
> appears with a grey allow with the full name of the window, but letters are
> white surrounded by a pale grey making the full name really difficult to
> read. There is any way to increase the contrast there between font and
> background?
>

This is defined in UIThemeWatery>>#newTaskbarThumbnailIn: aThemedMorph for:
aWindow
It looks better with the WateryTheme, because it uses a darker background.
You can:
- define your own theme as a Subclass of Pharo3Theme and overwrite this
method
- change the background(color) of the world.



>
> Thanks,
>
> Offray
>
>


Re: [Pharo-users] Pharo Sound of Silence

2015-01-26 Thread Nicolai Hess
2015-01-26 11:45 GMT+01:00 Xavier MESSNER :

> Hi,
>
> I have written a chapter which explain how to have sound in Pharo.
> You can read it  here
> <
> https://github.com/SquareBracketAssociates/PharoReadyForReviews/tree/master/Sound
> >
> .
>
> In fact all you have to do is to disable pulse-audio to make it work.
> I have tested it with ubuntu 14.04 64, ubuntu 12.04 64, OpenSuse 13.2 64,
> sabayon 64 (don't remember the version) and should work for every
> distributions.
>

Thank you xavier.

We should discuss how to solve this. Neither "copy the squeak plugin", nor
"disabe pulse-audio",
is a good solution.

nicolai


>
> I think that should work for Pharo 4, but no time to test at the moment.
>
> Xavier.
>
>
>
> --
> View this message in context:
> http://forum.world.st/Pharo-Sound-of-Silence-tp4801562p4801687.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] Pharo Sound of Silence

2015-01-26 Thread Nicolai Hess
2015-01-26 17:10 GMT+01:00 Xavier MESSNER :

> Hi,
>
>
> > We should discuss how to solve this. Neither "copy the squeak plugin",
> nor
> > "disabe pulse-audio",
> > is a good solution.
>
> The two methods can be used. But I think the best is not to use the plugin.
> If the plugin is changing and is no longer compatible with Pharo or
> conversely you can no longer use this method. At the moment this is not the
> case.
>

But I don't understand why we do not use the pulse plugin with pharo.
( vm-sound-OSS is working too, and the source is already in the source tree)



>
> While there, disable pulse-audio allows you to use Pharo with no change in
> its basic version. What seems to me to be less complicated in case of bugs
> on the sound system.
>

"Hey, if you want to use pharo sound on linux, you have to change your
sound config
and kill the sound server"

No, this isn't better :)



>
> When writing the article for Linux Magazine (a French magazine) I asked
> myself this question. Should I write to use the Squeak's plugin or simply
> stop Pulse-Audio?
>
> I put myself in the place of a newcomer in Pharo who wants to use the sound
> system. Install a plugin from elsewhere to run Pharo could give the image
> of
> a not finished tool. While there, the plugin does not exist and it does not
> matter because the sound works with a clear and simple method. It works out
> of the box.
>
> After that, in a near future we should have a plugin for Pulse-Audio or
> best, Linux should have only one method to access sound, but it's another
> story :)
>
>
> Xavier.
>
>
>
> --
> View this message in context:
> http://forum.world.st/Pharo-Sound-of-Silence-tp4801562p4801768.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] Waiting object

2015-01-27 Thread Nicolai Hess
2015-01-27 19:46 GMT+01:00 Laura Risani :

> Hi all,
>
> I need an object/method like this one
>
> Waiting>> wait : seconds
> "i take the flow control during 'seconds' without halting image morphs
> stepping/handling (as Delay>>wait: does) and then return to the sender "
>

Hi Laura,

Delay>>wait:
it just halts the image UI (morphs, display update, etc), if you call it
from the active UI process.

If you want to use "wait", you need to tell "what" should wait.
You may create your own Process with #fork.  ["your code here"] fork.

For example.
Transcript open.
[
10 timesRepeat:[Transcript crShow:(DateAndTime now).
(Delay forSeconds:1) wait]
] fork.





>
> How can i implement it?
> Where can i borrow for reuse an existing one from?
>
>
> Best,
> Laura
>


Re: [Pharo-users] Implementing text navigation shortcuts

2015-01-29 Thread Nicolai Hess
2015-01-29 23:06 GMT+01:00 Laura Risani :

> Hi all,
>
> I like to implement a keyboard shortcut for, while editing any text, move
> the text pointer to the next position after $: .
>
> Seems that the base of all text editing is the class
> #TextMorphForEditView. I see there there is an instance variable for the
> text. My problem is i can not find a method that tells/sets the current
> position in the text of the text pointer.
>
> I've tried going through the list of methods of #TextMorphForEditView and
> its superclasses. Also through the one of senders of #arrowRight trying to
> find the instantiation of #KMKeyCombination needed to implement the
> existing shortcut "ctrl + right arrow" which jumps to the next position
> after an space, but i found nothing.
>
> Best,
> Laura
>

Hello Laura,

not all editing functions are actually in the TextMorph
(TextMorphForEditView ...) classes or the Text class, instead they
delegated this to an editor
class (Editor/SimpleEditor/SmalltalkEditor...).
And - yes that is bad -  not all keyboard shortcuts go through
KMKeyCombination and KMKeymap.
The SmalltalkEditor class defines its own shortcut handler.
For exampe: cmd+shift+a -> #argAdvance:
This method searches for the next $: followed by a space and place the
caret after the space.

nicolai


Re: [Pharo-users] Code completion differences at browser and workspace

2015-01-29 Thread Nicolai Hess
2015-01-29 22:06 GMT+01:00 Laura Risani :

> Hi all,
>
> I've noticed that the code completition tool shows a different list if
> brought up at a workspace or at a system browser. Particulary workspace's
> completition list is broader than browser's one.
>
> For instance if while writting a method i have already accepted other
> method names but haven't yet defined them in any class, these selectors are
> shown in worskpace's completition but don't in browser's. So while at the
> system browser i have to waste keystrokes bringing up the manually the
> other completition tool and search in that list the selector i want.
>
> So, question : how do i make the completition tool show at system browser
> the same list that it would show at a workspace?
>
> Best,
> Laura
>


There is one difference between the Workspace and the SystemBrowser.
In the SystemBrowers, the one method that you are editing belongs to one
(known) class and if you
start typing
"self"
the code completion can guess which methods of that class (or superclasses)
can be called.
In the Workspace you don't have this (class-) context.

But the code completion is smart enough to guess the actual type in some
situations, for example
in a Workspace:

|m|
m:= new Morph.
m handleKey

at this point, the code completion context knows, that "m" is a Morph and
therefore only shows the methods
from the class Morph, starting with "handleKey".
This completion menu should be the same, as if  you start with
self handleKey
in the SystemBrowser, while editing a method of the class Morph.

nicolai


Re: [Pharo-users] New versions of the Pharo Launcher for Windows and MacOS

2015-01-30 Thread Nicolai Hess
2015-01-30 14:57 GMT+01:00 Martin Bähr :

> Excerpts from Damien Cassou's message of 2015-01-20 14:58:58 +0100:
> > http://www.smalltalkhub.com/#!/~Pharo/PharoLauncher
>
> is this a good place to bug you with feature requests?
>
> i'd like to see a cache of the downloaded images so that i can create
> multiple
> copies of an image without redownloading.
>

On the right tree (Templates) is a node "Local"
this includes all downloaded images.




>
> i suppose i can do it manually by never opening the first copy, but i
> think it
> might be helpful to have a way to make sure that an image is untouched.
>
> i'd like to have a way to load some default configs or packages.
> for example i'll always need the gitfiletree package, and i want to set the
> fonts to 'large'
>
> it would be nice to be able to specify some scripts that are run every
> time a
> new image is loaded so i don't have to do it manually after opening the
> image.
>
> greetings, martin.
>
> --
> eKita   -   the online platform for your entire academic
> life
> --
> chief engineer
>  eKita.co
> pike programmer  pike.lysator.liu.secaudium.net
> societyserver.org
> secretary
> beijinglug.org
> mentor
> fossasia.org
> foresight developer  foresightlinux.org
> realss.com
> unix sysadmin
> Martin Bähr  working in china
> http://societyserver.org/mbaehr/
>
>


Re: [Pharo-users] Supply named temporaries to Compiler>>#evaluate:...

2015-02-04 Thread Nicolai Hess
2015-02-04 18:48 GMT+01:00 Sean P. DeNigris :

> I want to be able to evaluate a string like '2 + arg1' and supply anObject
> for arg1 to the compiler.
>
> I naively tried:
> | aContext |
> aContext := thisContext copy
> tempNamed: 'arg1' put: 1;
> yourself.
> Compiler evaluate: '2 + arg1' in: aContext to: nil
>
> which didn't even come close to working!
>
> Any pointers?
>

a workaround:
http://forum.world.st/How-can-I-specify-the-bindings-when-evaluating-an-expression-tp4794352p4794477.html



>
>
>
> -
> Cheers,
> Sean
> --
> View this message in context:
> http://forum.world.st/Supply-named-temporaries-to-Compiler-evaluate-tp4803689.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] Canvas Transform Goes Haywire if Scaled

2015-02-05 Thread Nicolai Hess
2015-02-05 6:29 GMT+01:00 Sean P. DeNigris :

> The following works as I expect:
>
> morph := Morph new
> topLeft: 200@400;
> openInWorld.
>
> outputRect := morph fullBounds.
> canvas := Display defaultCanvasClass extent: outputRect extent
> depth:
> Display depth.
> scale := 1.
> t := MorphicTransform offset: outputRect topLeft angle: 0 scale:
> scale.
> clipRect := outputRect translateBy: outputRect topLeft negated.
> canvas transformBy: t clippingTo: clipRect during: [ :aCanvas |
> aCanvas fullDrawMorph: morph ].
> canvas form asMorph openInWindow.
>
> "morph delete."
>
> but if I change scale even a little bit (e.g. 0.95), things quickly go
> south.
> Check out scale = 1 vs scale = 0.95 below:
> 
> Obviously they differ by more than I expected. If I change scale to 0.5,
> the
> morph disappears from view in the canvas completely.
>
> I had both translation and scale working in a spike by translating with
> FormCanvas>>#translateBy:during: and then magifying with "canvas form
> magnifyBy: 0.5", but I want to do this in my morph's drawing method, so I
> want to do both with the canvas.
>
> Where am I going wrong here?
>
>
>
The scaling factor changes the effective coordinates of the morph
Morph topLeft 200@400
scale 0.5
Morph draws itself at 100@200
Therefore your MorphicTransform translates to far away (or not far enough?)

  morph := EllipseMorph new
topLeft: 200@400;
openInWorld.

outputRect := morph fullBounds.
canvas := Display defaultCanvasClass extent: outputRect extent
depth: Display depth.
scale := 0.5.

"scale the offset of the translation too"
t := MorphicTransform offset: outputRect topLeft * scale angle: 0
scale: scale.
clipRect := outputRect translateBy: outputRect topLeft negated.
canvas transformBy: t clippingTo: clipRect during: [ :aCanvas |
aCanvas fullDrawMorph: morph ].
canvas form asMorph openInWindow.
morph delete.


What do you want to achieve?
Both
magnifyBy: and
transformBy:clippingTo:during:  (with non-pure-translation)

actually do the same, they warp-blitting a form.






>
>
>
>
>
> -
> Cheers,
> Sean
> --
> View this message in context:
> http://forum.world.st/Canvas-Transform-Goes-Haywire-if-Scaled-tp4803830.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] RadarMorph (was Re: Canvas Transform Goes Haywire if Scaled)

2015-02-05 Thread Nicolai Hess
2015-02-05 19:06 GMT+01:00 Sean P. DeNigris :

> Nicolai Hess wrote
> > What do you want to achieve?
>
> I've created an infinite desktop a la Self. To make things manageable, I'm
> currently writing a RadarView (also just like Self) to show a map of all
> the
> objects on the desktop, and the position of the current viewport. It's
> working now thanks to your help!
>

Looks great. (And it will look even better if it (and Morphic) is working
with Athens:) ).


>
> There is now only 1 major bug, and 3 little glitches:
> 1. (BUG): Every once in a while (can't figure out how to reproduce), it
> displays the Red X of Death like so:
>
> <http://forum.world.st/file/n4804025/Screenshot_2015-02-05_11.png>
>

drawRadarViewOn: aCanvas

| terrainRect transform scale clipRect viewRect offset |
terrainRect := self radarCoverageArea.
terrainRect isZero ifTrue: [ ^ self ].

"the viewRect scale must not depend on the clipRect extent"
" you want to have the scale based on the radarmorph extent. But now,
if something occludes
" the radarmorph partially, the clipRect is smaller than your
radarmorph and the scaling is wrong"
viewRect := terrainRect scaledAndCenteredIn: aCanvas clipRect.



>
> 2. When the container window is moved, the contents temporarily jump out of
> the radar screen
>

That one is tricky. If you grab the self world morph with the mouse, the
morph is
not drawn in the morphic WorldMorph anymore, instead the handmorph creates a
form and a new canvas for drawing on this form. For this canvas the offset
(or origin?)
is not the same as for the WorldMorph.




> 3. when the radar is dragged over another morph in the Self World, the
> clipping gets very weird
>




There are some artefacts too, related to issue
12330 <https://pharo.fogbugz.com/default.asp?12330> Rendering artifacts
with scaled ImageMorph
(still unresolved)



> 4. One side of the blue highlight rectangle sometimes disappears on resize
>
> #2, #3, and #4 can be seen in this screencast: https://vimeo.com/118826521
>
>
>
>
>
> -
> Cheers,
> Sean
> --
> View this message in context:
> http://forum.world.st/Canvas-Transform-Goes-Haywire-if-Scaled-tp4803830p4804025.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] Relationship between Morph and Canvas

2015-02-06 Thread Nicolai Hess
Hi Nacho,

2015-02-06 22:32 GMT+01:00 nacho <0800na...@gmail.com>:

> Hi,
> I've been digging and inspecting all the classes related to Morphic. But
> there's something that I don't happen to figure out.
> Morph has a method
> drawOn: aCanvas
> aCanvas fillRectangle: self bounds fillStyle: self fillStyle
> borderStyle: self borderStyle
>
>
> Which if it's not overridden by a subclass of Morph makes it possible to
> still instantiate a Morph -the classic blue rectangle.
>
> Now aCanvas is obviously an instance of FormCanvas or some other subclasses
> of Canvas.
> But the question is, where does Morph create such instance of FormCanvas?
>

The Morph does not care where this Canvas come from *

The WorldMorph (a PasteUpMorph) has a "WorldState" instance variable and
this
world state controlls the update cycle. During this update it
creates THE canvas from the DisplayScreen (this is now a FormCanvas for the
DisplayScreen(Form)).
Now it calls drawOn:canvas for all Morph(and submorphs) of the WorldMorph.
(With some more or less complex computations for clipping resp. updating
only the changed areas).


> How does this work? I'm getting all wrong?
>
look at:
WorldMorph>>#displayWorld
WorldState>>#displayWorld:submorphs:


> I read the documentation available but I can't grasp it from what I have
> read.
>


* you can create your own Form and Canvas instance and call drawOn: for a
Morph with that canvas:

|f canvas |
f:=Form extent:300@300 depth:32.
canvas := f getCanvas.
EllipseMorph new extent:300@300;drawOn:canvas.
f display



> Thanks in advance for your help
> best
> Nacho
>
>
>
>
> -
> Nacho
> Smalltalker apprentice.
> Buenos Aires, Argentina.
> --
> View this message in context:
> http://forum.world.st/Relationship-between-Morph-and-Canvas-tp4804251.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


  1   2   3   4   5   >