> Even more likely still is that it is programmer error. :-)

  that possibility was never out of my mind.
 
> >   when i compile the source code with gcc, the program runs, and
> >   no double buffering occurs - but as soon as i exit the program,
> >   i get a system crash. (requiring reset).
> 
> Events are the heart of PalmOS programming, and learning event-driven 
> programming is the major requirement for good PalmOS programming.
> 
> Events are like snail mail - you do what you like with those intended 
> for you, but you pass on those not meant for your eyes. Your code is 
> a gross violation of the Postal Act :-)
>

<snip>
 
> Your graphics code is called on EVERY event, bar one. So it is 
> valiantly trying to spin cubes as even frmCloseEvent and appStopEvent 
> are called. Talk about obnoxious code :) Perhaps there's a reason for 
> the crash you get on exit? :)
> 
> It probably should be in your Form handler, and DEFINITELY should be 
> after an "IF EVENT==nilEvent" type of statement.

  now this makes sense. :)
 
> Furthermore, your graphics 'library' is not even writing to the form 
> you display. You call the initialise function before entering the 
> event loop - so before your form is loaded and displayed. Yet the 
> init function stores away the (then) current draw window and later 
> uses that as the window to write to.

i have updated the code as follows (which i shall check now):

--
(mainEventHandler)

..
  switch (event->eType) {
 
    case frmOpenEvent:
         FrmDrawForm(FrmGetActiveForm());
 
         _Graphics_initialize();
         processed = TRUE;
 
         break;
 
    case frmCloseEvent:
         _Graphics_terminate();
         processed = TRUE;
 
         break;

    default:
         break;
  }
 
  if (event == nilEvent) {

    < do graphics animation in here >  

    processed = TRUE;
  }

  return (processed);

--

> I don't use gcc so I won't be debugging your code further.
> I thought I'd post this to defend the gcc writers, and on behalf of 
> any students you dare to fail in the Programming In C course you are 
> lecturing :-)

  of course i am not teaching PalmOS programming? :>> 

  elementary C has nothing to do with these problems. the problem
  is getting an understanding of how everything fits together -
  and the palmOS is a very different development environment.

  the sources on the net also fail to meet some of these 
  requirements (you have discussed here) - thats probably 
  why i overlooked them.

  but thats the whole purpose of these discussion lists,
  and thats to get these problems out - mainly either to
  slackness or forgetting to RTFM (i admit i have done
  that a number of times)..

  but at least this can be placed in an FAQ or something.
  (as not much is said about it anywhere else - and the
  examples are hard to understand).

> Keep up the PalmOS programming, just don't go blaming the tools for 
> your mistakes. They work. You are writing to a forum with many people 
> successfully using these tools.

  i checked the gcc headers.. everything is fine, they match
  those in the ASDK and CW.. 

  cheers.

az.
--
Aaron Ardiri 
Lecturer                       http://www.hig.se/~ardiri/
University-College i G�vle     mailto:[EMAIL PROTECTED]
SE 801 76 G�vle SWEDEN       
Tel: +46 26 64 87 38           Fax: +46 26 64 87 88
Mob: +46 70 352 8192           A/H: +46 26 10 16 11

Reply via email to