Pharo-users
By thread
pharo-users@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- August
- 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
- 6 participants
- 50351 messages
Pillar editor - Atom hides .ignored files
by Ben Coman
It might just be the configuration of Pillar used for the
PharoLaserGameTutorial, but directory with the sources files get
cluttered with a lot of generated files. However I discovered something
interesting using Atom to edit the Pillar files. You can set the "Hide
Vcs Ignored Files" option in the Tree View package to ignore the files
configured in .gitignore. This really cleans up the navigator.
btw, one for the wish list.... I like the way Atom provides a nice list
of Keybindings per package, as well as overall. It would be nice to
have something similar in Pharo.
cheers -ben
July 18, 2014
Re: [Pharo-users] Adding method to class
by Mark Rizun
Thank you very much guys. I think, now I can understand what is going on
with method adding:)
Best,
Mark
2014-07-18 12:09 GMT+02:00 Esteban Lorenzano <estebanlm(a)gmail.com>:
> also you will still have an error if using the RBNamespace instead the
> direct method invocation, if class does not exist.
> So⦠I stand with my opinion :)
>
> If you want to control existence, you could do something like this:
>
> #Model asClassIfPresent: [ :class |
> class compile: 'asString ^ String empty' classified: #accessing ]
>
> Esteban
>
> On 18 Jul 2014, at 11:19, Guillermo Polito <guillermopolito(a)gmail.com>
> wrote:
>
> But wait. What happens here is that we are mixing concepts.
>
> 1) On one side, there is Pharo's class model (the one we program with) =>
> classes, metaclasses, methods. Let's call them the *real* classes and
> methods. So if you want to add a method to your *real* class, you usually
> have to
>
> - compile a method
> - add it to the method dictionary of the class
>
> There are some helper methods that do all the work in one step, as
> mentioned by Esteban:
>
> myClass compile: someCode classified: aProtocolName.
>
>
> That, is what happens when you use the browser (Nautilus in our case).
>
>
> 2) On the other side, there is the Refactoring browser framework (that is,
> all classes prefixed as RB (except the AST nodes now)). The refactoring
> browser implements refactorings (renames of classes and methods, pushing
> up/down instance variables in a hierarchy, extracting methods into
> classes). Of course, to apply these refactoring it uses the model and API's
> provided by 1). But it's a completely different monster.
>
> That means, adding a RBMethod in a RBClass does not mean that you are
> adding a *real* method into a *real* class. That will not happen unless
> that change is inside a refactoring and you apply the refactoring.
>
>
>
> On Fri, Jul 18, 2014 at 3:43 AM, Ben Coman <btc(a)openinworld.com> wrote:
>
>> This might be a good example to add to Deep Into Pharo (but I haven't
>> read it yet, so its too much for me right now to work out where it should
>> go). Anyone interested in doing this? Otherwise maybe I could drop it into
>> a scratchpad at the back of the book.
>> cheers -ben
>>
>>
>> Hernán Morales Durand wrote:
>>
>> Yes you need it because when doing code generation you cannot always
>> assume target class is present. Besides using RB you can confirm through
>> the NautilusRefactoring which is useful for massive changes:
>>
>> | model |
>> model := RBNamespace new.
>> (model classNamed: #Model)
>> compile: 'asString ^ String empty'
>> classified: #(accessing).
>> (ChangesBrowser changes: model changes changes) openWithSpec
>>
>> Cheers,
>>
>> Hernán
>>
>>
>> 2014-07-17 13:55 GMT-03:00 Esteban Lorenzano <estebanlm(a)gmail.com>:
>>
>>> Hi,
>>>
>>> you do not need the RBNamespace mediation, just do:
>>>
>>> Model compile: âmethod ...â classified: âaccessingâ.
>>>
>>> Esteban
>>>
>>> On 17 Jul 2014, at 18:52, Mark Rizun <mrizun(a)gmail.com> wrote:
>>>
>>> Thanks Hernan
>>> 17 лип. 2014 18:29, коÑиÑÑÑÐ²Ð°Ñ "Hernán Morales Durand" <
>>> hernan.morales(a)gmail.com> напиÑав:
>>>
>>>> No. Adding a method is not a refactoring. You should use
>>>> RBAddMethodChange:
>>>>
>>>> | model |
>>>> model := RBNamespace new.
>>>> (model classNamed: #Model)
>>>> compile: 'asString ^ String empty'
>>>> classified: #(accessing).
>>>> model changes execute.
>>>>
>>>> and the new method is recorded in the .changes file
>>>>
>>>> Cheers,
>>>>
>>>> Hernán
>>>>
>>>>
>>>>
>>>> 2014-07-17 11:08 GMT-03:00 Mark Rizun <mrizun(a)gmail.com>:
>>>>
>>>>> Thank you all. Problem is solved, I just used RBAddMethodRefactoring.
>>>>>
>>>>> Mark
>>>>>
>>>>>
>>>>> 2014-07-17 16:07 GMT+02:00 Baptiste Quide <baptiste.quide(a)inria.fr>:
>>>>>
>>>>> I think you have to add a "RGMethodDefinition" or a "CompiledMethod".
>>>>>> Obviously in a class methodDict the values are CompiledMethod.
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> ------------------------------
>>>>>>
>>>>>> *De: *"Sebastian Tleye" <stleye(a)gmail.com>
>>>>>> *Ã: *"Any question about pharo is welcome" <
>>>>>> pharo-users(a)lists.pharo.org>
>>>>>> *Envoyé: *Jeudi 17 Juillet 2014 16:03:52
>>>>>> *Objet: *Re: [Pharo-users] Adding method to class
>>>>>>
>>>>>>
>>>>>> I don't know what RBMethod is, but you can do
>>>>>>
>>>>>> aClass compile: source.
>>>>>>
>>>>>> For example:
>>>>>>
>>>>>> Array compile: 'newMethod ^ 1'
>>>>>>
>>>>>> I don't know if it answers your question.
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2014-07-17 15:57 GMT+02:00 Mark Rizun <mrizun(a)gmail.com>:
>>>>>>
>>>>>>> P.S. obviously, my method is added to newMethods var, but it is not
>>>>>>> disblayed in my class.
>>>>>>>
>>>>>>>
>>>>>>> 2014-07-17 15:53 GMT+02:00 Mark Rizun <mrizun(a)gmail.com>:
>>>>>>>
>>>>>>> Hi guys!
>>>>>>>>
>>>>>>>> How can I add method (I have /RBMethod/) to a class in code?
>>>>>>>> I'm asking because existing method /addMethod:/ in
>>>>>>>> /RBAbstractClass/ isn't
>>>>>>>> working.
>>>>>>>> Here is a piece of my code:
>>>>>>>>
>>>>>>>> /method:= RBMethod for: class source: ('^ ', newName asString)
>>>>>>>> selector:
>>>>>>>> newName asSymbol.
>>>>>>>> class addMethod: getter./
>>>>>>>>
>>>>>>>> Best
>>>>>>>> Mark
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://forum.world.st/Adding-method-to-class-tp4768282.html
>>>>>>>> Sent from the Pharo Smalltalk Users mailing list archive at
>>>>>>>> Nabble.com <http://nabble.com/>.
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>>
>
>
July 18, 2014
Re: [Pharo-users] Adding method to class
by Esteban Lorenzano
also you will still have an error if using the RBNamespace instead the direct method invocation, if class does not exist.
So⦠I stand with my opinion :)
If you want to control existence, you could do something like this:
#Model asClassIfPresent: [ :class |
class compile: 'asString ^ String empty' classified: #accessing ]
Esteban
On 18 Jul 2014, at 11:19, Guillermo Polito <guillermopolito(a)gmail.com> wrote:
> But wait. What happens here is that we are mixing concepts.
>
> 1) On one side, there is Pharo's class model (the one we program with) => classes, metaclasses, methods. Let's call them the *real* classes and methods. So if you want to add a method to your *real* class, you usually have to
>
> - compile a method
> - add it to the method dictionary of the class
>
> There are some helper methods that do all the work in one step, as mentioned by Esteban:
>
> myClass compile: someCode classified: aProtocolName.
>
> That, is what happens when you use the browser (Nautilus in our case).
>
>
> 2) On the other side, there is the Refactoring browser framework (that is, all classes prefixed as RB (except the AST nodes now)). The refactoring browser implements refactorings (renames of classes and methods, pushing up/down instance variables in a hierarchy, extracting methods into classes). Of course, to apply these refactoring it uses the model and API's provided by 1). But it's a completely different monster.
>
> That means, adding a RBMethod in a RBClass does not mean that you are adding a *real* method into a *real* class. That will not happen unless that change is inside a refactoring and you apply the refactoring.
>
>
>
> On Fri, Jul 18, 2014 at 3:43 AM, Ben Coman <btc(a)openinworld.com> wrote:
> This might be a good example to add to Deep Into Pharo (but I haven't read it yet, so its too much for me right now to work out where it should go). Anyone interested in doing this? Otherwise maybe I could drop it into a scratchpad at the back of the book.
> cheers -ben
>
>
> Hernán Morales Durand wrote:
>>
>> Yes you need it because when doing code generation you cannot always assume target class is present. Besides using RB you can confirm through the NautilusRefactoring which is useful for massive changes:
>>
>> | model |
>> model := RBNamespace new.
>> (model classNamed: #Model)
>> compile: 'asString ^ String empty'
>> classified: #(accessing).
>> (ChangesBrowser changes: model changes changes) openWithSpec
>>
>> Cheers,
>>
>> Hernán
>>
>>
>> 2014-07-17 13:55 GMT-03:00 Esteban Lorenzano <estebanlm(a)gmail.com>:
>> Hi,
>>
>> you do not need the RBNamespace mediation, just do:
>>
>> Model compile: âmethod ...â classified: âaccessingâ.
>>
>> Esteban
>>
>> On 17 Jul 2014, at 18:52, Mark Rizun <mrizun(a)gmail.com> wrote:
>>
>>> Thanks Hernan
>>>
>>> 17 лип. 2014 18:29, коÑиÑÑÑÐ²Ð°Ñ "Hernán Morales Durand" <hernan.morales(a)gmail.com> напиÑав:
>>> No. Adding a method is not a refactoring. You should use RBAddMethodChange:
>>>
>>> | model |
>>> model := RBNamespace new.
>>> (model classNamed: #Model)
>>> compile: 'asString ^ String empty'
>>> classified: #(accessing).
>>> model changes execute.
>>>
>>> and the new method is recorded in the .changes file
>>>
>>> Cheers,
>>>
>>> Hernán
>>>
>>>
>>>
>>> 2014-07-17 11:08 GMT-03:00 Mark Rizun <mrizun(a)gmail.com>:
>>> Thank you all. Problem is solved, I just used RBAddMethodRefactoring.
>>>
>>> Mark
>>>
>>>
>>> 2014-07-17 16:07 GMT+02:00 Baptiste Quide <baptiste.quide(a)inria.fr>:
>>>
>>> I think you have to add a "RGMethodDefinition" or a "CompiledMethod".
>>> Obviously in a class methodDict the values are CompiledMethod.
>>>
>>> Regards,
>>>
>>> De: "Sebastian Tleye" <stleye(a)gmail.com>
>>> Ã: "Any question about pharo is welcome" <pharo-users(a)lists.pharo.org>
>>> Envoyé: Jeudi 17 Juillet 2014 16:03:52
>>> Objet: Re: [Pharo-users] Adding method to class
>>>
>>>
>>> I don't know what RBMethod is, but you can do
>>>
>>> aClass compile: source.
>>>
>>> For example:
>>>
>>> Array compile: 'newMethod ^ 1'
>>>
>>> I don't know if it answers your question.
>>>
>>> Regards
>>>
>>>
>>>
>>>
>>> 2014-07-17 15:57 GMT+02:00 Mark Rizun <mrizun(a)gmail.com>:
>>> P.S. obviously, my method is added to newMethods var, but it is not disblayed in my class.
>>>
>>>
>>> 2014-07-17 15:53 GMT+02:00 Mark Rizun <mrizun(a)gmail.com>:
>>>
>>> Hi guys!
>>>
>>> How can I add method (I have /RBMethod/) to a class in code?
>>> I'm asking because existing method /addMethod:/ in /RBAbstractClass/ isn't
>>> working.
>>> Here is a piece of my code:
>>>
>>> /method:= RBMethod for: class source: ('^ ', newName asString) selector:
>>> newName asSymbol.
>>> class addMethod: getter./
>>>
>>> Best
>>> Mark
>>>
>>>
>>>
>>> --
>>> View this message in context: http://forum.world.st/Adding-method-to-class-tp4768282.html
>>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
July 18, 2014
Re: [Pharo-users] Adding method to class
by Guillermo Polito
But wait. What happens here is that we are mixing concepts.
1) On one side, there is Pharo's class model (the one we program with) =>
classes, metaclasses, methods. Let's call them the *real* classes and
methods. So if you want to add a method to your *real* class, you usually
have to
- compile a method
- add it to the method dictionary of the class
There are some helper methods that do all the work in one step, as
mentioned by Esteban:
myClass compile: someCode classified: aProtocolName.
That, is what happens when you use the browser (Nautilus in our case).
2) On the other side, there is the Refactoring browser framework (that is,
all classes prefixed as RB (except the AST nodes now)). The refactoring
browser implements refactorings (renames of classes and methods, pushing
up/down instance variables in a hierarchy, extracting methods into
classes). Of course, to apply these refactoring it uses the model and API's
provided by 1). But it's a completely different monster.
That means, adding a RBMethod in a RBClass does not mean that you are
adding a *real* method into a *real* class. That will not happen unless
that change is inside a refactoring and you apply the refactoring.
On Fri, Jul 18, 2014 at 3:43 AM, Ben Coman <btc(a)openinworld.com> wrote:
> This might be a good example to add to Deep Into Pharo (but I haven't
> read it yet, so its too much for me right now to work out where it should
> go). Anyone interested in doing this? Otherwise maybe I could drop it into
> a scratchpad at the back of the book.
> cheers -ben
>
>
> Hernán Morales Durand wrote:
>
> Yes you need it because when doing code generation you cannot always
> assume target class is present. Besides using RB you can confirm through
> the NautilusRefactoring which is useful for massive changes:
>
> | model |
> model := RBNamespace new.
> (model classNamed: #Model)
> compile: 'asString ^ String empty'
> classified: #(accessing).
> (ChangesBrowser changes: model changes changes) openWithSpec
>
> Cheers,
>
> Hernán
>
>
> 2014-07-17 13:55 GMT-03:00 Esteban Lorenzano <estebanlm(a)gmail.com>:
>
>> Hi,
>>
>> you do not need the RBNamespace mediation, just do:
>>
>> Model compile: âmethod ...â classified: âaccessingâ.
>>
>> Esteban
>>
>> On 17 Jul 2014, at 18:52, Mark Rizun <mrizun(a)gmail.com> wrote:
>>
>> Thanks Hernan
>> 17 лип. 2014 18:29, коÑиÑÑÑÐ²Ð°Ñ "Hernán Morales Durand" <
>> hernan.morales(a)gmail.com> напиÑав:
>>
>>> No. Adding a method is not a refactoring. You should use
>>> RBAddMethodChange:
>>>
>>> | model |
>>> model := RBNamespace new.
>>> (model classNamed: #Model)
>>> compile: 'asString ^ String empty'
>>> classified: #(accessing).
>>> model changes execute.
>>>
>>> and the new method is recorded in the .changes file
>>>
>>> Cheers,
>>>
>>> Hernán
>>>
>>>
>>>
>>> 2014-07-17 11:08 GMT-03:00 Mark Rizun <mrizun(a)gmail.com>:
>>>
>>>> Thank you all. Problem is solved, I just used RBAddMethodRefactoring.
>>>>
>>>> Mark
>>>>
>>>>
>>>> 2014-07-17 16:07 GMT+02:00 Baptiste Quide <baptiste.quide(a)inria.fr>:
>>>>
>>>> I think you have to add a "RGMethodDefinition" or a "CompiledMethod".
>>>>> Obviously in a class methodDict the values are CompiledMethod.
>>>>>
>>>>> Regards,
>>>>>
>>>>> ------------------------------
>>>>>
>>>>> *De: *"Sebastian Tleye" <stleye(a)gmail.com>
>>>>> *Ã: *"Any question about pharo is welcome" <
>>>>> pharo-users(a)lists.pharo.org>
>>>>> *Envoyé: *Jeudi 17 Juillet 2014 16:03:52
>>>>> *Objet: *Re: [Pharo-users] Adding method to class
>>>>>
>>>>>
>>>>> I don't know what RBMethod is, but you can do
>>>>>
>>>>> aClass compile: source.
>>>>>
>>>>> For example:
>>>>>
>>>>> Array compile: 'newMethod ^ 1'
>>>>>
>>>>> I don't know if it answers your question.
>>>>>
>>>>> Regards
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> 2014-07-17 15:57 GMT+02:00 Mark Rizun <mrizun(a)gmail.com>:
>>>>>
>>>>>> P.S. obviously, my method is added to newMethods var, but it is not
>>>>>> disblayed in my class.
>>>>>>
>>>>>>
>>>>>> 2014-07-17 15:53 GMT+02:00 Mark Rizun <mrizun(a)gmail.com>:
>>>>>>
>>>>>> Hi guys!
>>>>>>>
>>>>>>> How can I add method (I have /RBMethod/) to a class in code?
>>>>>>> I'm asking because existing method /addMethod:/ in /RBAbstractClass/
>>>>>>> isn't
>>>>>>> working.
>>>>>>> Here is a piece of my code:
>>>>>>>
>>>>>>> /method:= RBMethod for: class source: ('^ ', newName asString)
>>>>>>> selector:
>>>>>>> newName asSymbol.
>>>>>>> class addMethod: getter./
>>>>>>>
>>>>>>> Best
>>>>>>> Mark
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://forum.world.st/Adding-method-to-class-tp4768282.html
>>>>>>> Sent from the Pharo Smalltalk Users mailing list archive at
>>>>>>> Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
>
July 18, 2014
Re: [Pharo-users] Roassal2 Composite Shape
by Alexandre Bergel
Well seen!! Good point!
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On Jul 15, 2014, at 9:46 PM, Juraj Kubelka <juraj.kubelka(a)gmail.com> wrote:
> Just an idea: the svg path shape would not solve your needs? Maybe improving trachel svg path and then use it for any desired shape, e.g., rectangles with round corner? Does it have sense?
>
> Cheers,
> Jura
>
> --
> Juraj Kubelka
>
> El 15/07/2014, a las 03:24, Peter Uhnák <i.uhnak(a)gmail.com> escribió:
>
>> Well in the long run I will probably need much more shapes that are currently present so I will probably end up making both TRShape and RTShape anyway. As far as contribution goes, I'd be happy to contribute but I'm still quite new to both Pharo and Smalltalk so I'm quite skeptical about the code quality.
>>
>> I've actually already made both shapes for rounded box but it will need some testing first; so I'll keep you posted.
>>
>> Peter
>>
>>
>> On Mon, Jul 14, 2014 at 10:47 PM, Alexandre Bergel <alexandre.bergel(a)me.com> wrote:
>> Indeed, Roassal does not have a rectangle with rounded corner. Having it in Roassal means you need a new TRShape and a new RTShape.
>>
>> I could easily do the RTShape. But we need the TRShape first. Do you feel like doing it? This will be a valuable addition to Roassal.
>>
>> Cheers,
>> Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>> On Jul 13, 2014, at 9:57 AM, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
>>
>>> Thank you, the example now works. However as I've mentioned in
>>> previous post I'm not sure about the rest of the shapes posted in the
>>> attachment. E.g. I haven't seen any notion of "box with rounded
>>> corners". I could compose it from four RTArc nad four RTLine but it
>>> seems to me overly complex compared to creating new Trachert/Roassal
>>> classes. The same would go for the other shapes. What are your
>>> thoughts/recommendations on that?
>>>
>>> Peter
>>>
>>> On Sun, Jul 13, 2014 at 3:25 PM, Alexandre Bergel
>>> <alexandre.bergel(a)me.com> wrote:
>>>> Sorry, the version was not properly saved in SmalltalkHub. If you update Roassal2 and Trachel, you should be able to execute the code snippet Iâve sent you. Maybe you want to add âv openâ at the end. If you are using GTInspector, this is not necessary.
>>>>
>>>> As far as I understand your description of the problem, you do not need to create your own shape.
>>>>
>>>> Let me know how it goes.
>>>>
>>>> Cheers,
>>>> Alexandre
>>>>
>>>>
>>>> On Jul 13, 2014, at 10:38 AM, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
>>>>
>>>>> Thank you both for suggestions.
>>>>>
>>>>> According to Monticello I have latest Roassal2 and yet I don't see RTMultiCompositeShape, but I would assume it should be what I was looking for originally.
>>>>>
>>>>> In the meantime I chose to do it manually - creating a custom shape in both Roassal and Trachert:
>>>>> I've done it in a single path because it seems that having multiple separate paths just creates more trouble.
>>>>> ========
>>>>> computePath
>>>>> canvas ifNil: [ ^ self ].
>>>>> path := self athensCanvas
>>>>> createPath: [ :builder |
>>>>> builder absolute.
>>>>> self ccwCirclePath: builder radius: 0.5. "building circular path with specified radius"
>>>>> self cwCirclePath: builder radius: 0.48.
>>>>> self ccwCirclePath: builder radius: 0.4 ]
>>>>> ========
>>>>>
>>>>> But even if I could manage to do this with MultiCompositeShape I'm not sure about the rest of the shapes (see attachment).
>>>>>
>>>>> Peter
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Sun, Jul 13, 2014 at 1:18 AM, Alexandre Bergel <alexandre.bergel(a)me.com> wrote:
>>>>> Hi Peter,
>>>>>
>>>>> I am not sure what you try to do. Having two ellipses with the same center? But different radius?
>>>>>
>>>>> Something like that maybe:
>>>>> -=-=-=-=-=-=-=-=-=
>>>>> | v |
>>>>> v := RTView new.
>>>>> v @ RTDraggableView.
>>>>>
>>>>> shape := RTMultiCompositeShape new.
>>>>> shape add: (RTEllipse new color: (Color yellow alpha: 0.3); size: [:c | c numberOfMethods sqrt * 10 ]).
>>>>> shape add: (RTEllipse new color: (Color green alpha: 0.3); size: [:c | c numberOfLinesOfCode sqrt * 10 ]).
>>>>>
>>>>> v addAll: (shape elementsOn: RTShape withAllSubclasses).
>>>>> RTFlowLayout on: v elements.
>>>>>
>>>>> v
>>>>> -=-=-=-=-=-=-=-=-=
>>>>>
>>>>> <Screen Shot 2014-07-13 at 1.18.36 AM.png>
>>>>>
>>>>> Alexandre
>>>>>
>>>>>
>>>>> On Jul 11, 2014, at 11:05 PM, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> I'm trying to draw an ellipse inside another ellipse but to no avail. I've tried using RTCompositeShape but that just expands the size of the smaller shape. Is there something else I'm missing (like fixing dimensions so they won't get updated) or should I subclass RTAbstractCompositeShape and try to make something on my own?
>>>>>>
>>>>>> Thanks,
>>>>>> Peter
>>>>>
>>>>> --
>>>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>>> Alexandre Bergel http://www.bergel.eu
>>>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> <shapes.png>
>>>>
>>>> --
>>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>> Alexandre Bergel http://www.bergel.eu
>>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
July 17, 2014
Re: [Pharo-users] export roassal views
by Alexandre Bergel
Hi Rosario,
Sorry for my late answer.
First, I suggest to use RTMetricMap instead of RTMapBuilder. Regarding your problem, Roassal does not have a PNG exporter. This is not a big deal to do, but I just havenât made it yet. If you want to give a try, and porting it from Roassal1 to Roassal2, then you are very welcome.
You need to open the view to properly set the extent. I am not quite sure why and how this happens. I have to dig this out. But again, it would be easier with the PNG exporter.
Anyway, I think you want to do the following:
-=-=-=-=-=-=-=-=-=-=
| b |
b := RTMetricMap new.
b countries: RTMapBuilder countries color: Color white.
b open delete.
b view canvas morph
extent: b view canvas camera encompassingRectangle extent;
exportAsPNG.
-=-=-=-=-=-=-=-=-=-=
Let me know how it goes.
Oh, and by the way⦠the work you are doing with the tweets is truly amazing. Will you be at Esug?
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On Jul 15, 2014, at 5:06 PM, rosariosm <rosariosantamarina1(a)gmail.com> wrote:
> Hi,
> I have the following problem when i try to export a view into a png file. I
> use a RTMapBuilder as an example:
>
> b := RTMapBuilder new.
> b countries: RTMapBuilder countries.
>
> b view canvas buildMorph
> *extent: view view canvas camera encompassingRectangle extent ;*
> exportAsPNG.
>
> if i don't specify the rectangle extent (bold line), i can export without
> problem but i cant see the complete image. on the other hand, if a specify
> the rectangle extent, an error occurs. see both examples:
>
> 1) without extent
> <http://forum.world.st/file/n4767944/prueba2.png>
>
> 2) with extent
> <http://forum.world.st/file/n4767944/prueba.png>
>
>
> Anyone knows what is happenning??
> Thanks,
> Rosario
>
>
>
>
>
> --
> View this message in context: http://forum.world.st/export-roassal-views-tp4767944.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
July 17, 2014
Re: [Pharo-users] Spec - vertically stacked Menu(Group)Model
by Peter Uhnák
Ok, thank you both.
On Thu, Jul 17, 2014 at 7:16 PM, Esteban Lorenzano <estebanlm(a)gmail.com>
wrote:
>
> On 17 Jul 2014, at 19:10, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
>
> But in general, is Morphic planned to be discontinued (fully replaced with
> Athens?) or just live as the bottom layer?
>
>
> No.
> Athens is not a replacement for Morphic, but to the drawing canvas that
> Morphic (or any graphical object) uses.
> So, it is in a lower level than Morphic.
>
> Esteban
>
>
>
>
> On Thu, Jul 17, 2014 at 7:06 PM, Benjamin <
> benjamin.vanryseghem.pharo(a)gmail.com> wrote:
>
>> If you can add some Spec behaviour to match the morphic one, then itâs ok
>> :)
>>
>> Ben
>>
>> On 17 Jul 2014, at 19:03, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
>>
>> Well, is this something that should be done on top of the existing
>> solution, or should be Morphic be pushed away and use only Spec? Or just
>> use Morphic for the very last item - Button and the rest with Spec?
>> Currently every Menu[Group|Item]Model has it's morphic counterpart, but I'm
>> not familiar with future of Morphic. Are we trying to get rid of it or just
>> use an abstraction on top of it (Spec)?
>>
>>
>> On Thu, Jul 17, 2014 at 6:47 PM, Benjamin <
>> benjamin.vanryseghem.pharo(a)gmail.com> wrote:
>>
>>> It is not yet supported, sorry :s
>>>
>>> Feel free to propose a solution to this :)
>>>
>>> Ben
>>>
>>> On 17 Jul 2014, at 18:24, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
>>>
>>> Is it possible to force MenuModel to display its groups (and group's
>>> items) vertically instead of horizontally? The use case is having button
>>> palette to click on. Both world menu and subMenu of MenuItemModel render it
>>> this way but it is all hidden in the depths of Morphic. Is there any way
>>> how to switch this behavior at Spec level? (Or should I make it from
>>> scratch?)
>>>
>>> Peter
>>>
>>>
>>>
>>
>>
>
>
July 17, 2014
Re: [Pharo-users] Adding method to class
by Hernán Morales Durand
Yes you need it because when doing code generation you cannot always assume
target class is present. Besides using RB you can confirm through the
NautilusRefactoring which is useful for massive changes:
| model |
model := RBNamespace new.
(model classNamed: #Model)
compile: 'asString ^ String empty'
classified: #(accessing).
(ChangesBrowser changes: model changes changes) openWithSpec
Cheers,
Hernán
2014-07-17 13:55 GMT-03:00 Esteban Lorenzano <estebanlm(a)gmail.com>:
> Hi,
>
> you do not need the RBNamespace mediation, just do:
>
> Model compile: âmethod ...â classified: âaccessingâ.
>
> Esteban
>
> On 17 Jul 2014, at 18:52, Mark Rizun <mrizun(a)gmail.com> wrote:
>
> Thanks Hernan
> 17 лип. 2014 18:29, коÑиÑÑÑÐ²Ð°Ñ "Hernán Morales Durand" <
> hernan.morales(a)gmail.com> напиÑав:
>
>> No. Adding a method is not a refactoring. You should use
>> RBAddMethodChange:
>>
>> | model |
>> model := RBNamespace new.
>> (model classNamed: #Model)
>> compile: 'asString ^ String empty'
>> classified: #(accessing).
>> model changes execute.
>>
>> and the new method is recorded in the .changes file
>>
>> Cheers,
>>
>> Hernán
>>
>>
>>
>> 2014-07-17 11:08 GMT-03:00 Mark Rizun <mrizun(a)gmail.com>:
>>
>>> Thank you all. Problem is solved, I just used RBAddMethodRefactoring.
>>>
>>> Mark
>>>
>>>
>>> 2014-07-17 16:07 GMT+02:00 Baptiste Quide <baptiste.quide(a)inria.fr>:
>>>
>>> I think you have to add a "RGMethodDefinition" or a "CompiledMethod".
>>>> Obviously in a class methodDict the values are CompiledMethod.
>>>>
>>>> Regards,
>>>>
>>>> ------------------------------
>>>>
>>>> *De: *"Sebastian Tleye" <stleye(a)gmail.com>
>>>> *Ã: *"Any question about pharo is welcome" <pharo-users(a)lists.pharo.org
>>>> >
>>>> *Envoyé: *Jeudi 17 Juillet 2014 16:03:52
>>>> *Objet: *Re: [Pharo-users] Adding method to class
>>>>
>>>>
>>>> I don't know what RBMethod is, but you can do
>>>>
>>>> aClass compile: source.
>>>>
>>>> For example:
>>>>
>>>> Array compile: 'newMethod ^ 1'
>>>>
>>>> I don't know if it answers your question.
>>>>
>>>> Regards
>>>>
>>>>
>>>>
>>>>
>>>> 2014-07-17 15:57 GMT+02:00 Mark Rizun <mrizun(a)gmail.com>:
>>>>
>>>>> P.S. obviously, my method is added to newMethods var, but it is not
>>>>> disblayed in my class.
>>>>>
>>>>>
>>>>> 2014-07-17 15:53 GMT+02:00 Mark Rizun <mrizun(a)gmail.com>:
>>>>>
>>>>> Hi guys!
>>>>>>
>>>>>> How can I add method (I have /RBMethod/) to a class in code?
>>>>>> I'm asking because existing method /addMethod:/ in /RBAbstractClass/
>>>>>> isn't
>>>>>> working.
>>>>>> Here is a piece of my code:
>>>>>>
>>>>>> /method:= RBMethod for: class source: ('^ ', newName asString)
>>>>>> selector:
>>>>>> newName asSymbol.
>>>>>> class addMethod: getter./
>>>>>>
>>>>>> Best
>>>>>> Mark
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://forum.world.st/Adding-method-to-class-tp4768282.html
>>>>>> Sent from the Pharo Smalltalk Users mailing list archive at
>>>>>> Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>
July 17, 2014
Re: [Pharo-users] Spec - vertically stacked Menu(Group)Model
by Esteban Lorenzano
On 17 Jul 2014, at 19:10, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
> But in general, is Morphic planned to be discontinued (fully replaced with Athens?) or just live as the bottom layer?
No.
Athens is not a replacement for Morphic, but to the drawing canvas that Morphic (or any graphical object) uses.
So, it is in a lower level than Morphic.
Esteban
>
>
> On Thu, Jul 17, 2014 at 7:06 PM, Benjamin <benjamin.vanryseghem.pharo(a)gmail.com> wrote:
> If you can add some Spec behaviour to match the morphic one, then itâs ok :)
>
> Ben
>
> On 17 Jul 2014, at 19:03, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
>
>> Well, is this something that should be done on top of the existing solution, or should be Morphic be pushed away and use only Spec? Or just use Morphic for the very last item - Button and the rest with Spec? Currently every Menu[Group|Item]Model has it's morphic counterpart, but I'm not familiar with future of Morphic. Are we trying to get rid of it or just use an abstraction on top of it (Spec)?
>>
>>
>> On Thu, Jul 17, 2014 at 6:47 PM, Benjamin <benjamin.vanryseghem.pharo(a)gmail.com> wrote:
>> It is not yet supported, sorry :s
>>
>> Feel free to propose a solution to this :)
>>
>> Ben
>>
>> On 17 Jul 2014, at 18:24, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
>>
>>> Is it possible to force MenuModel to display its groups (and group's items) vertically instead of horizontally? The use case is having button palette to click on. Both world menu and subMenu of MenuItemModel render it this way but it is all hidden in the depths of Morphic. Is there any way how to switch this behavior at Spec level? (Or should I make it from scratch?)
>>>
>>> Peter
>>
>>
>
>
July 17, 2014