Page 1 of 1

PostPosted: Wed Sep 12, 2001 5:35 am
by SyPDA
Hi Joe!

Another one... :)

If you use
<pre id=code><font face=courier size=2 id=code>
Fctl(HOOKHARD,1);
</font id=code></pre id=code>

and press the hardbuttons during execution, then nothing will happen (as long as the program does not handle this event).

Ok

BUT, if at any time after the hook you have a selection like this:
<pre id=code><font face=courier size=2 id=code>
i = Fctl(POPLIST,LISTx);
</font id=code></pre id=code>

then pressing a hardbutton will exit the program.
You will get the same results with hooksilk.

Is this a bug or a feature? :)

PostPosted: Wed Sep 12, 2001 12:30 pm
by jstadolnik
This is a feature. The pop-up list is launched and controlled by a single palm API call, during which the palmOS takes control over the event handling mechanism. There is no way to intercept hard or silk button events when a list is popped in this manner.

Though you can probably disable the hardkeys entirely with the NoKeyEvents() function during the list pop.

By the way, you will see the same behavior with any of the built-in PocketC dialogs: alert, confirm, gets, etc. <img src=icon_smile_shock.gif border=0 align=middle>

Joe

PostPosted: Wed Sep 12, 2001 12:48 pm
by SyPDA
Ok. Thanx for the answer. :)

I got another question:

Is it possible to empty a LIST completely? I am trying to do a load/save dialog and I use a list to show all available files. The user can choose a file from the list and load it. The user will also be able to delete files from the list. The list itself will refresh via the FsetList() and Fctl(SHOW,) commands as written in your documentation.

The problem lies in the last element. If its deleted, and the max_items counter is zero, then the FsetList command will produce an SysFatalAlert on the Palm Emulator. The exact error message is:

PocketC(4.1.1) called SysFatalAlert with the message: "Form.cpp, Line 354, SetList: memory alloc fail".

I was not able to test this on a real machine yet, but could you give me a hint how to place an empty list element on a form? Or is this an emulator problem?

PostPosted: Wed Sep 12, 2001 4:05 pm
by jstadolnik
Gasp! It's busted. <img src=icon_smile_blackeye.gif border=0 align=middle> The next release with the fix should be out within a week.

Joe