[Pharo-project] Desktop application with Pharo
bschwab at anest.ufl.edu
Sat Apr 16 15:20:54 CEST 2011
I don't know that what I have done is better than anything else; the basic idea is adapted (aka shamelessly stolen<g> from a wiki entry. Below is the class comment from something that I have successfully deployed as a "desktop app" using Pharo. Using StandardWindow (thanks again to Pinesoft!!), it can #openInWorld (as part of the IDE) or #openFullScreen (when deployed), can be dragged only by the title bar, etc.
Is there a way to get an image to save a copy of itself and its change log in another folder? Suppose the image is happily running in
and the goal is to do the steps below in
Can the running image do that and continue to run in the Pharo-1.1.1 directory as though nothing happened? That might make it possible to take the bumps out of the deployment process.
"To test in the IDE"
Equalize new asMorph openInWorld.
"To deploy - copy the image somewhere, and then do all of the following."
10-09 - one-shot do-it to deploy Equalize; copy the image somewhere first!!"
SystemWindow allSubInstances do:[ :each | each delete. ].
"Then do this as one do-it"
SmalltalkImage current snapshot: true andQuit: false.
Equalize new asMorph openFullscreen.
From: pharo-project-bounces at lists.gforge.inria.fr [pharo-project-bounces at lists.gforge.inria.fr] On Behalf Of laurent laffont [laurent.laffont at gmail.com]
Sent: Saturday, April 16, 2011 5:55 AM
To: An open mailing list to discuss any topics related to an open-source Smalltalk
Subject: [Pharo-project] Desktop application with Pharo
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.
How I can change the title of the window ?
The snippet to evaluate in Workspace:
counter := Class new
counter := 0';
^ counter asString';
counter := counter + 1.
counter := counter - 1.
panel := UITheme builder newPanel.
panel layoutPolicy: ProportionalLayout new.
addMorph: (UITheme builder newLabelFor: counter getLabel: #counterString getEnabled: nil)
fullFrame: (LayoutFrame fractions: (0 at 0 corner: 1 at 0.5)).
addMorph: (UITheme builder newButtonFor: counter action: #increment label: '+' help: nil)
fullFrame: (LayoutFrame fractions: (0 at 0.5 corner: 0.5 at 1)).
addMorph: (UITheme builder newButtonFor: counter action: #decrement label: '-' help: nil)
fullFrame: (LayoutFrame fractions: (0.5 at 0.5 corner: 1 at 1)).
World submorphs do: [:aMorph| aMorph delete].
layoutPolicy: ProportionalLayout new;
addMorph: panel fullFrame: (LayoutFrame fractions: (0 at 0 corner: 1 at 1)).
Laurent Laffont - @lolgzs<http://twitter.com/#!/lolgzs>
Pharo Smalltalk Screencasts: http://www.pharocasts.com/
Developer group: http://cara74.seasidehosting.st
More information about the Pharo-project