Re: RE-CREATION OF V/286 APP IN DOLPHIN
- From: Andy Bower <bower@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 15 Mar 2011 15:48:28 +0000
Rambo,
Thanks for the video. Aside from the MVP question, as a
beginner with Dolphin I'm unsure what you mean when you say the
application should be subclassed from ShellView -- Ok for the small
app you demonstrate but for my app which has a context far beyond the
design of a custom window, do I need to 'hang' everything from
ShellView ? I installed my main code as a sub-class of Object (not
packaged) before addressing the MVP aspect.
Should I proceed on that basis or do I need to re-jig my main code ?
I've forgotten how the frameworks in V/286 worked but in the Dolphin development environment it is possible to have several (many) applications installed in the system that can be launched from their own system folder icons.
When launching an app, it is typical that it would have one main window that effectively "owns" all the application objects and any further top level windows that are created. Normally, when the main window is closed the app shuts down. This transfers well to the deployed scenario where double clicking the EXE creates the main window (this is done in a RuntimeSessionManager subclass that you install) and closing this terminates the EXE.
So it would be fine to have your application objects subclassed below Object but who creates the instances of these and hangs onto them? Normally, I would say that your main window would do this.
If you don't have the concept of a main window (maybe for a headless server) then the above doesn't apply. Typically, then, your main application object would be owned by the subclass of RuntimeSession manager that is invoked when a deployed application is started. In this case, because you can't install your own session manager at development time, you have to come up with alternative arrangements during debugging.
On a more trivial note the only significant problem I had while
installing my old methods in Dolphin was a Menu function illustrated
by the appended code. This generates the Menu, displays it and returns
the selection. The fromStrings: method in Dolphin will only accept
restricted arguments, does not display or return a selection, or am I
missing something ? Otherwise I could use a Prompter which seems
clumsy.
Well, if you use MVP you can create menu hierarchies in the View Composer. If you are following the approach in the video then you'll need to build the menus manually. The following code demonstrates how to do this.
====
ShellView subclass: #TestWindow
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
classInstanceVariableNames: ''!
TestWindow guid: (GUID fromString: '{45739C3B-F235-4C0F-AE46-E7306EEEC93C}')!
TestWindow comment: ''!
!TestWindow categoriesForClass!MVP-Views! !
!TestWindow methodsFor!
fileOpen
"Open a file. For now put up a message"
MessageBox notify: 'File Open Requested'!
onFullyCreated
| mb fileMenu |
super onFullyCreated.
self caption: 'Menu Demo'.
mb := MenuBar new.
self menuBar: mb.
"Create the file menu"
fileMenu := mb addSubmenu: 'File'.
fileMenu
addCommand: #fileOpen description: '&Open...';
addSeparator;
"Note that #exit is implemented by our superclass"
addCommand: #exit description: 'E&xit'! !
!TestWindow categoriesFor: #fileOpen!commands!public! !
!TestWindow categoriesFor: #onFullyCreated!private! !
====
Also I need to display a simple message on screen when my App reaches
a particular state.
The #fileOpen method above shows ho to do this using a windows MessageBox.
Best regards
Andy Bower
.
- Follow-Ups:
- Re: RE-CREATION OF V/286 APP IN DOLPHIN
- From: Christoph J. Bachinger
- Re: RE-CREATION OF V/286 APP IN DOLPHIN
- References:
- RE-CREATION OF V/286 APP IN DOLPHIN
- From: RAMBO
- RE-CREATION OF V/286 APP IN DOLPHIN
- Prev by Date: Re: Problems in ctrl-break
- Next by Date: Re: Views in subclass
- Previous by thread: RE-CREATION OF V/286 APP IN DOLPHIN
- Next by thread: Re: RE-CREATION OF V/286 APP IN DOLPHIN
- Index(es):
Relevant Pages
|