Getting a widget to compute its height when given a fixed width
- From: "Wynand Winterbach" <wynand winterbach gmail com>
- To: gtk-list gnome org
- Subject: Getting a widget to compute its height when given a fixed width
- Date: Mon, 21 Apr 2008 15:03:43 +0200
Hi everyone
I am working on a TreeView which uses a fairly complicated edit
widget. The edit widget contains a variable number of TextViews and I
am required to display the TextViews such that all of the text
contained with them will be displayed.
Therefore, given the width of the editor widget, I need the heights of
the sub-widgets in the editor widget (such that the above mentioned
requirement is satisfied).
At the moment I am computing the heights "by hand"; for example, I do
my own text layouts with Pango and then get the required heights.
I have had no success in getting widgets to report their "ideal"
heights when given a width. I can't use gtk_window_set_geometry_hints,
because I need to compute heights before the widgets receive windows
on which to draw themselves (if I am mistaken here, please help me
out; it seems I really have much to learn about GTK). I have tried
gtk_widget_set_size_request, but to no avail.
I have seen similar questions in the mailing list archive, although
the difference here is that I want to compute heights without having
to draw any widgets (if that is possible).
Thanks in advance
Wynand
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]