[Gtk-sharp-list] Fonts in TreeView

Jeha j-halverson at rr.em-net.ne.jp
Sat Apr 20 01:59:24 UTC 2013


Did you ever find out how to get your bold text in the header?

Here is how I do this in my application, by using a different "widget" in
header you can do just about anything:

     TreeViewColumn Col0=new TreeViewColumn();
     Pango.FontDescription titleFont =
BundleSelectionComboBox.Style.FontDescription;
     titleFont.Size = (int)(9 * Pango.Scale.PangoScale);
     Gtk.Label aLabel = new Gtk.Label ();
     aLabel.Markup = "*" + Catalog.GetString("TITLE HEADER") + "*";
     aLabel.UseMarkup = true;
     aLabel.ModifyFont (titleFont);
     aLabel.Show ();
     Col0.Widget = aLabel;
     Col0.Alignment = 1;

This does more than you need, but shows some of the things you can do to get
your headers to look just right for your purposes.  I have strunk the font
down to 90% standard size, used markup to make it bold, aligned it, and used
getstring around the title itself to ensure you can allow for
multilingualization of your header titles.

Hope that helps.

Jeff





--
View this message in context: http://mono.1490590.n4.nabble.com/Fonts-in-TreeView-tp4659209p4659426.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.


More information about the Gtk-sharp-list mailing list