Re: Formating text in treeview



On Thu, 2007-01-25 at 21:10 -0200, Arthur Maciel wrote:
> I've read the gtkmm docs on it, but still don't know: will I be able
> to have just part of the text inside the treeview field in bold?

  Gtk::CellRendererText *render = Gtk::manage(new Gtk::CellRendererText());

  Gtk::TreeView::Column *viewcol = Gtk::manage(
    new Gtk::TreeView::Column ("Title", *render));
  viewcol->add_attribute (render->property_markup (), modelcol);
  treeview->append_column (*namecol);

(where treeview is a Gtk::TreeView*, and modelcol is a
Gtk::TreeModelColumn<Glib::ustring>).

Then, you can use pango markup such as "Some <b>bold</b> and
<i>italic</i> text" as the text in your model.

John




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]