按ECS退出(exit on escape)

来自中国的朋友,欢迎您在本版面使用中文讨论问题。请注意,如果您想得到不懂中文的人的帮助,请同时提供英文译文。
Help and discussions in Chinese.
Post Reply
liqi98136
Posts: 53
Joined: Sun Jan 17, 2010 11:37 pm

按ECS退出(exit on escape)

Post by liqi98136 »

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 {};
Post Reply