Monthly Archives: September 2019

PharoCom

Hi,

I finally got some time to check Pablo’s PharoCOM package closely. At first
I had problems with simple things, like making Word visible with
properyNamed:put: (it’s frustrating when you see the app on the processes
list but you cannot control it :-)) but then I found the reason – it was a
tiny detail in Win32VariantBool>>#write:to:, and then – voila!

Here’s an example of opening Word for Windows, adding a blank document,
typing some text and getting this text back to Pharo:

Ole32Lib uniqueInstance initLibrary.
wrd := COMDispatchInstance createInstanceByName: ‘Word.Application’.
wrd propertyNamed: ‘Visible’ put: true.

docs := wrd propertyNamed: ‘Documents’.
docs dispatch: ‘Add’.

sel := wrd propertyNamed: ‘Selection’.
sel dispatch: ‘TypeText’ withArguments: {‘Hello from Pharo!’}.

sel dispatch: ‘WholeStory’ .
Transcript show: (sel propertyNamed: ‘Text’); cr.

Another example is with Active Data Objects to get DB access:

conn := COMDispatchInstance createInstanceByName: ‘ADODB.Connection’ .
conn dispatch: ‘Open’ withArguments: { ‘DSN=this; Uid=that; Pwd=theOther;’ }
.
conn propertyNamed: ‘State’ . –> true!
rst := (COMDispatchInstance createInstanceByName: ‘ADODB.Recordset’) .
rst dispatch: ‘Open’ withArguments: { ‘SomeTableName’ . conn . 3 . 1 }.

The last line raises an exception because not all of the data types that
functions are reporting are implemented yet, as Pablo mentioned in his post.

The package is really nicely prepared. The most impressive is it’s
reflective capability. My “proof of concept” work with DispHelper library
that I mentioned in another forum topic was successful (I can get to the SQL
Server :-)), however it’s a dead-end regarding the reflection.

I’m very interested in COM implementation since I found Pharo to be very
useful as a tool, and since I work in “windowed” environment the COM
interaction is crucial to me. I decided to spent my free evenings working on
the project finalization. I’m not sure of how long will it take though 🙂
Pablo, I hope that I can count on your help regarding the questions about
the overall architecture that you set.

Is anybody else interested in this? Maybe we can join our efforts.

Best wishes,
Tomaz

[ANN] New Windows VM – Fixes 1903 error

Hello,
a new stable VM has been deployed. This VM uses a new version of libSSH allowing us to work in the latest Windows version.

It can be directly updated using Pharo Launcher or downloaded using ZeroConf scripts.

To update from Pharo Launcher you have to access to the VM Manager window.
Just click on the marked button and then in “Update”

updateVM.png

A little information I was missing, the fixed VM is for both Pharo 7 and Pharo 8

Thanks Guille and Pablo!

Pharo Team

Spec2 new PR in Pharo 80

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

Features

  • Add padding management of SpBoxLayout for Morphic
  • Add demo on Box Layout (978220b)
  • Add package comments (20ffe7a)
  • Add contextMenu to Athens presenters (78aefa5)
  • Allow to add an image in the layout without declaring an image presenter (748bc59)
  • Add InputPort to SpPresenterWithModel (5f7d07c)
  • Improve demos (d2e1bf1)
  • Add possiblity to pass action to link presenter (3903717)
  • Add component list presenter (cb26690)
  • Add possibility to defer UI via Spec (da86831)
  • Introduce new API: initializePresenters and connectPresenters instead of initializeWidgets and initializePresenter (6c7ebc1)
  • Use toolbar and not toolBar (f2f807f)
  • Create builder for SpActionBarPresenter (c5f1e59)
  • TextPresenter Add a placeHolder (7b7d4b5)
  • Add the method clearContent in the class SpAbstractTextPresenter (16a842d)
  • feature/improvementsForIceberg (246c1a7)

Commander 2 integration

  • Change dependency to Commander2 so it uses v110 (5ca15b3)
  • Update commander2 version (4ac485a)
  • Change dependency to Commander2 for v120 (15945ac)
  • Migrate Spec to use Commander2 v200 (c4c5350)
  • Implement method to convert spec command as ButtonPresenter (dab0312)
  • Allows one to change the default context set on commands when their context is nil (152af5e)
  • Commander2 should provide easier way to use command group on list tree etc (d80a965)
  • Commander2 layer should set the presenter as context of commands when not done (d0f2889)

Bugfixes

  • Replace Smalltalk references (c1cc561)
  • Fix grid layout tests (85719bc)
  • SpAbstractPresenter should be abstract (de681a0)
  • Migrate more layouts to executable layouts (cee71ae)
  • Use theme instead of hardcoded color in Modal adapter (be583d8)
  • TextPresenter placeholder does not work in Pharo 7 (6bbdc7b)
  • Instance of TreeTablePresenter did not understand activatesOnDoubleClick (9cda46c)
  • Fixing SpCodePresenter in pharo8 (fc5b7e8)
  • Some table columns are editable (c630a0e)
  • Fixing Baseline (3f3ac6d)

Cleanings

  • Migrate initializeWidgets and initializePresenter to new API (dd74217)
  • Clean package structure (a0706ba)
  • Remove dependency between Spec2 Commands and Commander (56ae6d4)
  • Commander2 v2 migration (0d029c0)
  • Remove all commented pragmas (ed6e844)
  • cleanup (05839d7)
  • Deprecate asSpAdapter (cb5f47c)
  • Move spec related methods on class side of CmCommand and CmCommandGroup to spec integration package (f95eca0)
  • Remove ComposablePresenter references (ef8c984)
  • Unnecessary initialize method in SpMorphPresenter (4b6828b)
  • SpExecutableLayoutresolvePresentermodelbindings should be SpExecutableLayoutresolvePresenterpresenterbindings (caa37db)
  • Fix calls to canBeRun and replace them with canBeExecuted (822db0c)
  • PolyWidget SpChooseMethod improvement (fe964f9)
  • Comment of SpPresenter mentions ComposablePresenter (d46e348)
  • Rename SpTestingComposerWithModel into SpTestingPresenterWithModel (092e6c4)

Infrastructure

Commander 2 integration of the 13 of September 2019

Features

  • Add #register:after: and #register:before:. (ad5041c)
  • Implemented part of the missing API and implemented corresponding tests. (5c91fac)

Bug fixes

  • Added missing deprecation methods to make transition from v1 to v2 smoother. (3fef319)
  • Changed string returned by #defaultDescription to be ‘Not described command.’ (71ad574)

Cleanings

  • Preparing for major release, removing deprecated methods we do not want in next major version: – #canBeRun – #canBeRunBlock – #canBeRunBlock: – #defaultCommandName – #runWith: (3dbd6b1)
  • Updated baseline to be more flexible. – Do not provide migrator in default group. – Provide core,test and migrator groups. (7a7491b)
  • Enhanced comment. (8379fb3)
  • Did migration with the following renamings (order is important): #name -> #dynamicName. #description -> #dynamicDescription. #basicName -> #name. #basicDescription -> #description. (1a8f4e8)
  • wrap environment into RBNamespace. (723cddd)
  • Put #runWith: in deprecations package. (cc9025d)
  • Removed #runWith: (c78dd09)
  • Renamed #defaultCommandName as #defaultName. Used deprecation. (c1bad44)
  • Renamed #canBeRunBlock as #canBeExecutedBlock via a deprecation. (5a87a11)
  • Moved spec related methods in class-side of CmCommandGroup to spec package. (4ae2f84)
  • Moved spec-specific methods on class side of CmCommand to Spec integration package. (11d7997)
  • Renamed #canBeRun as #canBeExecuted to be more consistent. Created a deprecation to ease migration of users. (152e6a7)
  • Reclassified all #canBeRun methods in ‘testing’ protocol. (813cda2)
  • Reclassified #execute methods in ‘executing’ protocol. Brings consistence and solves issue #9 (19c1ee0)
  • Renaming of CmCommandGroupTest to CmCommandsGroupTest. (5f20942)
  • Renamed test class to match class under test. (8ab2c3b)

Fund rising for a book on Spec20

Hello Pharoers and Smalltalk Friends
Often you or other complain that there is not enough documentation, tutorials…. (even if we have a MOOC worth 155 K euros http://mooc.pharo.org, several great books http://book.pharo.org), but yes we should update them.
Now I started to work on a new book on Spec 20 with Cyril Ferlicot and I decided that I will not write it for free because it will take me at least 6 months.
So I decided that if this community wants more books and documentation, it should prove its will 🙂
I created a fundraising campaign to check if people can align their wishes and their means.
So feel free to sponsor this great book.

Building user interfaces with spec 20 –  

https://www.okpal.com/building-user-interfaces-with-spec/?utm_campaign=01DKKYM06QR7GF0K4S5YA3VVZ0&utm_medium=campaign_edit-okpuid_01DKKYKZ99J5VPEAKHNXH8375A-20190903&utm_source=share_directlink

Organisations can also do it.
BTW: the crowd funding system and other cost will cost us 10% and after we will pay taxes
on this. So I prefer not to count our hour cost because else I would really not write a book at all.
Stef