Ok, so I'm completely new to PalmOS (so please bear with the bad form). I'm
just trying to figure out how preferences are saved and accessed. I'm using
GCC, SDK 3.5 and POSE. My application gets no compiler errors. What I'm
trying to do use a bunch of check boxes to set my preferences (70 to be
exact - each one is sequentially numbered in the header file). When my
preference form opens I want to read and display the preferences. This part
works fine except it doesn't quite draw all of the checkmark on the
screen(it's missing the upper right portion of the check mark---the part
outside of the box).
Then when I leave the preference form (in this case, when I go to the main
menu) I want to save any changes that have been made. This is where the
problem is. When I hit the Menu silk screen button, all my menus are
displayed properly. However, when I select a menu item (any menu item) I get
"TestApp has just performed an illegal operation. It performed a 'bus
error'". When I comment out the offending code, I don't have any problems
manuevering with the menus...but (of course) none of my preferences have
been saved.
Please help!
Lorri Sloane
[EMAIL PROTECTED]
int checkboxobject;
FormPtr frmP;
ControlPtr checkbox;
Boolean value;
int i;
switch (eventP->eType)
case menuEvent:
// first save state of Check boxes to Preferences
checkboxobject = LabelBox10; //set starting box
// This is the start of the offending code
for (i = 0 ; i < 70 ; i++) {
checkbox = FrmGetObjectPtr (frmP, FrmGetObjectIndex (frmP,
checkboxobject));
value = CtlGetValue (checkbox);
prefs.ExchCheckbox[i].Used = value;
checkboxobject++;
}
// This is the end of the offending code
return MainMenuDoCommand(eventP->data.menu.itemID);
case frmOpenEvent:
frmP = FrmGetActiveForm();
// get saved state from Preferences
checkboxobject = LabelBox10; //set starting box
for (i = 0 ; i < 70 ; i++) {
checkbox = FrmGetObjectPtr (frmP, FrmGetObjectIndex (frmP,
checkboxobject));
value = prefs.ExchCheckbox[i].Used;
checkboxobject++;
CtlSetValue(checkbox, value);
}
FrmDrawForm ( frmP);
handled = true;
break;
}
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html