pharo-wiki
pharo-wiki copied to clipboard
How to deploy a Pharo application - out of date
In Pharo 10 I can't find the method to open a morph/presenter in full screen mode to ensure the user cannot access content behind it:
MyPresenter new openWorldWithSpec.
The guide makes not references to versions later than 7.
In spite of this, it is a very good starting point - thanks!
Update:
In Pharo 10 and later you can use:
MyPresenter asWorldWindow open.
Other points:
- To set you application to run implement startUp: on your class and execute before saving the deployment image:
SessionManager default registerUserClassNamed: 'MyApp'. Smalltalk snapshot: true andQuit: true
Your startUp: may need to fork a process to allow the UI to be installed first. e.g. MyApp>>startUp: isImageStarting
isImageStarting ifTrue: [[self startUpRuntime] fork]
- To smooth the display on opening hide the OS window before saving the deployment image:
self currentWorld worldState worldRenderer window hide. OSWindowAttributes defaultVisible: false. "Otherwise opens shown - Note: you'll need to implement this method" 0.2 seconds wait. "Needs time to set before saving image." Smalltalk snapshot: true andQuit: true
In the start up of your app show the OS Window:
self currentWorld worldState worldRenderer window show.
- For some reason the regular mechanism for invalidating the window doesn't always work for a SpWorldPresenter. In particular, window refresh doesn't occur when resizing, until the mouse re enters the window. To replicate, drag the window to the right, being careful not to enter the window with the mouse. Once the mouse enters the window it refreshes to reflect the new size. Furthermore none of these seem to work:
- self currentWorld worldState invalidate.
- self currentWorld worldState doFullRepaint.
- self currentWorld restoreMorphicDisplay.
- self currentWorld changed.
- self currentWorld doOneCycleNow.
- self currentWorld worldState worldRenderer checkForNewScreenSize
A workaround is to append the following to the end of checkForNewScreenSize:
[self currentWorld simulateMiddleClick] fork
Happy runtime!
Section about setting window title is outdated as well:
Section with: https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/DeployYourPharoApplication.md#change-the-logo-and-window-title-of-the-application
should be update with: World worldState worldRenderer windowTitle: 'My Application
Icon setup: World worldState worldRenderer icon: anIcon
.
TODO: How to instantiate Icon from file.