To save our HelloWorld and trigger the sample on startup time evaluate (doIt) the following expression in Workspace:
('U8Toolbar open', $!, String cr, String cr),
(Exporter new fileOutCategory: #TestingUI8),
('HelloWorld open',$!) outputToFile: 'LibrariesLoaded.st'
The #outputToFile: message saves to an specific file the receiver string of message. Basically if you saw the expression that will be recorded, you will see:
U8Toolbar open!
UI8Application
subclass: #HelloWorld
instanceVariableNames: ''
category: #TestingUI8 !
! HelloWorld class methodsFor: #defaults !
mainViewSupport
" Private - Return the support for mainView. "
^TopPane! !
! HelloWorld methodsFor: #initialize !
setInitialContents
" Private - Initialize the contents of the receiver. "
| text |
self mainView leftTop: 50 @ 40.
self mainView title: 'Test Application'.
text := self window text:'Hello World',$!!.
text style
width:#300px;
height:#50px;
display: #block;
fontFamily: #Helvetica;
fontSize: #18px.
self mainView
addChild: text! !
HelloWorld open!
Headless mode allows to save several predefined files that will be loaded/filledIn at system startup time. For more info about this topic check [U8] Web headless. The previous expresion -the first one- saves several chunks of code. First, opens UI8 enviroment, then defines all HelloWorld code and finally opens our sample. The changes will take effect when you reload this contribution.
Note: As you know, in a web context, changes takes time to become real because of browser cache, so it is recomended to clear it.