title: PyGTK - Retrieve / Save formatted text TextBuffer/Sqlite3
body: <p>I am implementing text formatting between <code>gtk.TextBuffer</code>(across <code>gtk.TextView</code>) and <code>Sqlite3 table</code>. Text formatting in <code>TextView</code> is working normally, my problem is to save and retrieve the formatted text in a <code>Sqlite3 table</code> (TEXT type field).</p>
  
  <p>Basically I format the text in a <code>TextBuffer</code> as follows: </p>
  
  <pre><code>class db(object):
     text_tag = 0
  
  def format(self, constant): 
          if self.textbuffer.get_selection_bounds() != ():
              start, end = self.textbuffer.get_selection_bounds()
              self.textbuffer.apply_tag(constant, start, end)
  
  def on_bold_btn_clicked(self, widget):
          db.text_tag = db.text_tag+1
          self.tt_bold = gtk.TextTag("bold_"+str(db.text_tag))
          self.tt_bold.set_property("weight", pango.WEIGHT_BOLD) 
          self.TextTagTable.add(self.tt_bold)
  
          self.format(self.tt_bold)
  </code></pre>
  
  <p>at saving time in table I retrieve the text formatted as follows: </p>
  
  <pre><code>textbuffer.get_text (textbuffer.get_start_iter (), textbuffer.get_end_iter (), include_hidden_chars = True)
  </code></pre>
  
  <p>As far as I understood the documentation <a href="http://www.pygtk.org/docs/pygtk/class-gtktextbuffer.html#method-gtktextbuffer--get-text" rel="nofollow">gtk.TextBuffer.get_text</a>, texts with tags are deleted if include_hidden_chars is False, so when True, the text would be saved correctly formatted?</p>
  
  <p>The formatted text display object's is a TextView, which at runtime, show correctly the formated text, but apparently, the text is not being saved / restored with the formatting done.</p>
  
  <p>Does anyone know if I forgot something?</p>
  
  <p>Thank you.</p>