ToolBox Calls to System Event Functions Fail in QuickBASIC (33056)
This article was previously published under Q33056
SUMMARY
Accessing the Macintosh system event queue with QuickBASIC's ToolBox
statement to make calls to GetNextEvent, WaitNextEvent, and EventAvail
does not work. BASIC traps all events from the system queue and
handles them before your ToolBox call. An occasional event may slip
through, but is not usable. This is a side effect of the way the
event-handling feature of BASIC is implemented. QuickBASIC substitutes
its own statements to handle most events that a program would need to
trap.
MORE INFORMATION
Because of this behavior of QuickBASIC, you cannot use the ToolBox
statement (which is an MBLC routine built into QuickBASIC) to handle
events associated with a "control" such as a scroll bar. ("Controls"
are graphic objects that, when manipulated with the mouse, cause
instant actions with visible results. This definition is taken from
"Inside Macintosh," by Apple Computer, published by Addison-Wesley.
Check boxes, buttons, and scroll bars are examples of "controls" on
the Macintosh.) You may use the ToolBox statement to CREATE a scroll
bar, but you will be unable to get the events for it, since BASIC will
intercept most events.
QuickBASIC provides its own MBLC library routines (such as NewScroll
and ScrollText) to emulate Macintosh scroll bars. QuickBASIC's scroll
bar routines are a simulation of the true Macintosh scroll bars. For
more information about the scroll bar library routines, please refer
to Pages 472 to 492 of the "QuickBASIC for Macintosh: BASIC Language
Reference."
Modification Type: |
Minor |
Last Reviewed: |
1/8/2003 |
Keywords: |
KB33056 |
|