[gtkada] Different font sizes GtkAda Win32

Emmanuel Briot briot at gnat.com
Tue Dec 5 10:12:06 CET 2000


 > Is there any inherent problem with attempting to use a different font size
 > for some parts of an application ? For example, I have a dialog which has
 > several different "Gtk_Label"s. I attempted to change the font size using
 > the scheme :
 > 
 >           - get the style of the dialog
 >           - load a new font with a different size
 >           - modify the style with this new font
 >           - widget.push the above style
 >           - create a label
 >           - widget.pop_style


You have to modify a *copy* of the style.
For efficiency reasons, the styles are shared between all widgets, so you need
to:

   declare
      New_Style : Gtk_Style;
   begin
      Copy (New_Style, Get_Style (Dialog));
      modify style with the new font
      Gtk.Widget.Set_Style (Dialog, New_Style);
   end;

Emmanuel




More information about the gtkada mailing list