Scrolling, nested widgets, and stuff



Greetings !

I am struggling with the following problem:

I am modifying an existing app, and I need the
following behaviour:
- there is a widget that displays text
- it can be scrolled with a scrollbar
  (no problem so far)
- when the scrollbar is not on the very bottom,
another text-displaying widget should appear in the
bottom area, showing the bottommost portion of the
text. This widget should not be scrollable.

I have no problem with the displaying/hiding part, but
I can't figure out the layouting stuff correctly.
The scrollbar needs to be fully visible at all times,
and the secondary text-widget should be partially
oevrlapping the primary one, making the illusion as if
the text-widget got split in two.

i.e., like this:

+--------------+--+
|              |/\|
|              |  |
|              |  |
|   Text-1     |++|
|              |  |
|              |  |
|              |  |
+--------------+  |
|              |  |
|   Text-2     |  |
|              |\/|
+--------------+--+

With text2 auto-disappearing when the scrollbar
scrolls to the very bottom...

I can imagine two possible solutions to this problem,
but I failed to persuade GTK to make things work in
any of the two ways...

1. text2 displays on top of text1, overlapping it
partially. It still needs to be correctly
moved/resized, though - failed, because layout manager
jumped in and resized text1.

2. Space splits amongst text1 and text2, scrollbar
remains full-height. Here I failed to persuade the
text1 not to keep enlarging the window to huge sizes
as new text was being entered to it (it had no
scrollbar, as the scrollbar was external - tied
Adjustment stuff to it, but it didn't help much).
Then, after some fiddling, I got to the state where
neither of the text-windows nor the scrollbar is
displayed - and I have no idea why :(

Interface is done using a .glade file, mostly editing
by hand, but opening the file in glade shows the
layout correctly - running it does not.

I hope that all this is making some sense...

Ideas ?

/ Tomas




                
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 




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