[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: GUI-Model communication



Hi,

Thanks v. much for this, but unfortunately I'm a bit slower than I like to admit and have a number of questions still!

I'll start at the end of your document with the function TApp::RunCentury...

Excuse my ignorance, but I can only get commands to run from my vCmdWindow. How do you call Tapp::RunCentury? Since my TApp equivalent is declared static, it doesn't have external linkage, no? So Icant call ::TApp.Runwhatever() from my commandWindow.

Anyway, my menu and button bar are members of my CmdWin... it seems to me as though everything has to be done through the commandWindow and not through the App (an aspect of V that's always confused me..)?

You also seem to have a global dialog (progDlg) - again, mine are all created as part of the commandWindow as per the V tutorial and examples I've looked at.

I think I'm missing something basic, and I'm sorry but am very confused by this - should I *not* be using vCmdWindow?

Can anybody help?

Martin

Essentially it works like this:

1. The GUI class makes an instance of the simulation class, and gives it pointers to global functions to which will either send or receive messages from the simulation instance.

2. The GUI class tells the simulation to run, and concurrently displays a progress bar with a Cancel button.

3. The simulation has a time-step loop, within which it sends a message to the progress bar dialog containing the simulation time, sends messages as needed to be displayed to the user, and checks for received ("posted") messages at each time step.



Tom Hilinski
e-mail:  hilinski@lamar.colostate.edu

<< Century-GUICommunication.HTM >>

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


Reply to: