sdlterm/cython/sdlterm.pyx
changeset 53 c4263588b716
parent 50 c5b8b9d2da95
child 54 86b84535726e
equal deleted inserted replaced
52:50a1857557da 53:c4263588b716
    43         void commit()
    43         void commit()
    44 
    44 
    45         int prepare_attr(int fg, int bg, int style)
    45         int prepare_attr(int fg, int bg, int style)
    46         void set_attr(int value)
    46         void set_attr(int value)
    47 
    47 
    48         void set_cursor(int x, int y)
    48         void show_cursor(int x, int y)
    49         void show_cursor(bool visible)
    49         void hide_cursor()
    50 
    50 
    51         void get_next_event(Event event)
    51         void get_next_event(Event event)
    52 
    52 
    53         int get_width()
    53         int get_width()
    54         int get_height()
    54         int get_height()
    80     def prepare_attr(self, fg, bg, style):
    80     def prepare_attr(self, fg, bg, style):
    81         return self.thisptr.prepare_attr(fg, bg, style)
    81         return self.thisptr.prepare_attr(fg, bg, style)
    82     def set_attr(self, value):
    82     def set_attr(self, value):
    83         self.thisptr.set_attr(value)
    83         self.thisptr.set_attr(value)
    84 
    84 
       
    85     def show_cursor(self, x, y):
       
    86         self.thisptr.show_cursor(x, y)
       
    87     def hide_cursor(self):
       
    88         self.thisptr.hide_cursor()
       
    89 
    85     def get_next_event(self):
    90     def get_next_event(self):
    86         self.thisptr.get_next_event(self.event)
    91         self.thisptr.get_next_event(self.event)
    87         event = self.event
    92         event = self.event
    88         if event.type == event.MOUSEMOVE:
    93         if event.type == event.MOUSEMOVE:
    89             return ('mousemove', event.mouse.x, event.mouse.y)
    94             return ('mousemove', event.mouse.x, event.mouse.y)
    99                 keyname = None
   104                 keyname = None
   100             char = event.key.unicode
   105             char = event.key.unicode
   101             if char == '\x00':
   106             if char == '\x00':
   102                 char = None
   107                 char = None
   103             return ('keypress', keyname, char)
   108             return ('keypress', keyname, char)
       
   109         if event.type == event.RESIZE:
       
   110             return ('resize',)
   104         if event.type == event.QUIT:
   111         if event.type == event.QUIT:
   105             return ('quit',)
   112             return ('quit',)
   106         return ('unknown',)
   113         return ('unknown',)
   107 
   114 
   108     property width:
   115     property width: