[Gtk-sharp-list] Scrolled TreeView without scrollbars?

Christian Rudh lists-christian@rudh.se
Sun, 12 Dec 2004 01:20:09 +0100


Hi

Thanks for your input, I followed your example and did the following:
(I added the VBox since Window doesn't have .PackStart, don't know if it
was how you meant)


public class MyWindow : Window {
	
	public MyWindow () : base ("MyWindow")
	{
		VBox b = new VBox();
		this.Add(b);
		
        ScrolledWindow sw = new ScrolledWindow ();
        b.PackStart (sw, true, true, 0);
      	
      	TreeStore _treeStore = new TreeStore (typeof (string));
		TreeIter _rootIter = _treeStore.AppendValues
("ConnectionsConnectionsConnectionsConnections");
		TreeView _treeView = new TreeView (_treeStore);  
		_treeView.AppendColumn ("Connections", new CellRendererText (),
"text", 0);
		_treeView.HeadersVisible = false;

		sw.Add (_treeView);
		this.ShowAll ();
	}
}

But this gives the default behaviour: If i resize the window so it is
narrower than the text in the column, the horizontal scrollbar
automatically appears.

/Christian


On Sat, 2004-12-11 at 17:39 -0500, Daniel Morgan wrote:
> I would not set any scrolling policy then.
> 
> 			ScrolledWindow sw = new ScrolledWindow ();
> 			this.PackStart (sw, true, true, 0);
> 
> 			_treeStore = new TreeStore (typeof (string));
> 			_rootIter = _treeStore.AppendValues ("Connections");
> 
> 			
> 			_treeView = new TreeView (_treeStore);	
> 			_treeView.AppendColumn ("Connections", new
> CellRendererText (), "text", 0);
> 			_treeView.HeadersVisible = false;
> 
> 			sw.Add (_treeView);
> 
> -----Original Message-----
> From: gtk-sharp-list-admin@lists.ximian.com
> [mailto:gtk-sharp-list-admin@lists.ximian.com] On Behalf Of Christian Rudh
> Sent: Saturday, December 11, 2004 9:10 AM
> To: gtk-sharp-list@ximian.com
> Subject: [Gtk-sharp-list] Scrolled TreeView without scrollbars?
> 
> 
> Hi
> 
> I have a TreeView with two columns inside a ScrolledWindow.
> 
> If I add a long text to one of the columns, the window increases its witdh
> to show all of the text. I don't want that.
> 
> If I set the horizontal scrolling policy to auto or always the window width
> isn't changed when the text is added which is good. But I now have a visible
> scrollbar which I don't want.
> 
> So is it somehow possible to have the window to not increase its witdh but
> at the same time not show the scrollbar? So the user has to manually
> increase the window width too see all of the text?
> 
-- 
Christian Rudh <lists-christian@rudh.se>