[Gtk-sharp-list] ScrolledWindow and Canvas don't scroll (for me)

Tom Cook tom.cook@adelaide.edu.au
Fri, 07 May 2004 22:44:12 +0930

Hi all,

I an new here, and newish to GTK+, so sorry if I am doing something
stupid, but I can't find an answer to this.

I am trying to create a complex component using the Gnome canvas.  That
is going well.  But when I try to make it scroll, by doing this to it:

App app = new App(...);
Canvas canvas = new Canvas();
CanvasGroup root = canvas.Root();
canvas.Height = canvas.Width = 2000;
... add stuff to canvas ...
ScrolledWindow sw = new ScrolledWindow();
sw.SetPolicy( PolicyType.Always, PolicyType.Automatic );
sw.Add( canvas );
((Box)app.Child).Add( sw );
... show the app ...

What I get is a window with a horizontal scrollbar that can't be
scrolled, it looks like because the component it contains is no larger
than the window.  But if I resize the window, I can see more of the
canvas and what is in it, so the component is bigger than the window, so
it should scroll.

What am I doing wrong here???