Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deploy a Pharo application - out of date #329

Open
StewMacLean opened this issue Jun 27, 2022 · 1 comment
Open

How to deploy a Pharo application - out of date #329

StewMacLean opened this issue Jun 27, 2022 · 1 comment

Comments

@StewMacLean
Copy link

StewMacLean commented Jun 27, 2022

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:

  1. 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]

  1. 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.

  1. 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!

@Bajger
Copy link

Bajger commented May 3, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants