Logo Search packages:      
Sourcecode: zim version File versions  Download package

def zim::gui::pageview::TextBuffer::insert_bullet_at_cursor (   self,
  bullet,
  raw = False 
)

Insert a bullet plus a space at the cursor position.
If 'raw' is True the space will be omitted and the check that
cursor position must be at the start of a line will not be
enforced.

Definition at line 610 of file pageview.py.

00610                                                           :
            '''Insert a bullet plus a space at the cursor position.
            If 'raw' is True the space will be omitted and the check that
            cursor position must be at the start of a line will not be
            enforced.
            '''
            if not raw:
                  insert = self.get_iter_at_mark( self.get_insert() )
                  assert insert.starts_line(), 'BUG: bullet not at line start'

            with self.user_action:
                  if bullet == BULLET:
                        if raw:
                              self.insert_at_cursor(u'\u2022')
                        else:
                              self.insert_at_cursor(u'\u2022 ')
                  elif bullet in bullet_types:
                        stock = bullet_types[bullet]
                        self.insert_icon_at_cursor(stock)
                        if not raw:
                              self.insert_at_cursor(' ')
                  else:
                        logger.warn('Unkown bullet type: %s', bullet)
                        if raw:
                              self.insert_at_cursor(u'\u2022')
                        else:
                              self.insert_at_cursor(u'\u2022 ')

                  if not filter(_is_indent_tag, self._editmode_tags):
                        iter = self.get_iter_at_mark(self.get_insert())
                        self.set_indent_for_line(0, iter.get_line())
                              # bullets always need indenting


      def set_textstyle(self, name):


Generated by  Doxygen 1.6.0   Back to index