You are not logged in.
Pages: 1
Hello
I'm currently trying to put together a simple text editor using Vala, just for learning.
In this text editor I have a Label which contains the line numbers and a TextView which is the editor itself, these two are inside Box.
Since I want to allow scrolling I've put the box inside a Viewport since the Box isn't a scrollable widget and then I've put the Viewport inside a ScrolledWindow.
My Code looks like this:
var hbox = new Box(Orientation.HORIZONTAL, 0);
var viewport = new Viewport(null, null);
var scroll = new ScrolledWindow(null, null);
hbox.pack_start(line_numbers, false, true, 0);
hbox.pack_start(this, true, true, 0);
viewport.add(hbox);
scroll.set_policy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC);
scroll.add(viewport);
The problem is that a get a 2px space around the Box when using the Viewport, if I remove the Viewport the space disappears but then scrolling won't work.
Anyone have any idea why the viewport adds this space and how to get rid of it?
Thanks
Last edited by Lazze (2011-10-19 21:33:48)
Offline
Pages: 1