Accessing internals of system structs is taboo as Dave said, mostly because of OS 5. Regardless of the OS version, you certainly must be careful to not play with things that did not exist in an older version of the OS. For example, the extended attribute was new in OS 3.5. Twiddling around in there pre OS 3.5 would be bad. And generally speaking, twiddling any system structure in OS 5 is bad, because you only have access to the PACE shadow of the native structure. That being said, gadgets from within gadget handlers are kind of an exception. You can access the gadgetP that is passed into the handler directly. That is the point of the handler. You can not access your gadget's data structure directly once outside your gadget handler, but inside it is okay. This is typically used to allocate/access/free the gadget data.
In any case, I don't think it typical that the gadget would need to be made visable there, so I will report the doc bug. The forums are a good place state things like this, but we also have a bug report page on our web site. http://www.palmos.com/dev/support/bugs/ -Ezekiel Sanborn de Asis *************************** Accessing UI internal structures became taboo with the last couple of OS releases. There should be some routines that you can retrieve/set internal properties without directly modify the structure. If I remember correctly, you're looking for FldGetAttributes and FldSetAttributes. > My first question is is there a functional necessity of setting this attribute? Sure. Hide a gadget. > And secondly should we notify Palm of there contradicting documents? I'd assume so. To whom, I don't have a clue. Posting the conflict here is a good start. ----- Original Message ----- From: "Philip Streck" <[EMAIL PROTECTED]> To: "Palm Developer Forum" <[EMAIL PROTECTED]> Sent: Monday, June 30, 2003 3:50 PM Subject: Gadget question > On page 145 of the Palm OS Programmers Companion V1 there is an example > of a FormGadgetHandlerType in which they set the gadgets visible > attribute to true as shown below: > > case formGadgetDrawCmd: > //Sent to active gadgets any time form is > //drawn or redrawn. > DrawGadget(); > gadgetP->attr.visible = true; > handled = true; > break; > > Then on page 250 of Palm OS Programmers Reference there is the > following statement: > > WARNING! PalmSource, Inc. does not support or provide > backward compatibility for the FormGadgetAttrType structure. > Never access its structure members directly, or your code may > break in future versions. Use the information below for debugging > purposes only. > > My first question is is there a functional necessity of setting this > attribute? > And secondly should we notify Palm of there contradicting documents? > > Thanks, > > Phil -Ezekiel Sanborn de Asis PalmSource Developer Support -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
