Page 1 of 1

PostPosted: Tue Aug 21, 2001 11:53 am
by SyPDA
Hi Joe,

I'm trying to use the PTL7.0 and don't get the Form-routines to work.

This is what I do:

First I create a small test program with the PDE:

<pre id=code><font face=courier size=2 id=code>
library "PToolboxLib"

main() {
int e;
</font id=code></pre id=code>

Then I compile this program as a stand-alone prc (yes, it has a unique ID and icons and everything else), hotsync it and start RsrcEdit on my Palm.
I create a tFRM with ID 3001 (within this test program) and place a 'hello' label with ID 3002 on this form.

After starting this program all that happens is a crash with a 'Form doesn't exist' error.

I suppose there is something I do totally wrong... but I don't see what.

According to your manual, this would be the way to create resources and use them. The dynamic form variant does function though, but I don't want to define everything beforehand. I would prefer to edit the resources 'in-file'.

Can you give me hint, please? :)


PostPosted: Tue Aug 21, 2001 1:00 pm
by jstadolnik
The form has to be created before it is drawn. There's a small, complete code example in the "Crash-erama" post in the PToolbox forum.

Also, there are a number of form examples that come with the PToolbox release (multiform_demo.c, button_demo.c, & field_demo.c).

Most importantly, review the "Form Functions" section in the PToolbox documentation. There are 25 or so caveats listed there.


PostPosted: Tue Aug 21, 2001 1:43 pm
by SyPDA

Maybe I just misunderstood your manual and the meaning of dynamic and resource forms. Seems that only the menubar is supported as a direct resource and everything else must be created as a dynamic element.

Is that right?

Thanx for the fast response. :)

PostPosted: Tue Aug 21, 2001 3:27 pm
by jstadolnik
Sorry I read your original post too quickly... I didn't realize that you were trying to pull in a resource form rather than a dynamic one.

As to your question: Yes. Currently the only supported resource objects are menus. Resource objects must be including in a .prc to work.

All others objects (forms, buttons, dialogs, etc) are created on-the-fly. In other words, the "definition" for the object is specified programatically rather than pulled from a resource in the program's .prc file.

I do eventually plan to support more resource objects, but in general dynamic ones are easier to work with in PocketC.


Edited by - jstadolnik on 08/21/2001 10:56:58