mail-archives/gtk-sharp-list/2004-December/005226.html

134 строки
4.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] Scrolled TreeView without scrollbars?
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:lists-christian%40rudh.se">
<META NAME="robots" CONTENT="index,nofollow">
<LINK REL="Previous" HREF="005224.html">
<LINK REL="Next" HREF="005228.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] Scrolled TreeView without scrollbars?
</H1>
<B>Christian Rudh
</B>
<A HREF="mailto:lists-christian%40rudh.se"
TITLE="[Gtk-sharp-list] Scrolled TreeView without scrollbars?">lists-christian@rudh.se
</A><BR>
<I>Sun, 12 Dec 2004 01:20:09 +0100</I>
<P><UL>
<LI> Previous message: <A HREF="005224.html">[Gtk-sharp-list] Scrolled TreeView without scrollbars?
</A></li>
<LI> Next message: <A HREF="005228.html">[Gtk-sharp-list] ANNOUNCEMENT: Mono SQL Query For GTK# 0.01 Development Release
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#5226">[ date ]</a>
<a href="thread.html#5226">[ thread ]</a>
<a href="subject.html#5226">[ subject ]</a>
<a href="author.html#5226">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>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 (&quot;MyWindow&quot;)
{
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
(&quot;ConnectionsConnectionsConnectionsConnections&quot;);
TreeView _treeView = new TreeView (_treeStore);
_treeView.AppendColumn (&quot;Connections&quot;, new CellRendererText (),
&quot;text&quot;, 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:
&gt;<i> I would not set any scrolling policy then.
</I>&gt;<i>
</I>&gt;<i> ScrolledWindow sw = new ScrolledWindow ();
</I>&gt;<i> this.PackStart (sw, true, true, 0);
</I>&gt;<i>
</I>&gt;<i> _treeStore = new TreeStore (typeof (string));
</I>&gt;<i> _rootIter = _treeStore.AppendValues (&quot;Connections&quot;);
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _treeView = new TreeView (_treeStore);
</I>&gt;<i> _treeView.AppendColumn (&quot;Connections&quot;, new
</I>&gt;<i> CellRendererText (), &quot;text&quot;, 0);
</I>&gt;<i> _treeView.HeadersVisible = false;
</I>&gt;<i>
</I>&gt;<i> sw.Add (_treeView);
</I>&gt;<i>
</I>&gt;<i> -----Original Message-----
</I>&gt;<i> From: <A HREF="mailto:gtk-sharp-list-admin@lists.ximian.com">gtk-sharp-list-admin@lists.ximian.com</A>
</I>&gt;<i> [mailto:<A HREF="mailto:gtk-sharp-list-admin@lists.ximian.com">gtk-sharp-list-admin@lists.ximian.com</A>] On Behalf Of Christian Rudh
</I>&gt;<i> Sent: Saturday, December 11, 2004 9:10 AM
</I>&gt;<i> To: <A HREF="mailto:gtk-sharp-list@ximian.com">gtk-sharp-list@ximian.com</A>
</I>&gt;<i> Subject: [Gtk-sharp-list] Scrolled TreeView without scrollbars?
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> Hi
</I>&gt;<i>
</I>&gt;<i> I have a TreeView with two columns inside a ScrolledWindow.
</I>&gt;<i>
</I>&gt;<i> If I add a long text to one of the columns, the window increases its witdh
</I>&gt;<i> to show all of the text. I don't want that.
</I>&gt;<i>
</I>&gt;<i> If I set the horizontal scrolling policy to auto or always the window width
</I>&gt;<i> isn't changed when the text is added which is good. But I now have a visible
</I>&gt;<i> scrollbar which I don't want.
</I>&gt;<i>
</I>&gt;<i> So is it somehow possible to have the window to not increase its witdh but
</I>&gt;<i> at the same time not show the scrollbar? So the user has to manually
</I>&gt;<i> increase the window width too see all of the text?
</I>&gt;<i>
</I>--
Christian Rudh &lt;<A HREF="mailto:lists-christian@rudh.se">lists-christian@rudh.se</A>&gt;
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI> Previous message: <A HREF="005224.html">[Gtk-sharp-list] Scrolled TreeView without scrollbars?
</A></li>
<LI> Next message: <A HREF="005228.html">[Gtk-sharp-list] ANNOUNCEMENT: Mono SQL Query For GTK# 0.01 Development Release
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#5226">[ date ]</a>
<a href="thread.html#5226">[ thread ]</a>
<a href="subject.html#5226">[ subject ]</a>
<a href="author.html#5226">[ author ]</a>
</LI>
</UL>
</body></html>