Pharo-users
By thread
pharo-users@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
November 2016
- 84 participants
- 556 messages
Re: [Pharo-users] Pharo desktop UI
by stepharo
Le 2/11/16 à 22:43, vikenti a écrit :
> Hello, i'm newbie in Pharo, converted from Visual Works which is quite
> different from Pharo Smalltalk.
> I started to port my application (i've been working on for about three
> years) from VW (because of new personal user licensing limitations of Visual
> Works), but i have to solve some problems and need your advice.
>
> These ase some of the most important problems:
> 1. I need to rewrite the whole GUI from scratch. What UI framework to
> choose and where to get documentation? Please, don't send me to research
> code examples instead of docs - i do this during whole last week. The
> example should be complete and simple: one task - one example, all examples
> i've seen are either not applicable to real life or too complicated to
> understand.
> - I need simple window with menu (how to attach menu items to menu
> handlers???? - no answer in examples)
> - Toolbar with icons (how????????)
> - components (as i understand - Morphic subclasses, it is the simplest
> part)
> - when window opens i need handler to do some setup actions. Handler should
> fire after UI is built and my app's window is opened (how?????)
> - i need another handler, which fires when you try to close Pharo or
> application's window. Handler must check whether to close window or not and
> do allow or not to close my application.
> - how to programmatically close window??????
>
> 2. The next task is to do some work on image load (i mean pharo image). I
> need some handler which fires immediately after image is loaded. How to
> include my handler in this chain???? My app saves data into the image so i
> need to manage this and auto-load _my_ application after startup.
look for startup or startUp or startUpList
> 3. How to drag-n-drop from the host operation system into pharo application
> and vice versa? I need to drag-n-drop a list of files from\to file browser.
I do not remember but there is a way to do that.
For example when you drop a .cs file it gets loaded.
> 4. Application deployment. How to strip the unnecessary code from the image?
> I've heard there is "small image" to add all-i-need-to-run. Where i can
> download it and how to use it????
- Do you need to strip your image?
- for the small image we are producing one but I'm not sure that you
want to lose your time with it right now.
Stef
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://forum.world.st/Pharo-desktop-UI-tp4921212.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>
Nov. 3, 2016
Re: [Pharo-users] Pharo desktop UI
by stepharo
http://books.pharo.org
and you can contribute if when reading you think something is missing.
and you can also contribute by improving Spec.
Stef
Le 2/11/16 à 23:01, Johan Fabry a écrit :
> Hello Vikenti,
>
> for writing UIs in Pharo the UI builder you should use is Spec. We have documentation online in the form of a book (which is a work in progress).I think it will answer many of your UI questions, have a look at http://files.pharo.org/books/spec-tutorial/
>
> HTH,
>
> --
> Does this mail seem too brief? Sorry for that, I donât mean to be rude! Please see http://emailcharter.org .
>
> Johan Fabry - http://pleiad.cl/~jfabry
> PLEIAD and RyCh labs - Computer Science Department (DCC) - University of Chile
>
>> On 02 Nov 2016, at 18:43, vikenti <vikenti.potapov(a)gmail.com> wrote:
>>
>> Hello, i'm newbie in Pharo, converted from Visual Works which is quite
>> different from Pharo Smalltalk.
>> I started to port my application (i've been working on for about three
>> years) from VW (because of new personal user licensing limitations of Visual
>> Works), but i have to solve some problems and need your advice.
>>
>> These ase some of the most important problems:
>> 1. I need to rewrite the whole GUI from scratch. What UI framework to
>> choose and where to get documentation? Please, don't send me to research
>> code examples instead of docs - i do this during whole last week. The
>> example should be complete and simple: one task - one example, all examples
>> i've seen are either not applicable to real life or too complicated to
>> understand.
>> - I need simple window with menu (how to attach menu items to menu
>> handlers???? - no answer in examples)
>> - Toolbar with icons (how????????)
>> - components (as i understand - Morphic subclasses, it is the simplest
>> part)
>> - when window opens i need handler to do some setup actions. Handler should
>> fire after UI is built and my app's window is opened (how?????)
>> - i need another handler, which fires when you try to close Pharo or
>> application's window. Handler must check whether to close window or not and
>> do allow or not to close my application.
>> - how to programmatically close window??????
>>
>> 2. The next task is to do some work on image load (i mean pharo image). I
>> need some handler which fires immediately after image is loaded. How to
>> include my handler in this chain???? My app saves data into the image so i
>> need to manage this and auto-load _my_ application after startup.
>>
>> 3. How to drag-n-drop from the host operation system into pharo application
>> and vice versa? I need to drag-n-drop a list of files from\to file browser.
>>
>> 4. Application deployment. How to strip the unnecessary code from the image?
>> I've heard there is "small image" to add all-i-need-to-run. Where i can
>> download it and how to use it????
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://forum.world.st/Pharo-desktop-UI-tp4921212.html
>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>>
>>
>
>
Nov. 3, 2016
Re: [Pharo-users] using zinc wss instead of ws on windows or linux machine
by itay yahalom
so i used nginx and it work.... but only if i open the connection from the
window and not from a web worker to open the connection.
in firefox it opens from a webworker and all good.
tnx for the help Sven. :)
On Sun, Oct 16, 2016 at 8:23 PM, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>
> > On 16 Oct 2016, at 18:34, itayy <itay.yahalom(a)gmail.com> wrote:
> >
> > hi all,
> > i was building a an app with pharo and zinc,
> > after i finished the first part i wanted to upgrade the security and so
> to
> > move from ws to wss.
> > the server is on a windows based machine, and when i change from ws to
> wss
> > nothing happens.
> > im using pharo 5 as the server.
> > do i need to install something else to navigate the secure traffic to the
> > server? and if yes what? and what do i need to config?
>
> Like I said in an earlier private email conversation:
>
> <<
> Basically, you have to start a ZnSecureServer, give it a path to a
> (correct) server certificate and add the ZnWebSocketDelegate to that
> server. That is the theory, I don't remember if I ever tried this myself
> (the combination of both I mean).
> >>
>
> So the question is, who has actual experience deploying/running a secure
> web socket server (wss://) ? On which platform ?
>
> > if i run it on Linux will it solve the problem or do i need to config
> > something also?
> > if i use nginx gateway for wss then send it to pharo in ws will it work?
>
> Yes, that last one could/should also work, theoretically.
>
> Sven
>
> > every help will be great :D
> >
> >
> >
> >
> > --
> > View this message in context: http://forum.world.st/using-
> zinc-wss-instead-of-ws-on-windows-or-linux-machine-tp4918984.html
> > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> >
>
>
>
Nov. 3, 2016
Re: [Pharo-users] About STONS efficiency at storing nested objects { was : (Re: Keeping data with an application)}
by Sven Van Caekenberghe
OK, this is an idea (saving clean blocks as Smalltalk), but I am not sure I like it.
This is a huge security problem (open code execution, [ Smalltalk quitPrimitive ]).
Furthermore, it would create possible uncheckable portability problems.
And even if it were added, it would not cover all blocks, there would still be exceptions.
> On 3 Nov 2016, at 03:04, Mariano Martinez Peck <marianopeck(a)gmail.com> wrote:
>
>
>
> On Wed, Nov 2, 2016 at 8:51 PM, Henrik Nergaard <henrik.nergaard(a)uia.no> wrote:
> You could always store the closure as a string and then evaluate it on materialization, at least if it is clean (no thisContext and no return)
>
> For blocks without no self usage:
> ------------------
> | blk |
>
> blk := [ :a :b | a <= b ].
>
> #_ assert: blk isClean.
>
> blk := Compiler evaluate: blk asString.
>
> #_ assert: (blk value: 1 value: 2)
> ----------------
>
> If self is used then it must also be stored to materialize it correctly again:
>
> ----------------
> | blk ref |
>
> blk := [ self crLog ].
> ref := blk receiver.
> blk := Smalltalk compiler evaluate: blk asString in: nil to: ref.
> blk value
> ----------------
>
> On the topic of STON, is there a way to specify that a variable should only be serialized if it is referenced elsewhere depper in the tree?
> This could be useful, for example when storing morphs that are active in the world to only include #owner that are not the root serialized object and other structures were you might not want to serialize its parent but only deeper into the tree structure.
>
>
>
> I proposed exactly that to SIXX developer which would allow you to serialize at least SortedCollection with clean closures.
>
>
>
>
>
> Best regards,
> Henrik
>
>
> -----Original Message-----
> From: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf Of Sven Van Caekenberghe
> Sent: Wednesday, November 2, 2016 11:11 PM
> To: Any question about pharo is welcome <pharo-users(a)lists.pharo.org
> Subject: Re: [Pharo-users] About STONS efficiency at storing nested objects { was : (Re: Keeping data with an application)}
>
> You can't serialise blocks with STON.
>
> The design goal of STON was to be able to serialise regular domain models.
>
> Classes are written as a global reference to their name, as a kind of shortcut (as opposed to writing out the whole class structure).
>
> For blocks there is no easy solution, AFAIK.
>
> > On 2 Nov 2016, at 20:03, Dimitris Chloupis <kilon.alios(a)gmail.com> wrote:
> >
> > I tried to use my ChronosManager object with it and STON does not seem
> > to like this
> >
> > m := ChronosManager new.
> > s:= STON toString: m
> > s inspect.
> >
> > STONWriter>>error:
> > BlockClosure(Object)>>stonOn:
> > STONWriter>>nextPut:
> > STONWriter>>encodeKey:value:
> > STONMapWriter>>at:put:
> > [ :each |
> > (anObject instVarNamed: each)
> > ifNotNil: [ :value | dictionary at: each asSymbol put: value ]
> > ifNil: [ anObject stonShouldWriteNilInstVars
> > ifTrue: [ dictionary at: each asSymbol put: nil ] ] ] in [
> > :dictionary | instanceVariableNames
> > do: [ :each |
> > (anObject instVarNamed: each)
> > ifNotNil: [ :value | dictionary at: each asSymbol put: value ]
> > ifNil: [ anObject stonShouldWriteNilInstVars
> > ifTrue: [ dictionary at: each asSymbol put: nil ] ] ] ] in STONWriter>>writeObject: in Block: [ :each | ...
> > Array(SequenceableCollection)>>do:
> > [ :dictionary |
> > instanceVariableNames
> > do: [ :each |
> > (anObject instVarNamed: each)
> > ifNotNil: [ :value | dictionary at: each asSymbol put: value ]
> > ifNil: [ anObject stonShouldWriteNilInstVars
> > ifTrue: [ dictionary at: each asSymbol put: nil ] ] ] ] in STONWriter>>writeObject: in Block: [ :dictionary | ...
> > [ self newlineIndent.
> > block value: mapWriter ] in [ | mapWriter | mapWriter := STONMapWriter
> > on: self.
> > writeStream nextPut: ${.
> > self
> > indentedDo: [ self newlineIndent.
> > block value: mapWriter ].
> > self newlineIndent.
> > writeStream nextPut: $} ] in STONWriter>>writeObject:streamMap: in Block: [ self newlineIndent....
> > STONWriter>>indentedDo:
> > [ | mapWriter |
> > mapWriter := STONMapWriter on: self.
> > writeStream nextPut: ${.
> > self
> > indentedDo: [ self newlineIndent.
> > block value: mapWriter ].
> > self newlineIndent.
> > writeStream nextPut: $} ] in STONWriter>>writeObject:streamMap: in Block: [ | mapWriter |...
> > [ writeStream nextPutAll: anObject class stonName.
> > self prettyPrintSpace.
> > block value ] in STONWriter>>writeObject:do: in Block: [ writeStream nextPutAll: anObject class stonName....etc...
> > STONWriter>>with:do:
> > STONWriter>>writeObject:do:
> > STONWriter>>writeObject:streamMap:
> > STONWriter>>writeObject:
> > KMKeymap(Object)>>stonOn:
> > STONWriter>>nextPut:
> > STONWriter>>encodeKey:value:
> > [ :key :value |
> > first
> > ifTrue: [ first := false ]
> > ifFalse: [ self mapElementSeparator ].
> > self encodeKey: key value: value ] in [ self newlineIndent.
> > pairs
> > keysAndValuesDo: [ :key :value |
> > first
> > ifTrue: [ first := false ]
> > ifFalse: [ self mapElementSeparator ].
> > self encodeKey: key value: value ] ] in STONWriter>>encodeMap: in Block: [ :key :value | ...
> > [ :assoc | aBlock value: assoc key value: assoc value ] in Dictionary>>keysAndValuesDo: in Block: [ :assoc | aBlock value: assoc key value: assoc va...etc...
> > [ :each | each ifNotNil: [ aBlock value: each ] ] in
> > Dictionary>>associationsDo: in Block: [ :each | each ifNotNil: [
> > aBlock value: each ] ]
> > Array(SequenceableCollection)>>do:
> > Dictionary>>associationsDo:
> > Dictionary>>keysAndValuesDo:
> > [ self newlineIndent.
> > pairs
> > keysAndValuesDo: [ :key :value |
> > first
> > ifTrue: [ first := false ]
> > ifFalse: [ self mapElementSeparator ].
> > self encodeKey: key value: value ] ] in STONWriter>>encodeMap: in Block: [ self newlineIndent....
> > STONWriter>>indentedDo:
> > STONWriter>>encodeMap:
> > [ self encodeMap: hashedCollection ] in STONWriter>>writeMap: in
> > Block: [ self encodeMap: hashedCollection ]
> > STONWriter>>with:do:
> >
>
>
>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
Nov. 3, 2016
Re: [Pharo-users] Can pharo association web page point to association.pharo.org, like the consortium one?
by Marcus Denker
Hi,
yes, mistake to send out the emails to early. On the TODO:
-> Get SSL cert so always our domain is shown
-> Sort out some strange problem with SPF record in DNS.
After that it will be fully operational. The system itself will not change, so if e.g. someone wants
to join, you can do that already now.
Marcus
> On 2 Nov 2016, at 17:58, Esteban Lorenzano <estebanlm(a)gmail.com> wrote:
>
> it is correct,
> just we still didnât change the domain (to association.pharo.org <http://association.pharo.org/>) and we send the mail too early.
>
> but you can trust that mail, is ours :)
>
> Esteban
>
>> On 2 Nov 2016, at 17:40, Offray Vladimir Luna Cárdenas <offray.luna(a)mutabit.com <mailto:offray.luna@mutabit.com>> wrote:
>>
>> Hi,
>>
>> I just received a mail telling me some password and login information and telling me to go to https://pharo.wildapricot.org/ <https://pharo.wildapricot.org/>, but that domain seem suspicious to me, so I went to the consortium and association which are subdomains of Pharo. First one works well, but second is a redirection to the previous link. In this time of page defacement, could we have the subdomain of the association not redirected to another domain?
>>
>> Cheers,
>>
>> Offray
>>
>>
>
Nov. 3, 2016
Re: [Pharo-users] How does Boolean ifTrue work?
by Dimitris Chloupis
Actually sorry Igor but you are wrong, you just defeated the purpose of
Smalltalk. To expose you to the internals. Of course you can implement
interfaces. You can even implement static types. You can do anything you
want.
The compiler is written in Smalltalk after all.
On Wed, 2 Nov 2016 at 23:02, Igor Stasenko <siguctua(a)gmail.com> wrote:
If you want to ensure that your class(es) comply with certain protocol,
just write a test that covers the protocol and checks that class instances
will understand messages you want it to understand.
But there's no way to restrict your class to comply to whole protocol once
at a time, because tools made in a way, that you populating your class with
methods, each method is add individually and compiled separately, and the
only validation, the compiler is capable of is basically compliance with
smalltalk syntax. And it doesn't cares about higher lever requirement, like
whether your class turns to be 'valid' because of a method you just added,
ready to be used and for what.
Even more, there's no way to connect all those 'interface' formalisation
garbage rules with send sites (the place where you actually invoking one or
another method of one of potetial implementor of your interface), so it
makes no sense to do any (pre)validation on whatever class/object in a
system in order to check whether it conforms with it or not.
That's " Why don't Smalltalk or Smalltalklike languages have checked
interfaces?"
--
Best regards,
Igor Stasenko.
Nov. 3, 2016
Re: [Pharo-users] About STONS efficiency at storing nested objects { was : (Re: Keeping data with an application)}
by Mariano Martinez Peck
On Wed, Nov 2, 2016 at 8:51 PM, Henrik Nergaard <henrik.nergaard(a)uia.no>
wrote:
> You could always store the closure as a string and then evaluate it on
> materialization, at least if it is clean (no thisContext and no return)
>
> For blocks without no self usage:
> ------------------
> | blk |
>
> blk := [ :a :b | a <= b ].
>
> #_ assert: blk isClean.
>
> blk := Compiler evaluate: blk asString.
>
> #_ assert: (blk value: 1 value: 2)
> ----------------
>
> If self is used then it must also be stored to materialize it correctly
> again:
>
> ----------------
> | blk ref |
>
> blk := [ self crLog ].
> ref := blk receiver.
> blk := Smalltalk compiler evaluate: blk asString in: nil to: ref.
> blk value
> ----------------
>
> On the topic of STON, is there a way to specify that a variable should
> only be serialized if it is referenced elsewhere depper in the tree?
> This could be useful, for example when storing morphs that are active in
> the world to only include #owner that are not the root serialized object
> and other structures were you might not want to serialize its parent but
> only deeper into the tree structure.
>
>
I proposed exactly that to SIXX developer which would allow you to
serialize at least SortedCollection with clean closures.
> Best regards,
> Henrik
>
>
> -----Original Message-----
> From: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf
> Of Sven Van Caekenberghe
> Sent: Wednesday, November 2, 2016 11:11 PM
> To: Any question about pharo is welcome <pharo-users(a)lists.pharo.org
> Subject: Re: [Pharo-users] About STONS efficiency at storing nested
> objects { was : (Re: Keeping data with an application)}
>
> You can't serialise blocks with STON.
>
> The design goal of STON was to be able to serialise regular domain models.
>
> Classes are written as a global reference to their name, as a kind of
> shortcut (as opposed to writing out the whole class structure).
>
> For blocks there is no easy solution, AFAIK.
>
> > On 2 Nov 2016, at 20:03, Dimitris Chloupis <kilon.alios(a)gmail.com>
> wrote:
> >
> > I tried to use my ChronosManager object with it and STON does not seem
> > to like this
> >
> > m := ChronosManager new.
> > s:= STON toString: m
> > s inspect.
> >
> > STONWriter>>error:
> > BlockClosure(Object)>>stonOn:
> > STONWriter>>nextPut:
> > STONWriter>>encodeKey:value:
> > STONMapWriter>>at:put:
> > [ :each |
> > (anObject instVarNamed: each)
> > ifNotNil: [ :value | dictionary at: each asSymbol put: value ]
> > ifNil: [ anObject stonShouldWriteNilInstVars
> > ifTrue: [ dictionary at: each asSymbol put: nil ]
> ] ] in [
> > :dictionary | instanceVariableNames
> > do: [ :each |
> > (anObject instVarNamed: each)
> > ifNotNil: [ :value | dictionary at: each asSymbol
> put: value ]
> > ifNil: [ anObject stonShouldWriteNilInstVars
> > ifTrue: [ dictionary at: each
> asSymbol put: nil ] ] ] ] in STONWriter>>writeObject: in Block: [ :each |
> ...
> > Array(SequenceableCollection)>>do:
> > [ :dictionary |
> > instanceVariableNames
> > do: [ :each |
> > (anObject instVarNamed: each)
> > ifNotNil: [ :value | dictionary at: each asSymbol
> put: value ]
> > ifNil: [ anObject stonShouldWriteNilInstVars
> > ifTrue: [ dictionary at: each
> asSymbol put: nil ] ] ] ] in STONWriter>>writeObject: in Block: [
> :dictionary | ...
> > [ self newlineIndent.
> > block value: mapWriter ] in [ | mapWriter | mapWriter := STONMapWriter
> > on: self.
> > writeStream nextPut: ${.
> > self
> > indentedDo: [ self newlineIndent.
> > block value: mapWriter ].
> > self newlineIndent.
> > writeStream nextPut: $} ] in STONWriter>>writeObject:streamMap: in
> Block: [ self newlineIndent....
> > STONWriter>>indentedDo:
> > [ | mapWriter |
> > mapWriter := STONMapWriter on: self.
> > writeStream nextPut: ${.
> > self
> > indentedDo: [ self newlineIndent.
> > block value: mapWriter ].
> > self newlineIndent.
> > writeStream nextPut: $} ] in STONWriter>>writeObject:streamMap: in
> Block: [ | mapWriter |...
> > [ writeStream nextPutAll: anObject class stonName.
> > self prettyPrintSpace.
> > block value ] in STONWriter>>writeObject:do: in Block: [ writeStream
> nextPutAll: anObject class stonName....etc...
> > STONWriter>>with:do:
> > STONWriter>>writeObject:do:
> > STONWriter>>writeObject:streamMap:
> > STONWriter>>writeObject:
> > KMKeymap(Object)>>stonOn:
> > STONWriter>>nextPut:
> > STONWriter>>encodeKey:value:
> > [ :key :value |
> > first
> > ifTrue: [ first := false ]
> > ifFalse: [ self mapElementSeparator ].
> > self encodeKey: key value: value ] in [ self newlineIndent.
> > pairs
> > keysAndValuesDo: [ :key :value |
> > first
> > ifTrue: [ first := false ]
> > ifFalse: [ self mapElementSeparator ].
> > self encodeKey: key value: value ] ] in
> STONWriter>>encodeMap: in Block: [ :key :value | ...
> > [ :assoc | aBlock value: assoc key value: assoc value ] in
> Dictionary>>keysAndValuesDo: in Block: [ :assoc | aBlock value: assoc key
> value: assoc va...etc...
> > [ :each | each ifNotNil: [ aBlock value: each ] ] in
> > Dictionary>>associationsDo: in Block: [ :each | each ifNotNil: [
> > aBlock value: each ] ]
> > Array(SequenceableCollection)>>do:
> > Dictionary>>associationsDo:
> > Dictionary>>keysAndValuesDo:
> > [ self newlineIndent.
> > pairs
> > keysAndValuesDo: [ :key :value |
> > first
> > ifTrue: [ first := false ]
> > ifFalse: [ self mapElementSeparator ].
> > self encodeKey: key value: value ] ] in
> STONWriter>>encodeMap: in Block: [ self newlineIndent....
> > STONWriter>>indentedDo:
> > STONWriter>>encodeMap:
> > [ self encodeMap: hashedCollection ] in STONWriter>>writeMap: in
> > Block: [ self encodeMap: hashedCollection ]
> > STONWriter>>with:do:
> >
>
>
>
>
--
Mariano
http://marianopeck.wordpress.com
Nov. 3, 2016
Re: [Pharo-users] Pharo desktop UI
by Johan Fabry
Iâm happy that the documentation is of help to you!
Sorry but I donât have an answer to your question at hand right now. Have a look at all the users of MenuModel and friends to see where they are used in the image, you should be able to get the examples you need.
HTH,
--
Does this mail seem too brief? Sorry for that, I donât mean to be rude! Please see http://emailcharter.org <http://emailcharter.org/> .
Johan Fabry - http://pleiad.cl/~jfabry
PLEIAD and RyCh labs - Computer Science Department (DCC) - University of Chile
> On 02 Nov 2016, at 21:09, vikenti <vikenti.potapov(a)gmail.com> wrote:
>
> One more question: how to add separator to the menu group?
> either MenuGroupModel nor MenuItemModel has special selector but autocompletion shows me "addSeparator", if i use it - i get an error.
Nov. 3, 2016
Re: [Pharo-users] Pharo desktop UI
by vikenti
Thanks!
After looking through this manual i successfully created simple window with cascaded menu which.
I will deeply research this book.
One more question: how to add separator to the menu group?
either MenuGroupModel nor MenuItemModel has special selector but autocompletion shows me "addSeparator", if i use it - i get an error.
On Wed, 2 Nov 2016 14:53:56 -0700 (PDT)
"jfabry [via Smalltalk]" <ml-node+s1294792n4921213h68(a)n4.nabble.com> wrote:
>
>
> Hello Vikenti,
>
> for writing UIs in Pharo the UI builder you should use is Spec. We have documentation online in the form of a book (which is a work in progress).I think it will answer many of your UI questions, have a look at http://files.pharo.org/books/spec-tutorial/
>
> HTH,
>
> --
> Does this mail seem too brief? Sorry for that, I donât mean to be rude! Please see http://emailcharter.org .
>
> Johan Fabry - http://pleiad.cl/~jfabry
> PLEIAD and RyCh labs - Computer Science Department (DCC) - University of Chile
>
> > On 02 Nov 2016, at 18:43, vikenti <vikenti.potapov(a)gmail.com> wrote:
> >
> > Hello, i'm newbie in Pharo, converted from Visual Works which is quite
> > different from Pharo Smalltalk.
> > I started to port my application (i've been working on for about three
> > years) from VW (because of new personal user licensing limitations of Visual
> > Works), but i have to solve some problems and need your advice.
> >
> > These ase some of the most important problems:
> > 1. I need to rewrite the whole GUI from scratch. What UI framework to
> > choose and where to get documentation? Please, don't send me to research
> > code examples instead of docs - i do this during whole last week. The
> > example should be complete and simple: one task - one example, all examples
> > i've seen are either not applicable to real life or too complicated to
> > understand.
> > - I need simple window with menu (how to attach menu items to menu
> > handlers???? - no answer in examples)
> > - Toolbar with icons (how????????)
> > - components (as i understand - Morphic subclasses, it is the simplest
> > part)
> > - when window opens i need handler to do some setup actions. Handler should
> > fire after UI is built and my app's window is opened (how?????)
> > - i need another handler, which fires when you try to close Pharo or
> > application's window. Handler must check whether to close window or not and
> > do allow or not to close my application.
> > - how to programmatically close window??????
> >
> > 2. The next task is to do some work on image load (i mean pharo image). I
> > need some handler which fires immediately after image is loaded. How to
> > include my handler in this chain???? My app saves data into the image so i
> > need to manage this and auto-load _my_ application after startup.
> >
> > 3. How to drag-n-drop from the host operation system into pharo application
> > and vice versa? I need to drag-n-drop a list of files from\to file browser.
> >
> > 4. Application deployment. How to strip the unnecessary code from the image?
> > I've heard there is "small image" to add all-i-need-to-run. Where i can
> > download it and how to use it????
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> > View this message in context: http://forum.world.st/Pharo-desktop-UI-tp4921212.html
> > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> >
> >
>
>
>
>
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://forum.world.st/Pharo-desktop-UI-tp4921212p4921213.html
>
> To unsubscribe from Pharo desktop UI, visit http://forum.world.st/template/NamlServlet.jtp?macro=unsubscribe_by_code&no…
--
С Ñважением,
ÐикенÑий ÐоÑапов
http://vikenti.ru
Ñел.: +7 (917) 880 25 07 (г. ÐазанÑ)
--
View this message in context: http://forum.world.st/Pharo-desktop-UI-tp4921212p4921229.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Nov. 3, 2016
Re: [Pharo-users] About STONS efficiency at storing nested objects { was : (Re: Keeping data with an application)}
by Henrik Nergaard
You could always store the closure as a string and then evaluate it on materialization, at least if it is clean (no thisContext and no return)
For blocks without no self usage:
------------------
| blk |
blk := [ :a :b | a <= b ].
#_ assert: blk isClean.
blk := Compiler evaluate: blk asString.
#_ assert: (blk value: 1 value: 2)
----------------
If self is used then it must also be stored to materialize it correctly again:
----------------
| blk ref |
blk := [ self crLog ].
ref := blk receiver.
blk := Smalltalk compiler evaluate: blk asString in: nil to: ref.
blk value
----------------
On the topic of STON, is there a way to specify that a variable should only be serialized if it is referenced elsewhere depper in the tree?
This could be useful, for example when storing morphs that are active in the world to only include #owner that are not the root serialized object and other structures were you might not want to serialize its parent but only deeper into the tree structure.
Best regards,
Henrik
-----Original Message-----
From: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf Of Sven Van Caekenberghe
Sent: Wednesday, November 2, 2016 11:11 PM
To: Any question about pharo is welcome <pharo-users(a)lists.pharo.org
Subject: Re: [Pharo-users] About STONS efficiency at storing nested objects { was : (Re: Keeping data with an application)}
You can't serialise blocks with STON.
The design goal of STON was to be able to serialise regular domain models.
Classes are written as a global reference to their name, as a kind of shortcut (as opposed to writing out the whole class structure).
For blocks there is no easy solution, AFAIK.
> On 2 Nov 2016, at 20:03, Dimitris Chloupis <kilon.alios(a)gmail.com> wrote:
>
> I tried to use my ChronosManager object with it and STON does not seem
> to like this
>
> m := ChronosManager new.
> s:= STON toString: m
> s inspect.
>
> STONWriter>>error:
> BlockClosure(Object)>>stonOn:
> STONWriter>>nextPut:
> STONWriter>>encodeKey:value:
> STONMapWriter>>at:put:
> [ :each |
> (anObject instVarNamed: each)
> ifNotNil: [ :value | dictionary at: each asSymbol put: value ]
> ifNil: [ anObject stonShouldWriteNilInstVars
> ifTrue: [ dictionary at: each asSymbol put: nil ] ] ] in [
> :dictionary | instanceVariableNames
> do: [ :each |
> (anObject instVarNamed: each)
> ifNotNil: [ :value | dictionary at: each asSymbol put: value ]
> ifNil: [ anObject stonShouldWriteNilInstVars
> ifTrue: [ dictionary at: each asSymbol put: nil ] ] ] ] in STONWriter>>writeObject: in Block: [ :each | ...
> Array(SequenceableCollection)>>do:
> [ :dictionary |
> instanceVariableNames
> do: [ :each |
> (anObject instVarNamed: each)
> ifNotNil: [ :value | dictionary at: each asSymbol put: value ]
> ifNil: [ anObject stonShouldWriteNilInstVars
> ifTrue: [ dictionary at: each asSymbol put: nil ] ] ] ] in STONWriter>>writeObject: in Block: [ :dictionary | ...
> [ self newlineIndent.
> block value: mapWriter ] in [ | mapWriter | mapWriter := STONMapWriter
> on: self.
> writeStream nextPut: ${.
> self
> indentedDo: [ self newlineIndent.
> block value: mapWriter ].
> self newlineIndent.
> writeStream nextPut: $} ] in STONWriter>>writeObject:streamMap: in Block: [ self newlineIndent....
> STONWriter>>indentedDo:
> [ | mapWriter |
> mapWriter := STONMapWriter on: self.
> writeStream nextPut: ${.
> self
> indentedDo: [ self newlineIndent.
> block value: mapWriter ].
> self newlineIndent.
> writeStream nextPut: $} ] in STONWriter>>writeObject:streamMap: in Block: [ | mapWriter |...
> [ writeStream nextPutAll: anObject class stonName.
> self prettyPrintSpace.
> block value ] in STONWriter>>writeObject:do: in Block: [ writeStream nextPutAll: anObject class stonName....etc...
> STONWriter>>with:do:
> STONWriter>>writeObject:do:
> STONWriter>>writeObject:streamMap:
> STONWriter>>writeObject:
> KMKeymap(Object)>>stonOn:
> STONWriter>>nextPut:
> STONWriter>>encodeKey:value:
> [ :key :value |
> first
> ifTrue: [ first := false ]
> ifFalse: [ self mapElementSeparator ].
> self encodeKey: key value: value ] in [ self newlineIndent.
> pairs
> keysAndValuesDo: [ :key :value |
> first
> ifTrue: [ first := false ]
> ifFalse: [ self mapElementSeparator ].
> self encodeKey: key value: value ] ] in STONWriter>>encodeMap: in Block: [ :key :value | ...
> [ :assoc | aBlock value: assoc key value: assoc value ] in Dictionary>>keysAndValuesDo: in Block: [ :assoc | aBlock value: assoc key value: assoc va...etc...
> [ :each | each ifNotNil: [ aBlock value: each ] ] in
> Dictionary>>associationsDo: in Block: [ :each | each ifNotNil: [
> aBlock value: each ] ]
> Array(SequenceableCollection)>>do:
> Dictionary>>associationsDo:
> Dictionary>>keysAndValuesDo:
> [ self newlineIndent.
> pairs
> keysAndValuesDo: [ :key :value |
> first
> ifTrue: [ first := false ]
> ifFalse: [ self mapElementSeparator ].
> self encodeKey: key value: value ] ] in STONWriter>>encodeMap: in Block: [ self newlineIndent....
> STONWriter>>indentedDo:
> STONWriter>>encodeMap:
> [ self encodeMap: hashedCollection ] in STONWriter>>writeMap: in
> Block: [ self encodeMap: hashedCollection ]
> STONWriter>>with:do:
>
Nov. 2, 2016