Re: Problem enabling Pango markup in a TreeView
- From: Murray Cumming <murrayc murrayc com>
- To: Hugo Vincent <hugo vincent gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: Problem enabling Pango markup in a TreeView
- Date: Fri, 02 Feb 2007 11:36:55 +0100
On Fri, 2007-02-02 at 22:48 +1300, Hugo Vincent wrote:
> Hi everyone,
>
> I want to use Pango markup in text in a TreeView.
>
> This seems to have been covered before
> (http://www.nabble.com/Formating-text-in-treeview-t3119030.html) but I
> am unclear on how to use it.
[snip]
>
> // Add the Properties TreeView's view columns
> m_TreeView->append_column("Property", m_PropertiesColumns.m_PropName);
This convenience functions connects the "text" property to the view
column. But later you explicitly connect the "markup" property as well.
You'll need to create the CellRenderer manually instead of using the
append_column() convenience function. There's more about that here:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/ch08s02.html#id2525308
> m_TreeView->append_column("Value", m_PropertiesColumns.m_PropValue);
>
> // Enable Pango markup for both columns, and make columns resizeable
> Gtk::TreeViewColumn *col = m_TreeView->get_column(0);
> Gtk::CellRendererText *renderer = dynamic_cast<Gtk::CellRendererText*>(
> col->get_first_cell_renderer());
> col->add_attribute(renderer->property_markup(),
[snip]
--
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]