Re: Setting the right size



Vlad Harchev <hvv@hippo.ru> wrote on 23-Aug-00:

>  Just measure the height of font GtkText will use (seems it's in
> GTK_WIDGET(text)->style->font), compute how much it will need for two lines
> exactly (study all those details), and 
> 	gtk_widget_set_usize(text,-1,proper_height);

For the record, this seems to do the trick,

	gtk_widget_realize(GTK_WIDGET(info));
	int h = gdk_string_height(GTK_WIDGET(info)->style->font, "Åg");
	gtk_widget_set_usize(GTK_WIDGET(info), -1, 4+2*h);



> If it's really only "text output" as you called - then you may use
> GtkLabel - it allows multiline labels (and it allows underlining
> text).

I like it as GtkText since it gives me the same style as other text
areas.

Thanks for your help.

-- 
Regards, Anders





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