Ecere SDK/eC Forums

Ecere Developers Community

按ECS退出(exit on escape)

来自中国的朋友,欢迎您在本版面使用中文讨论问题。请注意,如果您想得到不懂中文的人的帮助,请同时提供英文译文。
Help and discussions in Chinese.

按ECS退出(exit on escape)

Postby liqi98136 » Wed Mar 10, 2010 8:31 am

Code: Select all
import "ecere"

class Form1 : Window
{
   text = "例子:按ECS退出";
   background = black;
   borderStyle = sizable;
   hasClose = true;
   size = { 640, 480 };
   
   bool OnKeyDown(Key key, unichar ch)
   {
      switch(key)
      {
      case escape:
            Destroy(0);
            return false;
      }
      return true;
   }
}

Form1 form1 {};
liqi98136
 
Posts: 53
Joined: Sun Jan 17, 2010 11:37 pm

Return to 欢迎使用中文讨论

Who is online

Users browsing this forum: Google [Bot] and 1 guest