[Pharo-users] Spec Layout Help
Hello, How might one achieve a fixed width column containing fixed width widgets within a resizable row using Spec Layouts? For example: <--- Resizable Space --->| Fixed Width |<---Resizable Space ---> Where the Fixed Width space might have something like a left justified input field and a right justified button or something. The best I can achieve is everything resizable, which Spec excels at! I have tried adding three columns to the row with the center column a fixed width (newColumn:width:), but I can't seem to get it centered. I have even tried adding dummy widgets as in the code below, which creates a resizable column taking up the first half of the space, followed by a fixed width (100) input field, followed by another resizable space (sharing the right half of the column with the fixed width column): LayoutPractice>>defaultSpec ^ SpecColumnLayout composed newRow: [:row | row newColumn: [ :col | col add: #spacer1 height: 30 ]; newColumn: [ :col | col add: #inputField height: 30] width: 100; newColumn: [ :col | col add: #spacer2 height: 30 ]; yourself ] height: 50; newRow: [:row | row add: #list ]; yourself If this is not possible, could I allow the window to resize vertically but not horizontally (I have a ListPresenter below problematic row which would be nice to resize vertically)? Thank you, Rob
Re: [Pharo-users] [vwnc] Parsing in Smalltalk
Hi, Interesting experiment. Thanks for sharing! I assume that you tried the original PetitParser. PetitParser2 offers the possibility to optimize the parser (kind of a compilation), and this provides a significant speedup: https://github.com/kursjan/petitparser2 Would you be interested in trying this out? Cheers, Doru > On Oct 4, 2018, at 10:46 PM, Steffen Märcker wrote: > > I gave Xtreams-Parsing and PetitParser a shot and like to share my > findings.[*] > > The task was to parse the modelling language of the probabilistic model > checker PRISM. I've written a grammer of about 130 definitions in the Xtreams > DSL, which is close to Bryan Fords syntax. To avoid doing it all again with > PetitParser, I wrote a PetitParserGenerator that takes the DSL and builds a > PetitParser. > > The numbers below are just parsing times, no further actions involved. For > reference I show the times from PRISM (which uses JavaCC), too -- although > they involve additional verification and normalization steps on the AST. > > input PrismXP PP > 230kB14s9s 2s > 544kB 121s 20s 5s > 1.1MB 421s 34s 8s > 1.4MB 1091s 47s 12s > 2.2MB 63s 16s > 2.9MB 81s 20s > 3.8MB 107s 25s > 4.4MB 123s 30s > > Please note that these times are not representative at all. It's just a > single example and I put zero effort in optimization. However, I am quite > satisfied with the results. > > [*] I was already familiar with the DSL of Xtreams-Parsing, which I like very > much. I did not consider SmaCC, as I find PEGs easier to use. > > Best, Steffen > > > > Am .10.2018, 20:14 Uhr, schrieb Steffen Märcker : > >> Dear all, >> >> I have two questions regarding parsing frameworks. >> >> 1) Do you have any insights on the performance of SmaCC VS Xtreams Parsing >> VS PetitParser? >> 2) Has anybody started to port PetitParser 2 from Pharo to VW? Is it worth >> the effort? >> >> Sorry for cross-posting, I thought this might interest both communities. >> >> Cheers, Steffen -- www.feenk.com "No matter how many recipes we know, we still value a chef."
Re: [Pharo-users] [vwnc] Parsing in Smalltalk
Am .10.2018, 20:14 Uhr, schrieb Steffen Märcker : > Dear all, > > I have two questions regarding parsing frameworks. > > 1) Do you have any insights on the performance of SmaCC VS Xtreams > Parsing VS PetitParser? > 2) Has anybody started to port PetitParser 2 from Pharo to VW? Is it > worth the effort? > > Sorry for cross-posting, I thought this might interest both communities. > > Cheers, Steffen On Fri, 5 Oct 2018 at 04:47, Steffen Märcker wrote: > I gave Xtreams-Parsing and PetitParser a shot and like to share my > findings.[*] > > The task was to parse the modelling language of the probabilistic model > checker PRISM. I've written a grammer of about 130 definitions in the > Xtreams DSL, which is close to Bryan Fords syntax. To avoid doing it all > again with PetitParser, I wrote a PetitParserGenerator that takes the DSL > and builds a PetitParser. > > The numbers below are just parsing times, no further actions involved. > For > reference I show the times from PRISM (which uses JavaCC), too -- > although > they involve additional verification and normalization steps on the AST. > > input PrismXP PP > 230kB14s9s 2s > 544kB 121s 20s 5s > 1.1MB 421s 34s 8s > 1.4MB 1091s 47s 12s > 2.2MB 63s 16s > 2.9MB 81s 20s > 3.8MB 107s 25s > 4.4MB 123s 30s > > Please note that these times are not representative at all. It's just a > single example and I put zero effort in optimization. However, I am quite > satisfied with the results. > > [*] I was already familiar with the DSL of Xtreams-Parsing, which I like > very much. I did not consider SmaCC, as I find PEGs easier to use. > > Best, Steffen > Thanks for your report Steffen. Nice to see such comparisons even when a bit apples & oranges. Will you be implementing those "additional verification and normalization steps" ? It seems they have an exponential or power impact on times. cheers -ben > > > > > >
[Pharo-users] http://pharo.org/download | Pharo7 standalone?
Hello The Pharo download page http://pharo.org/download offers the Pharo launcher with various images and a Pharo6.1 standalone download. I would like to have a Pharo 7 standalone installation. How do I do that? Thank you for the answer in advance Hannes
Re: [Pharo-users] CORMAS vidéo
Gmail thought that the email below was spam, but actually it is NOT. On the other hand is understandable how Gmail thought so: "Look at this funny video: " is the prototypical spam nowadays :) Cheers On Wed, Oct 3, 2018 at 7:27 PM Serge Stinckwich wrote: > > A really funny video done for CORMAS guys after ESUG 2018 conference: > > https://youtu.be/dh9Eseu69fM
Re: [Pharo-users] [vwnc] Parsing in Smalltalk
I gave Xtreams-Parsing and PetitParser a shot and like to share my findings.[*] The task was to parse the modelling language of the probabilistic model checker PRISM. I've written a grammer of about 130 definitions in the Xtreams DSL, which is close to Bryan Fords syntax. To avoid doing it all again with PetitParser, I wrote a PetitParserGenerator that takes the DSL and builds a PetitParser. The numbers below are just parsing times, no further actions involved. For reference I show the times from PRISM (which uses JavaCC), too -- although they involve additional verification and normalization steps on the AST. input PrismXP PP 230kB14s9s 2s 544kB 121s 20s 5s 1.1MB 421s 34s 8s 1.4MB 1091s 47s 12s 2.2MB 63s 16s 2.9MB 81s 20s 3.8MB 107s 25s 4.4MB 123s 30s Please note that these times are not representative at all. It's just a single example and I put zero effort in optimization. However, I am quite satisfied with the results. [*] I was already familiar with the DSL of Xtreams-Parsing, which I like very much. I did not consider SmaCC, as I find PEGs easier to use. Best, Steffen Am .10.2018, 20:14 Uhr, schrieb Steffen Märcker : Dear all, I have two questions regarding parsing frameworks. 1) Do you have any insights on the performance of SmaCC VS Xtreams Parsing VS PetitParser? 2) Has anybody started to port PetitParser 2 from Pharo to VW? Is it worth the effort? Sorry for cross-posting, I thought this might interest both communities. Cheers, Steffen
Re: [Pharo-users] GLM: preserving columns width in tables // getting the actual column
Hi, There is no built-in support for something like this. You would have to change the internal logic of the TablePresentation renderer. Cheers, Doru > On Oct 4, 2018, at 7:16 PM, Arturo Zambrano wrote: > > Hi All, > I would like to preserve the width of columns for tables after a user has > changed them (not fast tables, but it should be similar). > To do this I plan to get the actual width of the columns and use it the > next time I need to create the table. > Please consider the following snippet: > > browser := GLMTabulator new. > browser row: #Example. > browser transmit > to: #Example; > andShow: [ :a | > table:= a table. > table > column: 'Class Name' evaluated:[:clazz| clazz name] width:100; > column: '# of methods' evaluated:[:clazz| clazz methods > size] width:150; > children:[:clazz| clazz subclasses]; > shouldRootsExpand: true ]. >browser openOn: {Object}. > > If I resize the columns in the UI and then run > > table columns collect:[:c| c width] > > I get the original sizes but not the actual ones. > > I have two questions: > 1- Is there a way to get the actual values for column width? > 2 - Is there an event that gets fired when column sizes are changed in the > UI? > > If there is such an event maybe all that is needed it to update the width > inst. var in the columns (GLMTableColumns). > > TIA > Arturo > > > > -- www.feenk.com "From an abstract enough point of view, any two things are similar."
[Pharo-users] GLM: preserving columns width in tables // getting the actual column
Hi All, I would like to preserve the width of columns for tables after a user has changed them (not fast tables, but it should be similar). To do this I plan to get the actual width of the columns and use it the next time I need to create the table. Please consider the following snippet: browser := GLMTabulator new. browser row: #Example. browser transmit to: #Example; andShow: [ :a | *table*:= a table. table column: 'Class Name' evaluated:[:clazz| clazz name] width:100; column: '# of methods' evaluated:[:clazz| clazz methods size] width:150; children:[:clazz| clazz subclasses]; shouldRootsExpand: true ]. browser openOn: {Object}. If I resize the columns in the UI and then run *table* columns collect:[:c| c width] I get the original sizes but not the actual ones. I have two questions: 1- Is there a way to get the actual values for column width? 2 - Is there an event that gets fired when column sizes are changed in the UI? If there is such an event maybe all that is needed it to update the width inst. var in the columns (GLMTableColumns). TIA Arturo
Re: [Pharo-users] Set programatically the selection for a fastTreeTable
On Thu, Oct 4, 2018 at 3:46 AM Arturo Zambrano wrote: > Thanks Andrei! > > I tried: > > browser transmit > to: #Example port: #selection; > transformed: [ Abort ]. > > using also #strongSelection and #rawSelection,but I missed # > fromOutsideEntityPort :) > > > So, I have two additional questions: When #selection: and > #strongSelection: can be used ? > Strong selection is in list/tree/table presentations associated with double clicking on an element. So it's a "stronger" selection than just clicking once. > > Also, what is the difference among selection strongSelection and > rawSelection ports ? I saw some transmission example > using #strongSelection port, and some discussion in the mailing list where > #rawSelection port is mentioned. > There is no connection between #strongSelection and #rawSelection ports. Only between #selection and #rawSelection. #rawSelection will hold the exact value that was selected. Before putting this value in the #selection port a transformation can be applied on it using GLMBasicPresentation>>#send:. Have a look for example at Date>>gtInspectorDetailsIn:. The table displays a list of associations, but on selection we want to navigate to the value in that association. #rawSelection will hold the association and #selection the value in that association. Cheers, Andrei > > Thanks > > > > On Wed, Oct 3, 2018 at 5:31 PM Andrei Chis > wrote: > >> Hi Arturo, >> >> Normally what you want should be achieved with a transmission: >> >> browser transmit >> fromOutsideEntityPort; >> to: #Example port: #selection; >> transformed: #first. >> >> Just I see that doesn't work as expected with #fastTreeTable. >> >> The closest thing that looks similar to what you want is: >> >> | browser | >> browser := GLMTabulator new. >> browser row: #Example. >> browser transmit >> to: #Example; >> andShow: [ :a | >> a table >> column: 'Class Name' evaluated:[:clazz| clazz name]; >> children:[:clazz| clazz subclasses]; >> shouldRootsExpand: true ]. >> browser transmit >> fromOutsideEntityPort; >> to: #Example port: #selection; >> transformed: [ Abort ]. >> browser openOn: {Object}. >> >> Cheers, >> Andrei >> >> >> >> On Wed, Oct 3, 2018 at 9:53 PM Arturo Zambrano >> wrote: >> >>> Hi all, >>> I'm trying to do what subject says. I tried something like that >>> (in the example I'm trying to get Abort class selected) >>> : >>> | browser | >>> browser := GLMTabulator new. >>> browser row: #Example. >>> browser transmit >>> to: #Example; >>> andShow: [ :a | a fastTreeTable >>> column: 'Class Name' evaluated:[:clazz| clazz name]; >>> children:[:clazz| clazz subclasses]; >>> allExpanded; >>> "this has no effect" strongSelection:Abort; >>> "this has no effect" selection: Abort >>> browser openOn: {Object} >>> >>> Could you please point me what I'm missing? >>> >>> TIA >>> Arturo >>> >>> >>> >>>