text widget weirdness
- From: Alex Chiang <achiang2 rsn hp com>
- To: gtk-list gnome org
- Subject: text widget weirdness
- Date: Tue, 27 Jun 2000 14:15:30 -0500
I'm working on something that listens to a network socket, receives
data, and displays it into various text widgets. As data comes across
the wire, the packet is tagged with a cookie (an int), to differentiate
which data will be displayed in which text widget.
The interface packing hierarchy looks somewhat like this:
table -> frame[i] -> scrolled window[i] -> text widget[i]
where i is used to indicate that each table cell contains a single frame
(which contains the scrolled window, which contains the text widget, etc.)
The table is 20 rows by 1 column. The application creates the
frame/swindow/text object-thingies during run-time, since the other end
of the socket can send over new data which should be put into its own
frame/swindow/text object-thingy (and then inserted into the approprate
place in the table). This means that although there are 20 cells, not
every cell contains a frame/swindow/text thing.
So what's the problem? Well, I created the table as non-homogeneous, but
all of the frame/swindow/text objects are the same size. To me, this is
strange since the text widgets themselves contain differing amounts of
data, viz. some contain 4 lines of data while others have 30 lines of data.
This is not the behavior I desired. What I wanted was for the
frame/swindow/text objects to be all of differing sizes. Is there a way
to set the size of the frame widget (or swindow widget or text widget)?
gtk_widget_set_usize() has no visible effect, as far as I can tell.
Also, they are attached to the table with
GTK_FILL | GTK_EXPAND | GTK_SHRINK in both the x and y directions.
The strange thing that I noticed was the following:
Let's say that there are only two text widgets, text0 and text1.
text0 contains 32 lines of data, and a scrollbar appears
(gtk_policy_automatic on the scrolled windows that the text widgets are
packed into) since the data doesn't fit into the viewable area. Upon
scrolling down to the bottom, there is no white space after the data.
All good so far.
text1 contains only 2 lines of data, yet a scrollbar also appears in
/its/ scrolled window. Lots of white space appears after the data,
approximately 30 lines of white space, yet the data itself contains no
trailing white space. For all purposes, text1 seems to contain the same
amount of data as text0. The scrollbar thumbs appear to be the same
size, indicating an identical amount of data within the respective
If we go further and create and insert a text2 widget with 100 lines of
data, then the scrollbar thumbs on all of the text widgets will change
size and match the widget with the most data, and you will be able to
scroll even more whitespace in text0 than before (98 lines of
What gives? Is it because not every cell in the table has something
attached to it? Is the text widget buggy? Am I a moron? What is the air
speed of a swallow?
Your help would be greatly appreciated (and apologies for the long
Alex Chiang <> verily, the thoughts contained withal be mine own,
Hewlett-Packard <> and not, as it were, of mine gracious employer
I will make sure that my doomsday device is up to code and properly
-how I will rule my Evil Empire
] [Thread Prev