getsd() and PtoolboxLib

A PocketC native palm library offering native forms and assorted utilities

Postby tthkbw on Mon Dec 23, 2002 2:02 pm

From the PtoolboxLib documentation:

Some built-in PocketC commands, notably the Basic I/O functions (puts, gets, setsd, getsi, setsm, alert, confirm, and clear), can "eat" button, list, and resource menu events.

Under what circumstances?

In Hoops, some users, myself included, have complained that taps on the screen are not recognized. I use getsd(), alert() and confirm(). Does the simple fact of using these cause the problem? Should I take the time to build by own versions of these functions?



tthkbw
tthkbw
 
Posts: 75
Joined: Wed Nov 07, 2001 4:04 pm
Location: USA

Postby jstadolnik on Mon Dec 23, 2002 3:36 pm

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
Some built-in PocketC commands, notably the Basic I/O functions (puts, gets, setsd, getsi, setsm, alert, confirm, and clear), can "eat" button, list, and resource menu events.

Under what circumstances?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

Usually just after any of these functions are called.

When called they can "steal" events away from Fevent(). The built-in PocketC event queue has an enforced depth of 1. The problem is that button, field, list, and menu events requires specific chains of events to execute in order to work.

For example, the form handler checks to see if a pen down event occured in a button, if it does it places a ctlEnter event on the queue, which then shades the button. The event handler then waits for a pen up event, if it occurs within the bounds of a button, a ctlExit and ctlSelect event are both enqueued. The fixed event queue length in PocketC can cause many of the internally launched events to be discarded and the objects to misbehave. Fevent() doesn't clip the queue depth allowing form objects to work correctly.

Also, using event() can clip the event queue and cause strange behavior. When using PToolbox forms always uses Fevent().

As you suggested, creating your own replacements for these functions will eliminate the event "eating" phenomenea described above.

Joe


The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 2 guests

cron