I'm searching for a way to create desktop applications with Pharo (no multiple window).
Here's the current snippet that do what I want. Improvements / better code is really really welcome.
counter := Class new��
���� �� �� �� �� �� ��superclass: Object;��
���� �� �� �� �� �� ��addInstVarNamed: 'counter';��
���� �� �� �� �� �� ��compile: 'initialize��
���� �� �� �� �� �� �� �� �� �� �� �� �� counter := 0';
���� �� �� �� �� �� ��compile: 'counterString��
���� �� �� �� �� �� �� �� �� �� �� �� �� ^ counter asString';
���� �� �� �� �� �� ��compile: 'increment��
���� �� �� �� �� �� �� �� �� �� �� �� �� counter := counter + 1.��
���� �� �� �� �� �� �� �� �� �� �� �� �� self changed:#counterString';
���� �� �� �� �� �� ��compile: 'decrement��
���� �� �� �� �� �� �� �� �� �� �� �� �� counter := counter - 1.��
���� �� �� �� �� �� �� �� �� �� �� �� �� self changed:#counterString';
���� �� �� �� �� �� ��new.
panel := UITheme builder newPanel.
panel layoutPolicy: ProportionalLayout new.
panel��
addMorph: (UITheme builder newLabelFor: counter getLabel: #counterString getEnabled: nil)
fullFrame: �� (LayoutFrame fractions: (0@0 corner: 1@0.5)).
panel��
addMorph: (UITheme builder newButtonFor: counter action: #increment label: '+' help: nil)
fullFrame: �� (LayoutFrame fractions: (0@0.5 corner: 0.5@1)).
panel��
addMorph: (UITheme builder newButtonFor: counter action: #decrement label: '-' help: nil)
fullFrame: �� (LayoutFrame fractions: (0.5@0.5 corner: 1@1)).
World submorphs do: [:aMorph| aMorph delete].
World
layoutPolicy: ProportionalLayout new;
addMorph: panel fullFrame: ��(LayoutFrame fractions: (0@0 corner: 1@1)).