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 2013
- 77 participants
- 802 messages
Re: [Pharo-users] Spec - Grid/Table Layout
by Clément Bera
Ben answered in another thread:
*About table, I have an example which will be running soon in Pharo (the
changes are waiting to be integrated)*
*tree := TreeModel new.*
*tree openWithSpec.*
*tree columns: (Array *
* with: (TreeColumnModel new displayBlock: [:node | node content first
asString ]; headerLabel: 'Name'; yourself)*
* with: (TreeColumnModel new displayBlock: [:node | node content second
asString ]; headerLabel: 'Last Name'; yourself)*
* with: (TreeColumnModel new displayBlock: [:node | node content third
asString ]; headerLabel: 'Age'; yourself)*
* with: (TreeColumnModel new displayBlock: [:node | node content fourth
asString ]; headerLabel: 'Gender'; yourself)).*
*tree roots: {*
* {'Benjamin'.'Van Ryseghem'.'26'.'M'}.*
* {'Pamela'.'Anderson'.'Far too much'.'F'}*
*}*
*Right now, you can get the same by*
* - adding MorphTreeAdapter>>#columns:*
* columns: columns *
* self widgetDo: [ :w | *
* w columns: columns. *
* w resizerChanged. *
* w updateList ]*
*And then evaluating:*
*tree := TreeModel new.*
*tree openWithSpec.*
*tree columns: (Array *
* with: (MorphTreeColumn new rowMorphGetSelector: [:node | node item first
asString asMorph ]; headerButtonLabel: 'Name' font: nil; yourself)*
* with: (MorphTreeColumn new rowMorphGetSelector: [:node | node item second
asString asMorph ]; headerButtonLabel: 'Last Name' font: nil; yourself)*
* with: (MorphTreeColumn new rowMorphGetSelector: [:node | node item third
asString asMorph ]; headerButtonLabel: 'Age' font: nil; yourself)*
* with: (MorphTreeColumn new rowMorphGetSelector: [:node | node item fourth
asString asMorph ]; headerButtonLabel: 'Gender' font: nil; yourself)).*
*tree roots: {*
* {'Benjamin'.'Van Ryseghem'.'26'.'M'}.*
* {'Pamela'.'Anderson'.'Far too much'.'F'}*
*}*
*Ben*
Ben, in each cell, can we put something else than a String ? If so, can you
add an example in the code above ? Thanks.
I guess doing Ben's solution is the best. I did it with nested layout but
it is definitely not as good (see file in attachment, add it in your image
then evaluate SpecTable new).
2013/11/8 prova email <prova213(a)hotmail.it>
> Hi Clement;
>
> I did the Spec tuto made by Bahman (great tuto). As him, i'd like to put
> some widgets into it. Is it possible? Maybe with the method "items:"? I
> don't know if the solution that Ben give to us (use Morphic instead of
> Spec) is suitable, that's because his UI looks like a list that accept only
> string. Maybe i'm wrong, can you give us more explanations? Or is it
> something new for you too?
>
> Thanks for your help!
> Paolo
>
> ------------------------------
> From: bera.clement(a)gmail.com
> Date: Thu, 7 Nov 2013 10:04:51 +0100
> To: Bahman(a)bahmanm.com; pharo-users(a)lists.pharo.org
> Subject: Re: [Pharo-users] Spec - Grid/Table Layout
>
>
> Hello,
>
> Actually I had the same problem, I think the best widget that exists for
> that right now is MultiColumnListModel.
>
> For example, in the senders window (in attachment), the top panel is a
> MultiColumnListModel. You can have as many lines and as many columns as you
> want.
>
> We do not have yet a tableLayout, but we miss it. If you plan to implement
> it, we will be interested in integrating it into Pharo.
>
> Ben can advise you on how to implement that.
>
> [image: Images intégrées 1]
>
>
> 2013/11/7 Bahman Movaqar <Bahman(a)bahmanm.com>
>
> Hi all,
>
> Is there a grid/table layout available in Spec? Something like an HTML
> table or Swing's GridLayout? If not, how may I achieve such a
> functionality?
>
> I'd appreciate any hints/pointers.
>
> --
> Bahman Movaqar (http://BahmanM.com)
>
> ERP Evaluation, Implementation & Deployment Consultant
> PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)
>
>
>
>
Nov. 8, 2013
Re: [Pharo-users] Spec - Grid/Table Layout
by Benjamin
In the example I gave with TreeColumn/MorphTreeColumn the block used to render the item
can return anything understanding #asMorph.
So you can easily return any Morph you like there :)
Ben
On 08 Nov 2013, at 12:18, prova email <prova213(a)hotmail.it> wrote:
> Hi Clement;
>
> I did the Spec tuto made by Bahman (great tuto). As him, i'd like to put some widgets into it. Is it possible? Maybe with the method "items:"? I don't know if the solution that Ben give to us (use Morphic instead of Spec) is suitable, that's because his UI looks like a list that accept only string. Maybe i'm wrong, can you give us more explanations? Or is it something new for you too?
>
> Thanks for your help!
> Paolo
>
> From: bera.clement(a)gmail.com
> Date: Thu, 7 Nov 2013 10:04:51 +0100
> To: Bahman(a)bahmanm.com; pharo-users(a)lists.pharo.org
> Subject: Re: [Pharo-users] Spec - Grid/Table Layout
>
> Hello,
>
> Actually I had the same problem, I think the best widget that exists for that right now is MultiColumnListModel.
>
> For example, in the senders window (in attachment), the top panel is a MultiColumnListModel. You can have as many lines and as many columns as you want.
>
> We do not have yet a tableLayout, but we miss it. If you plan to implement it, we will be interested in integrating it into Pharo.
>
> Ben can advise you on how to implement that.
>
> <Screen Shot 2013-11-07 at 10.00.55 AM.png>
>
>
> 2013/11/7 Bahman Movaqar <Bahman(a)bahmanm.com>
> Hi all,
>
> Is there a grid/table layout available in Spec? Something like an HTML
> table or Swing's GridLayout? If not, how may I achieve such a
> functionality?
>
> I'd appreciate any hints/pointers.
>
> --
> Bahman Movaqar (http://BahmanM.com)
>
> ERP Evaluation, Implementation & Deployment Consultant
> PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)
Nov. 8, 2013
Re: [Pharo-users] Spec - Grid/Table Layout
by prova email
Hi Clement;
I did the Spec tuto made by Bahman (great tuto). As him, i'd like to put some widgets into it. Is it possible? Maybe with the method "items:"? I don't know if the solution that Ben give to us (use Morphic instead of Spec) is suitable, that's because his UI looks like a list that accept only string. Maybe i'm wrong, can you give us more explanations? Or is it something new for you too?
Thanks for your help!Paolo
From: bera.clement(a)gmail.com
Date: Thu, 7 Nov 2013 10:04:51 +0100
To: Bahman(a)bahmanm.com; pharo-users(a)lists.pharo.org
Subject: Re: [Pharo-users] Spec - Grid/Table Layout
Hello,
Actually I had the same problem, I think the best widget that exists for that right now is MultiColumnListModel.
For example, in the senders window (in attachment), the top panel is a MultiColumnListModel. You can have as many lines and as many columns as you want.
We do not have yet a tableLayout, but we miss it. If you plan to implement it, we will be interested in integrating it into Pharo.
Ben can advise you on how to implement that.
2013/11/7 Bahman Movaqar <Bahman(a)bahmanm.com>
Hi all,
Is there a grid/table layout available in Spec? Something like an HTML
table or Swing's GridLayout? If not, how may I achieve such a
functionality?
I'd appreciate any hints/pointers.
--
Bahman Movaqar (http://BahmanM.com)
ERP Evaluation, Implementation & Deployment Consultant
PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)
Nov. 8, 2013
Re: [Pharo-users] Pharo 3.0.0.dmg for Mac OSX - problem loading on OS 10.9
by Yuriy Tymchuk
Just downloaded last build. Works for me. (Iâm on Mavericks of course)
On 08 Nov 2013, at 11:38, Damien Cassou <damien.cassou(a)gmail.com> wrote:
>
> On Thu, Nov 7, 2013 at 8:10 PM, Bruce Prior <b.prior(a)ieee.org> wrote:
> I tried CTRL-click to open Pharo.app. I still get the above result.
>
> I haven't fixed this issue yet. But I don't know why others workaround don't work for you. And I can't help you because I don't have Mavericks, sorry.
>
>
> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Success is the ability to go from one failure to another without losing enthusiasm."
> Winston Churchill
Nov. 8, 2013
Re: [Pharo-users] Pharo 3.0.0.dmg for Mac OSX - problem loading on OS 10.9
by Damien Cassou
On Thu, Nov 7, 2013 at 8:10 PM, Bruce Prior <b.prior(a)ieee.org> wrote:
> I tried CTRL-click to open Pharo.app. I still get the above result.
I haven't fixed this issue yet. But I don't know why others workaround
don't work for you. And I can't help you because I don't have Mavericks,
sorry.
--
Damien Cassou
http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing
enthusiasm."
Winston Churchill
Nov. 8, 2013
Re: [Pharo-users] Spec - Nested Layouts
by Benjamin
I have two arguments:
- there are multiple arguments for TreeColumn and writing down all the combination will result in a lot of method, uselessly polluting the API
- you lose the ability to modify the column on the fly since you do not have a pointer to it.
But anyway, I think I will introduce a TableModel, because even if you can tweak a TreeModel to act as a Table
it is not obvious, and not really expected from a Tree :)
Ben
On 08 Nov 2013, at 00:06, btc(a)openinworld.com wrote:
> Don;t have time to try it till later today, but first thoughts...
>
> What do you think about usage something like...
>
> tree header:
> {'Name' . 'Last Name' . 'Age' . 'Gender' };
> roots: {
> {'Benjamin'.'Van Ryseghem'.'26'.'M'}.
> {'Pamela'.'Anderson'.'Far too much'.'F'}
> };
> displaySymbolOrBlocks: { #asString . #asString . [:node|node asString] . [:node|node asString asUpperCase ] }.
>
> Or...
>
> tree columns: { 'Name' -> #asString. 'Last Name' -> #asString.
> 'Age' -> [:node|node asString].
> 'Gender' -> [:node|ndoe asString asUpperCase ]
> };
> roots: {
> {'Benjamin'.'Van Ryseghem'.'26'.'M'}.
> {'Pamela'.'Anderson'.'Far too much'.'F'}
> }.
>
>
> Ah, the danger of contrived example. So actually now I think on it, that is not so flexible as your example. Maybe then just hiding TreeColumnModel using...
>
> tree
> withColumn: 'Name' display: [:node | node content first asString ];
> withColumn: 'LastName' display: [:node | node content second asString ];
> withColumn: 'Age' display: #third; "is there a use case that would not always use 'node content' ? Presumes a string"
> withColumn: 'Gender' displayAsString: #fourth. "does not presume a string. Sends asString for you"
>
> cheers -ben
>
>
> Benjamin wrote:
>> About table, I have an example which will be running soon in Pharo (the changes are waiting to be integrated)
>>
>> tree := TreeModel new.
>> tree openWithSpec.
>>
>> tree columns: (Array with: (TreeColumnModel new displayBlock: [:node | node content first asString ]; headerLabel: 'Name'; yourself)
>> with: (TreeColumnModel new displayBlock: [:node | node content second asString ]; headerLabel: 'Last Name'; yourself)
>> with: (TreeColumnModel new displayBlock: [:node | node content third asString ]; headerLabel: 'Age'; yourself)
>> with: (TreeColumnModel new displayBlock: [:node | node content fourth asString ]; headerLabel: 'Gender'; yourself)).
>> tree roots: {
>> {'Benjamin'.'Van Ryseghem'.'26'.'M'}.
>> {'Pamela'.'Anderson'.'Far too much'.'F'}
>> }
>>
>> Will produce
>>
>>
>> Right now, you can get the same by
>> - adding MorphTreeAdapter>>#columns:
>> columns: columns self widgetDo: [ :w | w columns: columns. w resizerChanged. w updateList ]
>>
>> And then evaluating:
>>
>> tree := TreeModel new.
>> tree openWithSpec.
>>
>> tree columns: (Array with: (MorphTreeColumn new rowMorphGetSelector: [:node | node item first asString asMorph ]; headerButtonLabel: 'Name' font: nil; yourself)
>> with: (MorphTreeColumn new rowMorphGetSelector: [:node | node item second asString asMorph ]; headerButtonLabel: 'Last Name' font: nil; yourself)
>> with: (MorphTreeColumn new rowMorphGetSelector: [:node | node item third asString asMorph ]; headerButtonLabel: 'Age' font: nil; yourself)
>> with: (MorphTreeColumn new rowMorphGetSelector: [:node | node item fourth asString asMorph ]; headerButtonLabel: 'Gender' font: nil; yourself)).
>> tree roots: {
>> {'Benjamin'.'Van Ryseghem'.'26'.'M'}.
>> {'Pamela'.'Anderson'.'Far too much'.'F'}
>> }
>>
>> Ben
>>
>> On 07 Nov 2013, at 15:54, Clément Bera <bera.clement(a)gmail.com <mailto:bera.clement@gmail.com>> wrote:
>>
>> >
>> > 2013/11/7 Benjamin <Benjamin.VanRyseghem.Pharo(a)gmail.com > <mailto:Benjamin.VanRyseghem.Pharo@gmail.com>>
>> >
>> > Just a general remark: you should try as much as possible to avoid hard
>> > coding width/height :)
>> >
>> > there are some methods on ComposableModel you could use like buttonHeight
>> > toolbarHeight etc. that you should use instead :)
>> >
>> >
>> > Ben
>> >
>> > On 07 Nov 2013, at 13:22, Bahman Movaqar <Bahman(a)BahmanM.com
>> > <mailto:Bahman@BahmanM.com>> wrote:
>> >
>> >> On 11/07/2013 12:45, Clément Bera wrote:
>> >>> Hey,
>> >>>
>> >>> I don't know what you want exactly.
>> >>>
>> >>> You can do:
>> >>>
>> >>> spec
>> >>> <spec>
>> >>> ^ SpecLayout composed
>> >>> newRow: [:row | >>> row >>> newColumn: [ :col |
>> >>> col
>> >>> add: #list width: 135;
>> >>> add: #description ] ];
>> >>> yourself
>> >>>
>> >>> and nest that as many times as you want (but I don't know if this was
>> >>> your question).
>> >>
>> >> I just tried this one and it works (see the code below) BUT, the code is
>> >> so hard to read and understand just for 3 rows and 7 widgets!
>> >>
>> >> <code>
>> >> defaultSpec
>> >> ^ SpecLayout composed
>> >> newColumn: [ :mainColumn |
>> >> mainColumn
>> >> newRow: [ :nameRow |
>> >> nameRow
>> >> add: #labelName;
>> >> add: #textName ]
>> >> height: 25.
>> >> mainColumn
>> >> newRow: [ :titleRow |
>> >> titleRow
>> >> add: #labelTitle;
>> >> newRow: [ :titleRadioRow |
>> >> titleRadioRow
>> >> add: #radioMr;
>> >> add: #radioMrs;
>> >> add: #radioMs ] ]
>> >> height: 25.
>> >> mainColumn newRow: [ :buttonRow | buttonRow add:
>> >> #buttonGreet ] height: 25 ];
>> >> yourself
>> >> </code>
>> >>
>> >> Am I doing it right? >
>> > I guess this is right. But I think you need to generate this layout out of > collections, not to write it. >
>> >>
>> >>>
>> >>> Another feature is:
>> >>>
>> >>> debuggerSpec
>> >>> <spec: #default>
>> >>> ^ SpecLayout composed
>> >>> add: #inspector withSpec: #debuggerSpec; >>> yourself
>> >>>
>> >>> #inspector being the instance variable name that holds a subclass of
>> >>> ComposableModel that defines class side #debuggerSpec, which answers a
>> >>> SpecLayout.
>> >>>
>> >>
>> >> Does this mean that for every table cell I have to create a new class?
>> >
>> > Yeah well I was just pointing out all the choices you had. Depending on what > you want to do you could have a class hierarchy similar to this:
>> >
>> > SpecTable
>> > AbstractSpecColumn
>> > SpecColumnA
>> > SpecColumnB
>> > AbstractSpecCell
>> > SpecCellA
>> > SpecCellB
>> > > SpecTable having column, column having cells.
>> > But this may not be the best choice.
>> >
>> > Now that you caught my interest, I tried to do a table. I put it in attachment > the result. It is a .st file, so drag and drop it in your image, then click > file in entire file. Then try to run 'SpecTable new', it opens a table with 3 > columns and 5 rows, with no complex layout method. All the code is in > SpecTable (Cmd+f,Cmd+c to find a class in nautilus or write the class name in > workspace then select it and press Cmd+m), in the method protocol table logic. > It's like 6 methods.
>> >
>> > However: > - vertical splitters are not sync.
>> > - I don't know how to color the border of each cell to make it beautiful.
>> >
>> > Of course you need to polish it ...
>> >
>> > I hope it helped you :)
>> >
>> >>
>> >>> Not sure if this helped.
>> >>>
>> >>> All of these questions are for your tutorials ?
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> 2013/11/7 Bahman Movaqar <Bahman(a)bahmanm.com <mailto:Bahman@bahmanm.com>>
>> >>>
>> >>> Hi all,
>> >>>
>> >>> Is it possible to nest layouts in Spec? For example can I combine
>> >>> `SpecColumnLayout` and `SpecRowLayout` together?
>> >>>
>> >>>
>> >>> -- >>> Bahman Movaqar (http://BahmanM.com <http://bahmanm.com/>)
>> >>>
>> >>> ERP Evaluation, Implementation & Deployment Consultant
>> >>> PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com <http://keyserver2.pgp.com/>)
>> >>> -- >>> Bahman Movaqar (http://BahmanM.com <http://bahmanm.com/>)
>> >>>
>> >>> ERP Evaluation, Implementation & Deployment Consultant
>> >>> PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com <http://keyserver2.pgp.com/>)
>> >
>> >
>> > <SpecTable.st>
>>
>>
>
>
>
Nov. 8, 2013
Re: [Pharo-users] Why won't my Pharo download run?
by PBK Research
Well, it does run on my second (and even older) machine with an Intel
Celeron processor. I have in store a very old download of Pharo (version
1.1, dated July 2010), which I have loaded and run successfully on the
troublesome machine. I shall probably have to give up on this machine and
switch to my reserve, unless anyone has a brilliant idea to fix it. Thanks
for the help.
_____
From: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf Of
Igor Stasenko
Sent: 07 November 2013 22:49
To: Any question about pharo is welcome
Subject: Re: [Pharo-users] Why won't my Pharo download run?
Well, it could be that your machine CPU too old and don't supports
instructions (like SSE)
which VM compiled with.
On 7 November 2013 19:44, PBK Research <peter(a)pbkresearch.co.uk> wrote:
Just a little more information. Out of curiosity, I downloaded Pharo 3.0 and
tried it, with the same result - message from Windows says 'Pharo.exe has
encountered a problem and needs to close'. To complete the set, I downloaded
Pharo 1.4 and tried it. This time it failed saying 'CogVM.exe has
encoun....'. I presume all versions now use the Cog VM, and it looks as
though this machine just won't run it. Is there still a 'traditional' VM I
can use instead of Cog? It might not be practical, but it would at least
prove that it is a VM problem. Is there any information about Cog giving
problems with AMD processors?
_____
From: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf Of
PBK Research
Sent: 07 November 2013 15:07
To: 'Any question about pharo is welcome'
Subject: Re: [Pharo-users] Why won't my Pharo download run?
OK. I opened a command line prompt, cd to Pharo 2.0 directory (created in
today's download), enter 'pharo.exe pharo2.0.image'. Same result - immediate
failure. I had previously changed the association of the image file to the
newly downloaded pharo.exe. So I think I must be using the VM in today's
download.
_____
From: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf Of
Igor Stasenko
Sent: 07 November 2013 14:48
To: Any question about pharo is welcome
Subject: Re: [Pharo-users] Why won't my Pharo download run?
On 7 November 2013 15:31, PBK Research <peter(a)pbkresearch.co.uk> wrote:
Thanks. I am using the latest one-click distribution of Pharo, downloaded
today from the Pharo website. Presumably that should have the latest VM?
yes, but if .image file extension associated with wrong version of VM
binary, which you installed previously (as you mentioned), it won't
automagically use proper one.
unless you run vm from command line e.g.:
pharo.exe myimage.image
or change the association to use different vm.
_____
From: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf Of
Igor Stasenko
Sent: 07 November 2013 13:53
To: Any question about pharo is welcome
Subject: Re: [Pharo-users] Why won't my Pharo download run?
On 7 November 2013 14:18, PBK Research <peter(a)pbkresearch.co.uk> wrote:
Hello!
I have a problem with running Pharo 2.0 on one of my machines. I have two
machines, both running Windows XP with SP3. On one of them I have a
successful load of Pharo (actually it's a distribution of the Moose system,
but that is just an application built on Pharo 2.0). This loads successfully
when I double click on pharo.exe. On the other machine, the same action
produces an immediate message: 'Pharo.exe has encountered a problem and
needs to close'. Just in case this was some problem with Moose, I have just
downloaded the latest one-click installation of Pharo 2.0 for Windows. This
displays exactly the same behaviour - an immediate fail when I try to start
it.
I have tried to work out what may be different between the two machines. The
one which will run Pharo has an Intel Celeron processor, the other an AMD
Athlon XP (yes, they are both pretty ancient!), but I can't see why that
should make any difference. The one curious thing is that Windows Explorer
displays the type of the Pharo2.0.image file as 'Squeak image file'. There
is an old version of Squeak installed on that machine; could that have any
effect?
I am a bit flummoxed by all this. Does anyone have any suggestions about how
to diagnose the problem?
If you using too old VM , it simply does not supports an image format, which
pharo 2.0 uses.
But there could be different reasons.. a first step towards to solution is
to use VM for pharo, which we maintain and use..
Many thanks
Peter Kenny
--
Best regards,
Igor Stasenko.
--
Best regards,
Igor Stasenko.
--
Best regards,
Igor Stasenko.
Nov. 7, 2013
Re: [Pharo-users] Spec - Nested Layouts
by btc@openinworld.com
Don;t have time to try it till later today, but first thoughts...
What do you think about usage something like...
tree
header:
{'Name' . 'Last Name' . 'Age' . 'Gender' };
roots:
{
{'Benjamin'.'Van Ryseghem'.'26'.'M'}.
{'Pamela'.'Anderson'.'Far too much'.'F'}
};
displaySymbolOrBlocks:
{ #asString . #asString . [:node|node asString] . [:node|node asString asUpperCase ] }.
Or...
tree
columns:
{ 'Name' -> #asString.
'Last Name' -> #asString.
'Age' -> [:node|node asString].
'Gender' -> [:node|ndoe asString asUpperCase ]
};
roots:
{
{'Benjamin'.'Van Ryseghem'.'26'.'M'}.
{'Pamela'.'Anderson'.'Far too much'.'F'}
}.
Ah, the danger of contrived example. So actually now I think on it,
that is not so flexible as your example. Maybe then just hiding
TreeColumnModel using...
tree
withColumn: 'Name' display: [:node | node content first asString ];
withColumn: 'LastName' display: [:node | node content second
asString ];
withColumn: 'Age' display: #third; "is there a use case that would
not always use 'node content' ? Presumes a string"
withColumn: 'Gender' displayAsString: #fourth. "does not presume a
string. Sends asString for you"
cheers -ben
Benjamin wrote:
> About table, I have an example which will be running soon in Pharo (the changes
> are waiting to be integrated)
>
> tree := TreeModel new.
> tree openWithSpec.
>
> tree columns: (Array
> with: (TreeColumnModel new displayBlock: [:node | node content first asString ];
> headerLabel: 'Name'; yourself)
> with: (TreeColumnModel new displayBlock: [:node | node content second asString
> ]; headerLabel: 'Last Name'; yourself)
> with: (TreeColumnModel new displayBlock: [:node | node content third asString ];
> headerLabel: 'Age'; yourself)
> with: (TreeColumnModel new displayBlock: [:node | node content fourth asString
> ]; headerLabel: 'Gender'; yourself)).
> tree roots: {
> {'Benjamin'.'Van Ryseghem'.'26'.'M'}.
> {'Pamela'.'Anderson'.'Far too much'.'F'}
> }
>
> Will produce
>
>
> Right now, you can get the same by
> - adding MorphTreeAdapter>>#columns:
> columns: columns
> self widgetDo: [ :w |
> w columns: columns.
> w resizerChanged.
> w updateList ]
>
> And then evaluating:
>
> tree := TreeModel new.
> tree openWithSpec.
>
> tree columns: (Array
> with: (MorphTreeColumn new rowMorphGetSelector: [:node | node item first
> asString asMorph ]; headerButtonLabel: 'Name' font: nil; yourself)
> with: (MorphTreeColumn new rowMorphGetSelector: [:node | node item second
> asString asMorph ]; headerButtonLabel: 'Last Name' font: nil; yourself)
> with: (MorphTreeColumn new rowMorphGetSelector: [:node | node item third
> asString asMorph ]; headerButtonLabel: 'Age' font: nil; yourself)
> with: (MorphTreeColumn new rowMorphGetSelector: [:node | node item fourth
> asString asMorph ]; headerButtonLabel: 'Gender' font: nil; yourself)).
> tree roots: {
> {'Benjamin'.'Van Ryseghem'.'26'.'M'}.
> {'Pamela'.'Anderson'.'Far too much'.'F'}
> }
>
> Ben
>
> On 07 Nov 2013, at 15:54, Clément Bera <bera.clement(a)gmail.com
> <mailto:bera.clement@gmail.com>> wrote:
>
> >
> > 2013/11/7 Benjamin <Benjamin.VanRyseghem.Pharo(a)gmail.com
> > <mailto:Benjamin.VanRyseghem.Pharo@gmail.com>>
> >
> > Just a general remark: you should try as much as possible to avoid hard
> > coding width/height :)
> >
> > there are some methods on ComposableModel you could use like buttonHeight
> > toolbarHeight etc. that you should use instead :)
> >
> >
> > Ben
> >
> > On 07 Nov 2013, at 13:22, Bahman Movaqar <Bahman(a)BahmanM.com
> > <mailto:Bahman@BahmanM.com>> wrote:
> >
> >> On 11/07/2013 12:45, Clément Bera wrote:
> >>> Hey,
> >>>
> >>> I don't know what you want exactly.
> >>>
> >>> You can do:
> >>>
> >>> spec
> >>> <spec>
> >>> ^ SpecLayout composed
> >>> newRow: [:row |
> >>> row
> >>> newColumn: [ :col |
> >>> col
> >>> add: #list width: 135;
> >>> add: #description ] ];
> >>> yourself
> >>>
> >>> and nest that as many times as you want (but I don't know if this was
> >>> your question).
> >>
> >> I just tried this one and it works (see the code below) BUT, the code is
> >> so hard to read and understand just for 3 rows and 7 widgets!
> >>
> >> <code>
> >> defaultSpec
> >> ^ SpecLayout composed
> >> newColumn: [ :mainColumn |
> >> mainColumn
> >> newRow: [ :nameRow |
> >> nameRow
> >> add: #labelName;
> >> add: #textName ]
> >> height: 25.
> >> mainColumn
> >> newRow: [ :titleRow |
> >> titleRow
> >> add: #labelTitle;
> >> newRow: [ :titleRadioRow |
> >> titleRadioRow
> >> add: #radioMr;
> >> add: #radioMrs;
> >> add: #radioMs ] ]
> >> height: 25.
> >> mainColumn newRow: [ :buttonRow | buttonRow add:
> >> #buttonGreet ] height: 25 ];
> >> yourself
> >> </code>
> >>
> >> Am I doing it right?
> >
> > I guess this is right. But I think you need to generate this layout out of
> > collections, not to write it.
> >
> >>
> >>>
> >>> Another feature is:
> >>>
> >>> debuggerSpec
> >>> <spec: #default>
> >>> ^ SpecLayout composed
> >>> add: #inspector withSpec: #debuggerSpec;
> >>> yourself
> >>>
> >>> #inspector being the instance variable name that holds a subclass of
> >>> ComposableModel that defines class side #debuggerSpec, which answers a
> >>> SpecLayout.
> >>>
> >>
> >> Does this mean that for every table cell I have to create a new class?
> >
> > Yeah well I was just pointing out all the choices you had. Depending on what
> > you want to do you could have a class hierarchy similar to this:
> >
> > SpecTable
> > AbstractSpecColumn
> > SpecColumnA
> > SpecColumnB
> > AbstractSpecCell
> > SpecCellA
> > SpecCellB
> >
> > SpecTable having column, column having cells.
> > But this may not be the best choice.
> >
> > Now that you caught my interest, I tried to do a table. I put it in attachment
> > the result. It is a .st file, so drag and drop it in your image, then click
> > file in entire file. Then try to run 'SpecTable new', it opens a table with 3
> > columns and 5 rows, with no complex layout method. All the code is in
> > SpecTable (Cmd+f,Cmd+c to find a class in nautilus or write the class name in
> > workspace then select it and press Cmd+m), in the method protocol table logic.
> > It's like 6 methods.
> >
> > However:
> > - vertical splitters are not sync.
> > - I don't know how to color the border of each cell to make it beautiful.
> >
> > Of course you need to polish it ...
> >
> > I hope it helped you :)
> >
> >>
> >>> Not sure if this helped.
> >>>
> >>> All of these questions are for your tutorials ?
> >>>
> >>>
> >>>
> >>>
> >>> 2013/11/7 Bahman Movaqar <Bahman(a)bahmanm.com <mailto:Bahman@bahmanm.com>>
> >>>
> >>> Hi all,
> >>>
> >>> Is it possible to nest layouts in Spec? For example can I combine
> >>> `SpecColumnLayout` and `SpecRowLayout` together?
> >>>
> >>>
> >>> --
> >>> Bahman Movaqar (http://BahmanM.com <http://bahmanm.com/>)
> >>>
> >>> ERP Evaluation, Implementation & Deployment Consultant
> >>> PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com <http://keyserver2.pgp.com/>)
> >>> --
> >>> Bahman Movaqar (http://BahmanM.com <http://bahmanm.com/>)
> >>>
> >>> ERP Evaluation, Implementation & Deployment Consultant
> >>> PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com <http://keyserver2.pgp.com/>)
> >
> >
> > <SpecTable.st>
>
>
Nov. 7, 2013
Re: [Pharo-users] Why won't my Pharo download run?
by Igor Stasenko
Well, it could be that your machine CPU too old and don't supports
instructions (like SSE)
which VM compiled with.
On 7 November 2013 19:44, PBK Research <peter(a)pbkresearch.co.uk> wrote:
> Just a little more information. Out of curiosity, I downloaded Pharo 3.0
> and tried it, with the same result - message from Windows says 'Pharo.exe
> has encountered a problem and needs to close'. To complete the set, I
> downloaded Pharo 1.4 and tried it. This time it failed saying 'CogVM.exe
> has encoun....'. I presume all versions now use the Cog VM, and it looks as
> though this machine just won't run it. Is there still a 'traditional' VM I
> can use instead of Cog? It might not be practical, but it would at least
> prove that it is a VM problem. Is there any information about Cog giving
> problems with AMD processors?
>
> ------------------------------
> *From:* Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] *On
> Behalf Of *PBK Research
> *Sent:* 07 November 2013 15:07
>
> *To:* 'Any question about pharo is welcome'
> *Subject:* Re: [Pharo-users] Why won't my Pharo download run?
>
> OK. I opened a command line prompt, cd to Pharo 2.0 directory (created
> in today's download), enter 'pharo.exe pharo2.0.image'. Same result -
> immediate failure. I had previously changed the association of the image
> file to the newly downloaded pharo.exe. So I think I must be using the VM
> in today's download.
>
> ------------------------------
> *From:* Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] *On
> Behalf Of *Igor Stasenko
> *Sent:* 07 November 2013 14:48
> *To:* Any question about pharo is welcome
> *Subject:* Re: [Pharo-users] Why won't my Pharo download run?
>
>
>
>
> On 7 November 2013 15:31, PBK Research <peter(a)pbkresearch.co.uk> wrote:
>
>> Thanks. I am using the latest one-click distribution of Pharo,
>> downloaded today from the Pharo website. Presumably that should have the
>> latest VM?
>>
>> yes, but if .image file extension associated with wrong version of VM
> binary, which you installed previously (as you mentioned), it won't
> automagically use proper one.
> unless you run vm from command line e.g.:
> pharo.exe myimage.image
> or change the association to use different vm.
>
> ------------------------------
>> *From:* Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] *On
>> Behalf Of *Igor Stasenko
>> *Sent:* 07 November 2013 13:53
>> *To:* Any question about pharo is welcome
>> *Subject:* Re: [Pharo-users] Why won't my Pharo download run?
>>
>>
>>
>>
>> On 7 November 2013 14:18, PBK Research <peter(a)pbkresearch.co.uk> wrote:
>>
>>> Hello!
>>>
>>> I have a problem with running Pharo 2.0 on one of my machines. I have
>>> two machines, both running Windows XP with SP3. On one of them I have a
>>> successful load of Pharo (actually it's a distribution of the Moose system,
>>> but that is just an application built on Pharo 2.0). This loads
>>> successfully when I double click on pharo.exe. On the other machine, the
>>> same action produces an immediate message: 'Pharo.exe has encountered a
>>> problem and needs to close'. Just in case this was some problem with Moose,
>>> I have just downloaded the latest one-click installation of Pharo 2.0 for
>>> Windows. This displays exactly the same behaviour - an immediate fail when
>>> I try to start it.
>>>
>>> I have tried to work out what may be different between the two machines.
>>> The one which will run Pharo has an Intel Celeron processor, the other an
>>> AMD Athlon XP (yes, they are both pretty ancient!), but I can't see why
>>> that should make any difference. The one curious thing is that Windows
>>> Explorer displays the type of the Pharo2.0.image file as 'Squeak image
>>> file'. There is an old version of Squeak installed on that machine; could
>>> that have any effect?
>>>
>>> I am a bit flummoxed by all this. Does anyone have any suggestions about
>>> how to diagnose the problem?
>>>
>>>
>>
>> If you using too old VM , it simply does not supports an image format,
>> which pharo 2.0 uses.
>> But there could be different reasons.. a first step towards to solution
>> is to use VM for pharo, which we maintain and use..
>>
>>
>>
>>> Many thanks
>>>
>>> Peter Kenny
>>>
>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko.
>>
>
>
>
> --
> Best regards,
> Igor Stasenko.
>
--
Best regards,
Igor Stasenko.
Nov. 7, 2013
Re: [Pharo-users] Spec - Text alignment in LabelModel
by Ignacio MatÃas Sniechowski
Yes, it is.
Thanks anyway. I'm still trying to figure out this... ;)
nacho
*Lic. Ignacio Sniechowski, MBA*
On Thu, Nov 7, 2013 at 7:36 PM, Clément Bera <bera.clement(a)gmail.com> wrote:
> I checked it seems that TextAlignment is currently broken. Only other
> text attributes work. sorry.
>
>
> 2013/11/7 Clément Bera <bera.clement(a)gmail.com>
>
>> Hey,
>>
>> I'm not sure this is the good way to do it, but you can store in your
>> labelModel a Text instead of a String:
>>
>> myComposableModel label text: 'someString' asText.
>>
>> Then you can add attribute to the text:
>>
>> myComposableModel label text addAttribute: TextColor red.
>> myComposableModel label text addAttribute: TextAlignment rightFlush.
>>
>> Try first with TextColor red, because for TextAlignment rightFlush there
>> might be other reason it does not work
>> (i.e. the label model has the width of the text, so modifying the
>> alignment will not modify anything).
>>
>> Best,
>>
>>
>> 2013/11/7 nacho <0800nacho(a)gmail.com>
>>
>>> Hi,
>>> After spending almost two hours digging into Spec I couldn't figure out
>>> how
>>> to change the alignment of the text in LabelModel. As I'm building a
>>> simple
>>> calculator, the text has to be right-aligned. The default is
>>> left-alginement
>>> which makes the calculator display look weird.
>>> Any help would be much appreciated.
>>> best regards
>>> Nacho
>>>
>>>
>>>
>>>
>>>
>>> -----
>>> Nacho
>>> Smalltalker apprentice.
>>> Buenos Aires, Argentina.
>>> --
>>> View this message in context:
>>> http://forum.world.st/Spec-Text-alignment-in-LabelModel-tp4719750.html
>>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>>>
>>>
>>
>
Nov. 7, 2013