[Gtk-sharp-list] How do I control the text appearance of a Gtk.Entry widget ?

Brad Langhorst brad at langhorst.com
Sun Mar 9 11:05:20 EDT 2008

On Sun, 2008-03-09 at 09:10 +0100, Jesper K. Pedersen wrote:

> I did also manage after several hours of trial and error figure out
> that it is somewhat cumbersome changing size of the displayed font in
> the entry.
> <-- excerpt from my code -->
> Gtk.Style entstyle = entry_winWoDetail_wo.Style;
> entstyle.FontDescription.Size = (int) ( entstyle.FontDescription.Size *
>                                         Pango.Scale.Large );
> entry_winWoDetail_wo.ModifyFont(entstyle.FontDescription);
> entry_winWoDetail_ac.ModifyFont(entstyle.FontDescription);
> entry_winWoDetail_description.ModifyFont(entstyle.FontDescription);
> entry_winWoDetail_opened.ModifyFont(entstyle.FontDescription);

I understand what you mean by trial and error, I've been experiencing
that myself.  I'm glad to hear that I'm not the only one who finds Gtk
un-intuitive... it is getting better for me now.

Keep in mind that you can also use the "usemarkup" feature on some
controls for a bit of text formatting, but only for non-dynamic stuff I
think (not gtkEntry)

I've found that looking at other applications is helpful. Especially I
use the demo apps and the f-spot (the photo editor).

best wishes!


More information about the Gtk-sharp-list mailing list