int ViewSetTouch(int vw, int tc);


Assign the Touch that is associated with a View.


Return Value


Return value is not used.





View handle returned from ViewAdd().



Touch handle returned from TouchAdd().




The ViewSetTouch() function assigns a Touch to be associated with a view area.




Available in DragonFireSDK 1.0 and later.




Description: This example will set up a view and a Touch area and assign the touch area to the View.


#include "DragonFireSDK.h"


int OnTouchArea(int id, int event, int x, int y);


void AppMain()


  int ViewHandle;

  int TouchHandle;


  ViewHandle = ViewAdd("Ball.png", 0, 0);

  TouchHandle = TouchAdd(0, 0, 100, 100, OnTouchArea, 0);

  ViewSetTouch(ViewHandle, TouchHandle);  



int OnTouchArea(int id, int event, int x, int y)     //event: 1=down, 2=move, 3=up


  if (event == 3)

  {   // touch up (touched and released)

      // something

     printf("You touched the touch area\n");

    return 0;




void AppExit()





void OnTimer()