home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,857 of 2,978   
   Marco van de Voort to Jim Leonard   
   Re: Appropriate to ask Turbo Vision ques   
   29 Dec 11 17:33:07   
   
   81751734   
   From: marcov@toad.stack.nl   
      
   On 2011-12-29, Jim Leonard  wrote:   
   > 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   
      
   > 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   
      
   > 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".   
      
   > 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   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca