Discussion:
Appropriate to ask Turbo Vision questions here?
(too old to reply)
Jim Leonard
2011-12-29 17:05:54 UTC
Permalink
I know there's a Turbo Vision group, but it seems dedicated to the C
version, and that group seems less-frequently monitored than this
one. I ask because I'm about to actually write my first TV
application, and wondering if I should even consider trying to ask for
help here. I have gone through the 12-section tutorial in the BP 7 TV
manual, including typing all the source myself, so I have a basic idea
of how to proceed. I think my questions will fall more along the
lines of "What is the 'Turbo Vision' way to perform this application
function?".

Along those lines, here's my first question: If everything in the TV
application framework is event-based, doesn't that mean the main event
handler could get extremely large, like several hundreds of lines
long, with a hundred or more event handlers? And is that best
practice, to put every event handler in a single loop, even for events
that are only generated/handled by modal dialogs? (by "modal" I
believe it means "grabbing focus until closed")

Is there source code for any large TV programs (applications, not
libraries or utilities) out in the wild that I could study? Most of
what I poked through in Garbo and SWAG looked like library units and
dialog designers, not actual finished TV programs.
Marco van de Voort
2011-12-29 17:33:07 UTC
Permalink
Post by Jim Leonard
Along those lines, here's my first question: If everything in the TV
application framework is event-based, doesn't that mean the main event
handler could get extremely large, like several hundreds of lines
long,
No
Post by Jim Leonard
with a hundred or more event handlers?
Yes :-)

A TV form is more or less organized as a tree, (form-> container control (*)
-> base component). Only the path to the focussed element get the main
stream of events. A rarer, special "broadcast" event goes to all widgets.

So the main event loop (also called message pump since it just pumps events
from the "drivers" part to the active form, which pumps it to the controls,
which pump it to their children etc.

(*) a container control is a control that can contain other controls. A
form (window) is also a container, but has way more logic
Post by Jim Leonard
And is that best
practice, to put every event handler in a single loop, even for events
that are only generated/handled by modal dialogs? (by "modal" I
believe it means "grabbing focus until closed")
Usually only focussed elements get the events, unless they are of the
broadcast type. (which is usually stuff like "exiting, save your stuff".
Post by Jim Leonard
Is there source code for any large TV programs (applications, not
libraries or utilities) out in the wild that I could study?
The textmode IDE of Free Pascal, while it probably not compiles with turbo
pascal anymore, is still close enough to study the general structure of
larger programs. It is in FPC source archives in the directory IDE, e.g.

ftp://ftp.freepascal.org/pub/fpc/dist/2.4.4/source/short/separate/idesrc.zip
Jim Leonard
2011-12-29 18:38:30 UTC
Permalink
This has been helpful, thanks. I hope I won't have questions, but if
I do, I'll ask them here.

If you're curious, the project this is for is
dosbenchmark.wordpress.com (a retrocomputing project, obviously).
Loading...