![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

Jodell, try adding the following 2 lines to the end of PSIAPP.F
--------------------------------------------------
' PSIAPP 'MAIN ! \ << Program Start Behavior
PROGRAM MyProgram
---------------------------------------------------
Also, WinApp.F could used as is. It was designed to be extendable. For
example:
----------------------------------------------
REQUIRES WINAPP \ Load App Shell
M_USED ( Next Available Menu ID )
ENUM M_FILE
ENUM M_OPEN
ENUM M_SAVE
ENUM M_SAVE-AS
TO M_USED
: MY-APP-ABOUT ( -- )
HWND Z" About FOOBAR" Z" About" MB_OK MessageBox DROP ;
' MY-APP-ABOUT IS AboutApp
: NOT-DONE ( -- )
HWND Z" Not Implemented Yet" Z" Sorry..."
MB_ICONERROR MB_OK OR MessageBox DROP ;
[+SWITCH AppCommands ( cmd -- )
M_OPEN RUN: NOT-DONE ;
M_SAVE RUN: NOT-DONE ;
M_SAVE-AS RUN: ( do something ) ;
SWITCH]
[+SWITCH AppMessages ( -- res )
WM_LBUTTONDOWN RUN: NOT-DONE 0 ;
WM_RBUTTONDOWN RUN: ( do something else ) 0 ;
SWITCH]
MENU MY-APP-MENU
POPUP "&File"
M_OPEN MENUITEM "O&pen"
M_SAVE MENUITEM "&Save"
M_SAVE-AS MENUITEM "Save A&s"
M_EXIT MENUITEM "E&xit"
END-POPUP
POPUP "&Help"
M_ABOUT MENUITEM "&About FOOBAR"
END-POPUP
END-MENU
: MAKE-MY-MENU ( -- )
HWND MY-APP-MENU LoadMenuIndirect SetMenu DROP ;
' MAKE-MY-MENU IS MakeMenu
' AppStart 'MAIN ! \ << Program Start Behavior
PROGRAM MyProgram
----------------------------------------------
Good Luck,
Mike
-----Original Message-----
From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com]On Behalf
Of Azedia of DOLFINA
Sent: Friday, July 19, 2002 4:31 PM
To: sftalk_at_forth.com
Subject: [sftalk] Re: (No Date: Thu, 18 Jul 2002 15:37:58 -0700
Ok, so I was starting it from this file.f My thinking was that I could
start
it from a separate file.f like the
examples you gave a few months ago with Main.f Appwin. Startup.f I guess
I
do not have the OOP
paradigm ideas down yet to do it that way.
Ok, so I have to do something more intricate with 'MAIN because when I
run
this file.f I get a Console
Window only. I do not know how to get the Window File to run. But it is
not
the threading, I guess.
Jodell
{ ====================================================================
(C) Copyright 2001 DOLFINA of AIWP Jodell Bumatay azedia_at_dolfina.org
PSICORE combines PSIAPP.F as the Windows Parent with Child Console
Window
PSIGUESS.f
So far: LAUNCH-Console launches Window Console CORE.F from PSICORE.f
thanks
again to Mike Ghan for this piece of code
Progress Reports: Need either
jULY 18, 2002 So, far, I can INCLUDE this file.f and there will be a
Parent
Window. And there is a Console Window when I left lick. I can
call TRIAL and it runs successfully in the Console even when I
run PSICORETEST. But this is what is happening:
PSIAPP runs fine only when run from the SF Console and it works ok,
but when running the exe CORETEST, only the Console Window displays.
Bugs List:
jULY 18, 2002 When Console Window hangs or is Closed, the Parent Window
is
also
closed.
==================================================================== }
\ EMPTY WIPE HERE THRESHOLD
REQUIRES DOSBOX
REQUIRES FORK
REQUIRES PSIAPP
REQUIRES CORE01
VARIABLE hCONSOLE
: LAUNCH-CONSOLE ( -- threadHandle )
hCONSOLE @ ( Already Launched? ) ?DUP ?EXIT
FORKS>
( We are now in a new thread )
DOS-CONSOLE OPEN-PERSONALITY
BEGIN
TEST
/ CR ." Hello world! I am a PSICORE Console Window!"
/ CR ." Press a Key " KEY EMIT
0 UNTIL
hCONSOLE OFF ;
[+SWITCH AppMessages ( -- res )
WM_LBUTTONDOWN RUN: LAUNCH-CONSOLE hCONSOLE ! 0 ;
SWITCH]
{ ====================================================================
: PSIGUESS-CONSOLE ( -- )
DOS-CONSOLE OPEN-PERSONALITY
." This is Alpha version .01 of the PSI Guess module of Core
Aptitude Training. " CR
." PSICAT is Educational Spiritual Software for Souls practicing
psychic ministry" CR
." skills as Beings of Light. Spiritual Software is provided and
copyrighted by: " CR
." DOLFINA - A Ministry of Lucidity of AIWP 2000-2002 and Jodell
Bumatay, programmer. " CR
." All Rights Reserved. " CR CR
BEGIN
CR ." Hello world!"
CR ." Press a Key " KEY EMIT
0 UNTIL
0 ExitProcess / alternative code for testing only
;
==================================================================== }
CR .( Type PsiApp to Test )
PROGRAM PSICORETEST
>
> Friday, July 19, 2002, 2:15:54 PM, you wrote:
>
> (lots of code, not reproduced here)
>
> So you don't do anything to explicitly start your window application
running?
>
> The sequence of things to build a normal running SwiftForth
application,
documented
> in the user manual, is
>
> 1. define your window and its behavior
> 2. define an application starting word which includes a message loop
> 3. define the startup vector using 'MAIN
> 4. save an executable
>
> If you save an executable without declaring your own version of 'MAIN,
you'll
> get another swiftforth console window running.
>
> Where do you do set up the stand-alone application? What do you
initialize
it to?
>
> Rick
>
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002 ---------------------------------------------------------------------- sftalk_at_forth.com The SwiftForth programming discussion email list To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com For help with listar commands, send subject "help" to listar_at_forth.com Archives are located at http://www.forth.com/sftalk -- check them out! Search the archives! Visit http://www.forth.com/search for details. ---------------------------------------------------------------------- sftalk_at_forth.com The SwiftForth programming discussion email list To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com For help with listar commands, send subject "help" to listar_at_forth.com Archives are located at http://www.forth.com/sftalk -- check them out! Search the archives! Visit http://www.forth.com/search for details.Received on Fri Jul 19 2002 - 18:38:26 PDT
This archive was generated by hypermail 2.2.0 : Fri Nov 21 2008 - 03:04:24 PST