Re: [Pharo-dev] printString of fileReference sucks!

2018-02-02 Thread Stephane Ducasse
Tx I will reread the threads!

On Sat, Feb 3, 2018 at 4:07 AM, Sean P. DeNigris  wrote:
> Stephane Ducasse-3 wrote
>> What do you think?
>
> If it helps, here is some background material…
>
> - The original issue where we (I) created this behavior, along with the
> rationale:
> https://pharo.fogbugz.com/f/cases/7366/FileReferences-have-a-confusing-wrong-external-representation
> - A subsequent ML thread where we discussed this fairly extensively:
> http://forum.world.st/Why-aFileReference-asString-aFileReference-fullName-is-false-tp4810690.html
>
> FTR I am not attached to the current solution and defer to the majority…
>
>
>
> -
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
>



Re: [Pharo-dev] printString of fileReference sucks!

2018-02-02 Thread Sean P. DeNigris
Stephane Ducasse-3 wrote
> What do you think?

If it helps, here is some background material…

- The original issue where we (I) created this behavior, along with the
rationale:
https://pharo.fogbugz.com/f/cases/7366/FileReferences-have-a-confusing-wrong-external-representation
- A subsequent ML thread where we discussed this fairly extensively:
http://forum.world.st/Why-aFileReference-asString-aFileReference-fullName-is-false-tp4810690.html

FTR I am not attached to the current solution and defer to the majority…



-
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html



Re: [Pharo-dev] MCGitlabRepository Missing

2018-02-02 Thread Sean P. DeNigris
Pavel Krivanek-3 wrote
> The PR was against a wrong branch. The fixed one is being validated.

The class has appeared in the latest built image! The only thing left for
this to work is to update Iceberg (dev-0.6 branch) where the other half of
the patch lives :)



-
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html



Re: [Pharo-dev] Disabling a MenuGroupModel

2018-02-02 Thread Hernán Morales Durand
https://pharo.fogbugz.com/f/cases/21233/Disabling-a-MenuGroupModel-bug


2018-02-02 10:10 GMT-03:00 Hernán Morales Durand :
> Hi guys,
>
> If you develop an application window with multiple grouped menu items,
> you will certainly be able to enable/disable menu groups at once.
> Currently it is not possible with MenuGroupModel (Morphic).
>
> - A menu (item or group) model manages its state using enabledHolder
> instance variable (the enabledHolder is configured in its superclass'
> initialize)
> -- Being a value holder, one might think there is a propagation of
> state (enabled/disabled) changes to subwidgets, but it does not happen
> currently.
> --- Longer explanation: On static menu building, MenuGroupModel does
> not propagate #enable: state changes to its widget because "widget"
> i.v. is nil. The reason is a MenuGroupModel #enabled: is evaluated
> BEFORE its widget is built.
>
> How to reproduce:
> | mm |
> mm := MenuModel new
> addGroup: [ :group |
> group
> addItem: [ :item |
> item
> name: 'File';
> icon: #openIcon asIcon;
> subMenu: (MenuModel new
> addGroup: [ : gp |
> gp
> disable;   " <-- HERE we
> disable the group "
> addItem: [ : it |
> it
> name: 'Open';
> icon: #openIcon asIcon;
> shortcut: $o meta;
> action: [ self inform: 'Open' ] ];
> addItem: [ : it |
> it
> name: 'Save';
> icon: #smallSaveIcon asIcon;
> shortcut: $s meta;
> action: [ self inform: 'Save' ] ] ]) ] ];
> yourself.
> mm extent: 200 @ 100.
> mm openWithSpec.
> mm inspect.
>
> (it doesn't matter if #disable is sent after the #addItem: block evaluation)
>
> - Even after all MenuGroupModel widgets were built, if you try to
> disable a menu group dinamically:
>
> mm menuGroups anyOne menuItems anyOne subMenu menuGroups anyOne disable.
>
> you would get "Instance of OrderedCollection did not understand
> #enabled:" (the widget of a MenuGroupModel is an OrderedCollection!!).
>
> - However disabling/enabling MenuItemModel works:
>
> mm menuGroups anyOne menuItems anyOne subMenu menuGroups anyOne
> menuItems first disable.
>
> - MenuItemModel gets actually disabled in the
> ToggleMenuItemMorph/UpdatingMenuMorph (#isEnabled:) when the Canvas
> draws it.
>
> - Incredibly, all disabled groups are re-enabled from several places
> in the image.
>
> -- When the menu is clicked, a ToolDockingBarMorph triggers
> re-enablement of the MenuMorph in
> #removeMatchString/#displayFiltered:. This is presumably the code
> triggered when a menu is displayed and you type to filter the menu
> items. Something like this: "As initially there is no matchString in
> the activeSubMenu, then enable all menu items". Obviously it cleans
> disabled items.
>
> The message flow is:
>
> DockingBarMorph>>activeSubmenu: ->  MenuMorph>>removeMatchString ->
> MenuMorph>>displayFiltered: --> m isEnabled: isMatch
>
> - Another place where menu items are automatically disabled is this flow:
>
> FormCanvas>>draw: -> ToggleMenuItemMorph>>drawOn: -->
> ToggleMenuItemMorph>>isEnabled --> ToggleMenuItemMorph>>isEnabled: !!!
>  --> MorphicMenuItemAdapter>>enabled (This actually CHANGES the
> enabled state on the Model, disconnecting enabled state between the
> morph and the model adapter)
>
> This seem to have multiple paths of resolution. I'm going to propose a
> fix that I  tested in Pharo 6.1 and Pharo 7.
> I don't know yet how to fix the menu search auto-enable on key-press
> but would be glad to read a solution to distinguish between both uses.
> My idea for now is to have a Morphic property which sets
> #doNotAutoReEnableItems.
>
> However I will open an issue and let people check.
>
> You can test it with
>
> " Disable the group "
> mm menuGroups anyOne menuItems anyOne subMenu menuGroups anyOne disable.
>
> " Enable the group "
> mm menuGroups anyOne menuItems anyOne subMenu menuGroups anyOne enable.
>
> Cheers,
>
> Hernán



Re: [Pharo-dev] Weird ZnClient benchmarking result

2018-02-02 Thread Sven Van Caekenberghe
https://pharo.fogbugz.com/f/cases/21232/BenchmarkResult-printFrequencyOn-can-be-confusing

https://github.com/pharo-project/pharo/pull/794

> On 12 Dec 2017, at 07:22, Stephane Ducasse  wrote:
> 
> sven did you submit a fix to get a clearer printout?
> 
> Stef
> 
> 
> On Sun, Dec 10, 2017 at 7:14 PM, Sven Van Caekenberghe  wrote:
>> @ Henrik
>> 
>> Arg, arg, arg, yes of course.
>> I actually did think about that, but still did not look carefully enough !!
>> Really stupid of me.
>> 
>> It is even worse because I wrote that code ...
>> 
>> Now, the #printOn: of BenchmarkResult is much clearer, less confusing:
>> 
>> ZnClient new in: [ :client |
>>[ client get: 'http://localhost:8080' ] benchFor: 5 seconds ].
>> 
>> a BenchmarkResult(14,732 iterations in 5 seconds. 2,946 per second)
>> 
>> vs
>> 
>> ZnClient new in: [ :client |
>>client loggingOff.
>>[ client get: 'http://localhost:8080' ] benchFor: 5 seconds ].
>> 
>> a BenchmarkResult(42 iterations in 5 seconds 88 milliseconds. 8.255 per 
>> second)
>> 
>> Still the same issue with $, and $. in frequency, but the iteration count is 
>> crystal clear.
>> 
>> The reason #bench works like that is backwards compatibility at the time we 
>> introduced that.
>> 
>> @ Ben
>> 
>> Yes, I should have looked at the other side as well, to confirm things 
>> actually happened as I imagined them (the did not).
>> 
>> Thx and sorry for the noise.
>> 
>> Sven
>> 
>>> On 10 Dec 2017, at 18:00, Henrik-Nergaard  wrote:
>>> 
>>> Hi Sven,
>>> 
>>> What you are seeing is most likely a $, vs $. issue.
>>> See BenchmarkResult >>#printFrequenceOn: it uses both decimal and thousand
>>> separators.
>>> 
>>> If i run this code:
>>> -
>>> | counter |
>>> counter :=
>>> ZnClient new in: [ :client |
>>> client loggingOff.
>>> [ client get: 'http://localhost:8080'. counter ] bench
>>> ].
>>> counter.
>>> -
>>> 
>>> Then i get 9035 ('1,773 per second') when no inspector is open, and only 22
>>> ('5.995 per second') when inspecting the logs.
>>> 
>>> Best regards,
>>> Henrik
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
>>> 
>> 
>> 
> 




Re: [Pharo-dev] another file reference question

2018-02-02 Thread Alistair Grant
Hi Stef,

On 2 February 2018 at 20:58, Stephane Ducasse  wrote:
> Then I do not get why / is expecting a string and cannot accept a path.
>
> Then I do not get why we have paths.
> Stef

Paths are intended to be internal, and not something you ever deal
with directly.

I'm not sure I understand what you want to do, but maybe try replacing
#/ with #resolve:, e.g.:

'/home' asFileReference resolve: 'user' asFileReference
" File @ /home/user"


or:

'/home' asFileReference resolve: 'user' asFileReference path
" File @ /home/user"


Cheers,
Alistair


> On Fri, Feb 2, 2018 at 8:22 PM, Stephane Ducasse
>  wrote:
>> HI
>>
>> I have the following scenario:
>>
>> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
>> asFileReference /
>> 'book.pillar'
>>
>
>>  "File @ 
>> /Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result/book.pillar"
>>
>> ok it works.
>>
>> I want to update the contents of a target folder only if a file is
>> missing or too old compared to a source.
>>
>> The idea is that I have a target folder and I need to know if a file
>> located in the source tree should be copied under the target.
>> So I compute the difference from the root of the source to the file
>> and I want to apply this path to the target to check some file
>> properties.
>>
>> now I do not understand how I can get the following working:
>>
>>  
>> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
>> asFileReference
>> /
>>
>>  
>> ('/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/book.pillar'
>> asFileReference path)
>>  relativeTo: 
>> ('/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo'
>> asFileReference path)
>>
>>
>> Stef
>



Re: [Pharo-dev] another file reference question

2018-02-02 Thread Denis Kudriashov
Hi

Can you provide more simple example with shorter paths? I am lost in these
long strings :).

2018-02-02 20:22 GMT+01:00 Stephane Ducasse :

> HI
>
> I have the following scenario:
>
> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-
> Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
> asFileReference /
> 'book.pillar'
>
> >>>
>  "File @ /Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-
> Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result/book.pillar"
>
> ok it works.
>
> I want to update the contents of a target folder only if a file is
> missing or too old compared to a source.
>
> The idea is that I have a target folder and I need to know if a file
> located in the source tree should be copied under the target.
> So I compute the difference from the root of the source to the file
> and I want to apply this path to the target to check some file
> properties.
>
> now I do not understand how I can get the following working:
>
>  '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-
> Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
> asFileReference
> /
>
>  ('/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-
> Writing/PharoBooks/Booklet-AMiniSchemeInPharo/book.pillar'
> asFileReference path)
>  relativeTo: ('/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-
> Writing/PharoBooks/Booklet-AMiniSchemeInPharo'
> asFileReference path)
>
>
> Stef
>
>


Re: [Pharo-dev] printString of fileReference sucks!

2018-02-02 Thread Denis Kudriashov
2018-02-02 20:39 GMT+01:00 Esteban A. Maringolo :


> If for some reason the option chosen is to keep the current
> printString then the printString should be:
> >>> 'File @ ''/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-
> Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'''
>

So I am for this approach


Re: [Pharo-dev] printString of fileReference sucks!

2018-02-02 Thread Denis Kudriashov
Hi.

I do not think that getting simple string as result is a good idea.
It is important to easily distinguish class of object using printIt
operation and as a field in raw inspector.

During code migration to FileSystem it is classic way to check variables in
debugger to see if they are already file references or they are still
strings. printIt is very handy in such cases.

Best regards,
Denis

2018-02-02 20:39 GMT+01:00 Esteban A. Maringolo :

> Hi Stef, all,
>
> I've seen this "inconsistency" as well. The current printSting tries
> to be descriptive but isn't handy to work with.
>
> I would go one step further and have no #asFileReference suffix nor
> File @ prefix, it is:
>
> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-
> Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
> asFileReference printString
> >>> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-
> Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
>
>
> If for some reason the option chosen is to keep the current
> printString then the printString should be:
> >>> 'File @ ''/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-
> Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'''
>
> It is, a string with three tokens, the class name, the @ symbol and a
> string as an argument, that way you can evaluate the result back.
>
> I prefer the first one, it enables you to work with files on
> workspaces, if you're using inspectors the printString doesn't matter
> much, since you're dealing with a specialized tool and there is no way
> you can confuse a FileReference with a regular String instance
>
> Best regards,
> Esteban A. Maringolo
>
>
> 2018-02-02 16:12 GMT-03:00 Stephane Ducasse :
> > Hi
> >
> > '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-
> Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
> > asFileReference printString
>   "File @ /Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-
> Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result"
> >
> > so either we add @ one File or we redefine printString one reference to
> be
> >
> > '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-
> Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
> > asFileReference so that we can do something with the printString
> > result.
> >
> > What do you think?
> > Guille is it what we talked together?
> >
> > Setf
> >
>
>


Re: [Pharo-dev] Change Pharo window icon

2018-02-02 Thread Stephane Ducasse
Yes I did that when I was at University. So clearly dated.


On Fri, Feb 2, 2018 at 8:40 PM, p...@highoctane.be  wrote:
> For Windows one can change it using a resource editor.
>
> http://www.angusj.com/resourcehacker/
>
> Phil
>
> On Feb 2, 2018 20:33, "Stephane Ducasse"  wrote:
>>
>> Would it be possible to change the icon without having to compile a new
>> VM?
>> To me the current setup looks so monolithic and dated.
>> I would expect that somebody can deploy a application with its own
>> logo by just providing some new resources.
>>
>> Stef
>>
>> On Wed, Jan 31, 2018 at 11:17 PM, Eliot Miranda 
>> wrote:
>> > Hi Vincent,
>> >
>> > On Wed, Jan 31, 2018 at 12:07 PM, 
>> > wrote:
>> >>
>> >> Hi,
>> >>
>> >> I would like to know how to change the main Pharo window icon. I saw
>> >> that
>> >> there is a primitive for the title:
>> >> DisplayScreen class  >> primitiveWindowTitle:string: ; primitive:
>> >> 'primitiveHostWindowTitle' module:'HostWindowPlugin'
>> >> but I cannot find one for the icon.
>> >> Should another primitive need to be implemented?
>> >
>> >
>> > The icon is baked into the VM executable.  So to change it one has to
>> > build
>> > a VM with a different icon.
>> >
>> > On Windows it is in
>> > {build.win32x86,build.win64x64}/pharo.cog.spur/Pharo.ico
>> > and the file that specifies to use Pharo.ico is
>> > {build.win32x86,build.win64x64}/pharo.cog.spur/Pharo.rc
>> >
>> > On Mac OS X it is in
>> > platforms/iOS/vm/OSX/Pharo.icns
>> > (alongside three others such as PharoImage.icns)
>> > and the file that specifies to use Pharo.icns is
>> > {build.macos32x86,build.macos64x64}/pharo.cog.spur/Makefile
>> > in setting the VM variable.  The file that associates the other icons
>> > with
>> > specific file types is
>> > platforms/iOS//vm/OSX/Pharo-Info.plist
>> >
>> > If you're changing the Pharo icon let me suggest you update the icon
>> > files
>> > themselves in the opensmalltalk-vm source tree.
>> >
>> > If you're creating a new variant of the VM for some new purpose (say a
>> > special Lam VM) then let me suggest you add the icons to the
>> > opensmalltalk-vm source tree, creating special build directories for
>> > these
>> > VMs, such as {build.macos32x86,build.macos64x64}/lam.pharo.cog.spur/
>> >
>> > If you want to do this privately, then take either of the approaches
>> > above
>> > and simply don't publish the edits.  You can write a script that takes
>> > an
>> > updated checked-out opensmalltalk-vm source tree and edits it with files
>> > from a specific repository.  I have such scripts and can help you with
>> > them.
>> > Hint, pax is a very convenient directory hierarchy copying tool
>> > available at
>> > least on Mac OS X.  pax -rwlk will copy the trees under a sequence of
>> > directories into their corresponding places in a target tree.
>> >
>> >>
>> >> Thanks!
>> >>
>> >> Vincent
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > _,,,^..^,,,_
>> > best, Eliot
>>
>



[Pharo-dev] FileSystem copyToFolder: is missing :(

2018-02-02 Thread Stephane Ducasse
Hi

copyTo: forces the user to manipulate full path while we could also have
aFileReference copyToFolder: aFileReference
Now I have to create the target.

Stef



Re: [Pharo-dev] printString of fileReference sucks!

2018-02-02 Thread Stephane Ducasse
I saw that guillermo already needed it for pillar

Path >> pillarPrintString
  self isEmpty ifTrue: [ ^ '' ].
^ String streamContents: [ :str |
str nextPutAll: (self at: 1) asString.
2 to: self size do: [:i |
   str
 nextPutAll: self delimiter;
nextPutAll: (self at: i) ] ]


so there is clearly something wrong.



On Fri, Feb 2, 2018 at 8:57 PM, Stephane Ducasse
 wrote:
> Exactly, let us see what others think and we fix it.
>
> To me FileSystem deserves some love.
>
>
> On Fri, Feb 2, 2018 at 8:39 PM, Esteban A. Maringolo
>  wrote:
>> Hi Stef, all,
>>
>> I've seen this "inconsistency" as well. The current printSting tries
>> to be descriptive but isn't handy to work with.
>>
>> I would go one step further and have no #asFileReference suffix nor
>> File @ prefix, it is:
>>
>> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
>> asFileReference printString
> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
>>
>>
>> If for some reason the option chosen is to keep the current
>> printString then the printString should be:
> 'File @ 
> ''/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'''
>>
>> It is, a string with three tokens, the class name, the @ symbol and a
>> string as an argument, that way you can evaluate the result back.
>>
>> I prefer the first one, it enables you to work with files on
>> workspaces, if you're using inspectors the printString doesn't matter
>> much, since you're dealing with a specialized tool and there is no way
>> you can confuse a FileReference with a regular String instance
>>
>> Best regards,
>> Esteban A. Maringolo
>>
>>
>> 2018-02-02 16:12 GMT-03:00 Stephane Ducasse :
>>> Hi
>>>
>>> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
>>> asFileReference printString
>>  "File @ 
>> /Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result"
>>>
>>> so either we add @ one File or we redefine printString one reference to be
>>>
>>> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
>>> asFileReference so that we can do something with the printString
>>> result.
>>>
>>> What do you think?
>>> Guille is it what we talked together?
>>>
>>> Setf
>>>
>>



Re: [Pharo-dev] another file reference question

2018-02-02 Thread Stephane Ducasse
Then I do not get why / is expecting a string and cannot accept a path.

Then I do not get why we have paths.
Stef


On Fri, Feb 2, 2018 at 8:22 PM, Stephane Ducasse
 wrote:
> HI
>
> I have the following scenario:
>
> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
> asFileReference /
> 'book.pillar'
>

>  "File @ 
> /Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result/book.pillar"
>
> ok it works.
>
> I want to update the contents of a target folder only if a file is
> missing or too old compared to a source.
>
> The idea is that I have a target folder and I need to know if a file
> located in the source tree should be copied under the target.
> So I compute the difference from the root of the source to the file
> and I want to apply this path to the target to check some file
> properties.
>
> now I do not understand how I can get the following working:
>
>  
> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
> asFileReference
> /
>
>  
> ('/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/book.pillar'
> asFileReference path)
>  relativeTo: 
> ('/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo'
> asFileReference path)
>
>
> Stef



Re: [Pharo-dev] printString of fileReference sucks!

2018-02-02 Thread Stephane Ducasse
Exactly, let us see what others think and we fix it.

To me FileSystem deserves some love.


On Fri, Feb 2, 2018 at 8:39 PM, Esteban A. Maringolo
 wrote:
> Hi Stef, all,
>
> I've seen this "inconsistency" as well. The current printSting tries
> to be descriptive but isn't handy to work with.
>
> I would go one step further and have no #asFileReference suffix nor
> File @ prefix, it is:
>
> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
> asFileReference printString
 '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
>
>
> If for some reason the option chosen is to keep the current
> printString then the printString should be:
 'File @ 
 ''/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'''
>
> It is, a string with three tokens, the class name, the @ symbol and a
> string as an argument, that way you can evaluate the result back.
>
> I prefer the first one, it enables you to work with files on
> workspaces, if you're using inspectors the printString doesn't matter
> much, since you're dealing with a specialized tool and there is no way
> you can confuse a FileReference with a regular String instance
>
> Best regards,
> Esteban A. Maringolo
>
>
> 2018-02-02 16:12 GMT-03:00 Stephane Ducasse :
>> Hi
>>
>> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
>> asFileReference printString
>  "File @ 
> /Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result"
>>
>> so either we add @ one File or we redefine printString one reference to be
>>
>> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
>> asFileReference so that we can do something with the printString
>> result.
>>
>> What do you think?
>> Guille is it what we talked together?
>>
>> Setf
>>
>



Re: [Pharo-dev] Change Pharo window icon

2018-02-02 Thread p...@highoctane.be
For Windows one can change it using a resource editor.

http://www.angusj.com/resourcehacker/

Phil

On Feb 2, 2018 20:33, "Stephane Ducasse"  wrote:

> Would it be possible to change the icon without having to compile a new VM?
> To me the current setup looks so monolithic and dated.
> I would expect that somebody can deploy a application with its own
> logo by just providing some new resources.
>
> Stef
>
> On Wed, Jan 31, 2018 at 11:17 PM, Eliot Miranda 
> wrote:
> > Hi Vincent,
> >
> > On Wed, Jan 31, 2018 at 12:07 PM, 
> wrote:
> >>
> >> Hi,
> >>
> >> I would like to know how to change the main Pharo window icon. I saw
> that
> >> there is a primitive for the title:
> >> DisplayScreen class  >> primitiveWindowTitle:string: ; primitive:
> >> 'primitiveHostWindowTitle' module:'HostWindowPlugin'
> >> but I cannot find one for the icon.
> >> Should another primitive need to be implemented?
> >
> >
> > The icon is baked into the VM executable.  So to change it one has to
> build
> > a VM with a different icon.
> >
> > On Windows it is in
> > {build.win32x86,build.win64x64}/pharo.cog.spur/Pharo.ico
> > and the file that specifies to use Pharo.ico is
> > {build.win32x86,build.win64x64}/pharo.cog.spur/Pharo.rc
> >
> > On Mac OS X it is in
> > platforms/iOS/vm/OSX/Pharo.icns
> > (alongside three others such as PharoImage.icns)
> > and the file that specifies to use Pharo.icns is
> > {build.macos32x86,build.macos64x64}/pharo.cog.spur/Makefile
> > in setting the VM variable.  The file that associates the other icons
> with
> > specific file types is
> > platforms/iOS//vm/OSX/Pharo-Info.plist
> >
> > If you're changing the Pharo icon let me suggest you update the icon
> files
> > themselves in the opensmalltalk-vm source tree.
> >
> > If you're creating a new variant of the VM for some new purpose (say a
> > special Lam VM) then let me suggest you add the icons to the
> > opensmalltalk-vm source tree, creating special build directories for
> these
> > VMs, such as {build.macos32x86,build.macos64x64}/lam.pharo.cog.spur/
> >
> > If you want to do this privately, then take either of the approaches
> above
> > and simply don't publish the edits.  You can write a script that takes an
> > updated checked-out opensmalltalk-vm source tree and edits it with files
> > from a specific repository.  I have such scripts and can help you with
> them.
> > Hint, pax is a very convenient directory hierarchy copying tool
> available at
> > least on Mac OS X.  pax -rwlk will copy the trees under a sequence of
> > directories into their corresponding places in a target tree.
> >
> >>
> >> Thanks!
> >>
> >> Vincent
> >>
> >>
> >
> >
> >
> > --
> > _,,,^..^,,,_
> > best, Eliot
>
>


Re: [Pharo-dev] printString of fileReference sucks!

2018-02-02 Thread Esteban A. Maringolo
Hi Stef, all,

I've seen this "inconsistency" as well. The current printSting tries
to be descriptive but isn't handy to work with.

I would go one step further and have no #asFileReference suffix nor
File @ prefix, it is:

'/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
asFileReference printString
>>> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'


If for some reason the option chosen is to keep the current
printString then the printString should be:
>>> 'File @ 
>>> ''/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'''

It is, a string with three tokens, the class name, the @ symbol and a
string as an argument, that way you can evaluate the result back.

I prefer the first one, it enables you to work with files on
workspaces, if you're using inspectors the printString doesn't matter
much, since you're dealing with a specialized tool and there is no way
you can confuse a FileReference with a regular String instance

Best regards,
Esteban A. Maringolo


2018-02-02 16:12 GMT-03:00 Stephane Ducasse :
> Hi
>
> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
> asFileReference printString
  "File @ 
 /Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result"
>
> so either we add @ one File or we redefine printString one reference to be
>
> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
> asFileReference so that we can do something with the printString
> result.
>
> What do you think?
> Guille is it what we talked together?
>
> Setf
>



Re: [Pharo-dev] Change Pharo window icon

2018-02-02 Thread Stephane Ducasse
Would it be possible to change the icon without having to compile a new VM?
To me the current setup looks so monolithic and dated.
I would expect that somebody can deploy a application with its own
logo by just providing some new resources.

Stef

On Wed, Jan 31, 2018 at 11:17 PM, Eliot Miranda  wrote:
> Hi Vincent,
>
> On Wed, Jan 31, 2018 at 12:07 PM,  wrote:
>>
>> Hi,
>>
>> I would like to know how to change the main Pharo window icon. I saw that
>> there is a primitive for the title:
>> DisplayScreen class  >> primitiveWindowTitle:string: ; primitive:
>> 'primitiveHostWindowTitle' module:'HostWindowPlugin'
>> but I cannot find one for the icon.
>> Should another primitive need to be implemented?
>
>
> The icon is baked into the VM executable.  So to change it one has to build
> a VM with a different icon.
>
> On Windows it is in
> {build.win32x86,build.win64x64}/pharo.cog.spur/Pharo.ico
> and the file that specifies to use Pharo.ico is
> {build.win32x86,build.win64x64}/pharo.cog.spur/Pharo.rc
>
> On Mac OS X it is in
> platforms/iOS/vm/OSX/Pharo.icns
> (alongside three others such as PharoImage.icns)
> and the file that specifies to use Pharo.icns is
> {build.macos32x86,build.macos64x64}/pharo.cog.spur/Makefile
> in setting the VM variable.  The file that associates the other icons with
> specific file types is
> platforms/iOS//vm/OSX/Pharo-Info.plist
>
> If you're changing the Pharo icon let me suggest you update the icon files
> themselves in the opensmalltalk-vm source tree.
>
> If you're creating a new variant of the VM for some new purpose (say a
> special Lam VM) then let me suggest you add the icons to the
> opensmalltalk-vm source tree, creating special build directories for these
> VMs, such as {build.macos32x86,build.macos64x64}/lam.pharo.cog.spur/
>
> If you want to do this privately, then take either of the approaches above
> and simply don't publish the edits.  You can write a script that takes an
> updated checked-out opensmalltalk-vm source tree and edits it with files
> from a specific repository.  I have such scripts and can help you with them.
> Hint, pax is a very convenient directory hierarchy copying tool available at
> least on Mac OS X.  pax -rwlk will copy the trees under a sequence of
> directories into their corresponding places in a target tree.
>
>>
>> Thanks!
>>
>> Vincent
>>
>>
>
>
>
> --
> _,,,^..^,,,_
> best, Eliot



[Pharo-dev] another file reference question

2018-02-02 Thread Stephane Ducasse
HI

I have the following scenario:

'/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
asFileReference /
'book.pillar'

>>>
 "File @ 
/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result/book.pillar"

ok it works.

I want to update the contents of a target folder only if a file is
missing or too old compared to a source.

The idea is that I have a target folder and I need to know if a file
located in the source tree should be copied under the target.
So I compute the difference from the root of the source to the file
and I want to apply this path to the target to check some file
properties.

now I do not understand how I can get the following working:

 
'/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
asFileReference
/

 
('/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/book.pillar'
asFileReference path)
 relativeTo: 
('/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo'
asFileReference path)


Stef



[Pharo-dev] printString of fileReference sucks!

2018-02-02 Thread Stephane Ducasse
Hi

'/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
asFileReference printString
>>>  "File @ 
>>> /Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result"

so either we add @ one File or we redefine printString one reference to be

'/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/_result'
asFileReference so that we can do something with the printString
result.

What do you think?
Guille is it what we talked together?

Setf



Re: [Pharo-dev] about diff paths

2018-02-02 Thread Stephane Ducasse
'/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/Chapters/Scheme.pillar'
asFileReference path
relativeToPath:
'/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/Chapters/'
asFileReference path

In fact / should split or raise an exception.

Stef


On Fri, Feb 2, 2018 at 12:51 PM, Stephane Ducasse
 wrote:
> Hi
>
> I want to know the path from a given point in a path
> for example
>
> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/Chapters/Scheme.pillar'
> asFileReference path
> relativeToPath: (Path /
> '/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/')
>
> should give me 'Chapters/Scheme.pillar'
>
> as in the example in the method
>
> (Path / 'griffle' / 'plonk' / 'nurp')
>relativeToPath: (Path / 'griffle')
>   returns  plonk/nurp
>
> But I got
>
>  Path * '..' / 'Users' / 'ducasse' / 'Workspace' / 'FirstCircle' /
> 'MyBooks' / 'Bk-Writing' / 'PharoBooks' / 'Booklet-AMiniSchemeInPharo'
> / 'Chapters' / 'Scheme.pillar'
>
> and I do not understand. I can do it doing string manipulation but it defeats
> the purpose to have a nice library.
>
> Any hints?
>
> Stef



Re: [Pharo-dev] [ANN] Updating Consultants Listing

2018-02-02 Thread Marcus Denker


> On 17 Jan 2018, at 17:27, Marcus Denker  wrote:
> 
> Hi,
> 
> We have http://consultants.pharo.org  
> 
> I want to change it to
>   - not be a forward to files.pharo.org 
DONE:

http://consultants.pharo.org 


TBD:
>   - be auto-generated from the https://association.pharo.org 
> 
>  


Marcus

[Pharo-dev] Disabling a MenuGroupModel

2018-02-02 Thread Hernán Morales Durand
Hi guys,

If you develop an application window with multiple grouped menu items,
you will certainly be able to enable/disable menu groups at once.
Currently it is not possible with MenuGroupModel (Morphic).

- A menu (item or group) model manages its state using enabledHolder
instance variable (the enabledHolder is configured in its superclass'
initialize)
-- Being a value holder, one might think there is a propagation of
state (enabled/disabled) changes to subwidgets, but it does not happen
currently.
--- Longer explanation: On static menu building, MenuGroupModel does
not propagate #enable: state changes to its widget because "widget"
i.v. is nil. The reason is a MenuGroupModel #enabled: is evaluated
BEFORE its widget is built.

How to reproduce:
| mm |
mm := MenuModel new
addGroup: [ :group |
group
addItem: [ :item |
item
name: 'File';
icon: #openIcon asIcon;
subMenu: (MenuModel new
addGroup: [ : gp |
gp
disable;   " <-- HERE we
disable the group "
addItem: [ : it |
it
name: 'Open';
icon: #openIcon asIcon;
shortcut: $o meta;
action: [ self inform: 'Open' ] ];
addItem: [ : it |
it
name: 'Save';
icon: #smallSaveIcon asIcon;
shortcut: $s meta;
action: [ self inform: 'Save' ] ] ]) ] ];
yourself.
mm extent: 200 @ 100.
mm openWithSpec.
mm inspect.

(it doesn't matter if #disable is sent after the #addItem: block evaluation)

- Even after all MenuGroupModel widgets were built, if you try to
disable a menu group dinamically:

mm menuGroups anyOne menuItems anyOne subMenu menuGroups anyOne disable.

you would get "Instance of OrderedCollection did not understand
#enabled:" (the widget of a MenuGroupModel is an OrderedCollection!!).

- However disabling/enabling MenuItemModel works:

mm menuGroups anyOne menuItems anyOne subMenu menuGroups anyOne
menuItems first disable.

- MenuItemModel gets actually disabled in the
ToggleMenuItemMorph/UpdatingMenuMorph (#isEnabled:) when the Canvas
draws it.

- Incredibly, all disabled groups are re-enabled from several places
in the image.

-- When the menu is clicked, a ToolDockingBarMorph triggers
re-enablement of the MenuMorph in
#removeMatchString/#displayFiltered:. This is presumably the code
triggered when a menu is displayed and you type to filter the menu
items. Something like this: "As initially there is no matchString in
the activeSubMenu, then enable all menu items". Obviously it cleans
disabled items.

The message flow is:

DockingBarMorph>>activeSubmenu: ->  MenuMorph>>removeMatchString ->
MenuMorph>>displayFiltered: --> m isEnabled: isMatch

- Another place where menu items are automatically disabled is this flow:

FormCanvas>>draw: -> ToggleMenuItemMorph>>drawOn: -->
ToggleMenuItemMorph>>isEnabled --> ToggleMenuItemMorph>>isEnabled: !!!
 --> MorphicMenuItemAdapter>>enabled (This actually CHANGES the
enabled state on the Model, disconnecting enabled state between the
morph and the model adapter)

This seem to have multiple paths of resolution. I'm going to propose a
fix that I  tested in Pharo 6.1 and Pharo 7.
I don't know yet how to fix the menu search auto-enable on key-press
but would be glad to read a solution to distinguish between both uses.
My idea for now is to have a Morphic property which sets
#doNotAutoReEnableItems.

However I will open an issue and let people check.

You can test it with

" Disable the group "
mm menuGroups anyOne menuItems anyOne subMenu menuGroups anyOne disable.

" Enable the group "
mm menuGroups anyOne menuItems anyOne subMenu menuGroups anyOne enable.

Cheers,

Hernán



[Pharo-dev] [Pharo 7.0-dev] Build #493: 21230-revert-tearDown-order-in-OmSessionStoreTesttearDown

2018-02-02 Thread ci-pharo-ci-jenkins2
There is a new Pharo build available!

The status of the build #493 was: SUCCESS.

The Pull Request #791 was integrated: 
"21230-revert-tearDown-order-in-OmSessionStoreTesttearDown"
Pull request url: https://github.com/pharo-project/pharo/pull/791

Issue Url: https://pharo.fogbugz.com/f/cases/21230
Build Url: 
https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%20and%20branch%20Pipeline/job/development/493/


[Pharo-dev] about diff paths

2018-02-02 Thread Stephane Ducasse
Hi

I want to know the path from a given point in a path
for example

'/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/Chapters/Scheme.pillar'
asFileReference path
relativeToPath: (Path /
'/Users/ducasse/Workspace/FirstCircle/MyBooks/Bk-Writing/PharoBooks/Booklet-AMiniSchemeInPharo/')

should give me 'Chapters/Scheme.pillar'

as in the example in the method

(Path / 'griffle' / 'plonk' / 'nurp')
   relativeToPath: (Path / 'griffle')
  returns  plonk/nurp

But I got

 Path * '..' / 'Users' / 'ducasse' / 'Workspace' / 'FirstCircle' /
'MyBooks' / 'Bk-Writing' / 'PharoBooks' / 'Booklet-AMiniSchemeInPharo'
/ 'Chapters' / 'Scheme.pillar'

and I do not understand. I can do it doing string manipulation but it defeats
the purpose to have a nice library.

Any hints?

Stef



[Pharo-dev] [Pharo 7.0-dev] Build #492: 20953-Gitlab-Private-Project-Support-via-Iceberg

2018-02-02 Thread ci-pharo-ci-jenkins2
There is a new Pharo build available!

The status of the build #492 was: FAILURE.

The Pull Request #790 was integrated: 
"20953-Gitlab-Private-Project-Support-via-Iceberg"
Pull request url: https://github.com/pharo-project/pharo/pull/790

Issue Url: https://pharo.fogbugz.com/f/cases/20953
Build Url: 
https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%20and%20branch%20Pipeline/job/development/492/


[Pharo-dev] [Pharo 7.0-dev] Build #491: 21229-Enhance-file-attribute-tests

2018-02-02 Thread ci-pharo-ci-jenkins2
There is a new Pharo build available!

The status of the build #491 was: SUCCESS.

The Pull Request #789 was integrated: "21229-Enhance-file-attribute-tests"
Pull request url: https://github.com/pharo-project/pharo/pull/789

Issue Url: https://pharo.fogbugz.com/f/cases/21229
Build Url: 
https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%20and%20branch%20Pipeline/job/development/491/


[Pharo-dev] [Pharo 7.0-dev] Build #490: 21161-Epicea-do-not-create-directory-on-startUp-if-EpMonitor-is-not-logging

2018-02-02 Thread ci-pharo-ci-jenkins2
There is a new Pharo build available!

The status of the build #490 was: SUCCESS.

The Pull Request #751 was integrated: 
"21161-Epicea-do-not-create-directory-on-startUp-if-EpMonitor-is-not-logging"
Pull request url: https://github.com/pharo-project/pharo/pull/751

Issue Url: https://pharo.fogbugz.com/f/cases/21161
Build Url: 
https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%20and%20branch%20Pipeline/job/development/490/


Re: [Pharo-dev] MCGitlabRepository Missing

2018-02-02 Thread Pavel Krivanek
The PR was against a wrong branch. The fixed one is being validated.

-- Pavel



2018-02-02 8:17 GMT+01:00 Marcus Denker :
> Hi,
>
> The PR was this:
>
> https://github.com/pharo-project/pharo/pull/700/files
>
> It might be that the baseline is not used somehow?
>
>
>> On 2 Feb 2018, at 04:36, Sean P. DeNigris  wrote:
>>
>> Realized this should've been on dev list, not users. Sorry for the cross
>> post…
>>
>> An image with build 454 seems still not to have MCGitlabRepository present.
>> What am I missing?
>> Same for build 462 with sha 3641442f3ba0613cd9a6428181487ea29e62418c, which
>> has the package in its source:
>> https://github.com/pharo-project/pharo/tree/3641442f3ba0613cd9a6428181487ea29e62418c/src/Metacello-Gitlab
>>
>> Ditto for build 487.sha.58ee23aadcd15e0a969ed675e8141c0cfd95594a
>>
>>
>>
>> -
>> Cheers,
>> Sean
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
>>
>
>



[Pharo-dev] [Pharo 7.0-dev] Build #489: 21094 Super tearDown need to be called as last message in tearDown of Metacello

2018-02-02 Thread ci-pharo-ci-jenkins2
There is a new Pharo build available!

The status of the build #489 was: SUCCESS.

The Pull Request #767 was integrated: "21094 Super tearDown need to be called 
as last message in tearDown of Metacello"
Pull request url: https://github.com/pharo-project/pharo/pull/767

Issue Url: https://pharo.fogbugz.com/f/cases/21094
Build Url: 
https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%20and%20branch%20Pipeline/job/development/489/