Microsoft KB Archive/33056

= ToolBox Calls to System Event Functions Fail in QuickBASIC =

Article ID: 33056

Article Last Modified on 11/21/2006



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 &quot;control&quot; such as a scroll bar. (&quot;Controls&quot; are graphic objects that, when manipulated with the mouse, cause instant actions with visible results. This definition is taken from &quot;Inside Macintosh,&quot; by Apple Computer, published by Addison-Wesley. Check boxes, buttons, and scroll bars are examples of &quot;controls&quot; 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 &quot;QuickBASIC for Macintosh: BASIC Language Reference.&quot;

Additional query words: MQuickB

Keywords: KB33056

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.