Scrolling inside a box / multiple widgets




Hello,

I am a bit annoyed when trying to scroll two TextView at once.

First of all, let me explain a bit what I am doing. I want to do a code editor without the use of SourceView (I know this is bad). To present the code, I want to use 2 TextView, one which will display and edit the code and the other one which will display the line numbers (along with other information). Each time a new line happens I scroll at the cursor position. Unfortunately I can't achieve what I'd like.

Now, about what I'm doing:

case 1: I put my 2 TextView inside a box which is inside a single ScrollWindow. With this method, the scroll window effectively works (the bar gets smaller and smaller) but it never follow the cursor.

case 2: I put my TextView each inside a ScrollWindow, each inside a case of the box. With this method, I could effectively make the code TextView to scroll and focus on the cursor, but the line counter TextView also displays a scroll bar, which I'd like not to display.

If I set the ScrollWindow properies of the line counter TextView so that it never displays the scroll bars, then my window resizes.

What I would like to know is what an experienced Gtk+ user would do to do the trick: scroll the code TextView at the cursor position and scroll the line counter TextView at exactly the same position ?

And what if I would like to add other widgets (tree views and so on) ?

Is it possible to calculate the scroll values in a good way if I would like to use a single ScrollWindow in which I put a Box ?

Thanks in advance.



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