mail-archives/gtk-sharp-list/2004-April/003921.html

110 строки
4.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] treeview header size
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:andrei.ivanov%40ines.ro">
<META NAME="robots" CONTENT="index,nofollow">
<LINK REL="Previous" HREF="003912.html">
<LINK REL="Next" HREF="003905.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] treeview header size
</H1>
<B>Andrei Ivanov
</B>
<A HREF="mailto:andrei.ivanov%40ines.ro"
TITLE="[Gtk-sharp-list] treeview header size">andrei.ivanov@ines.ro
</A><BR>
<I>Sat, 24 Apr 2004 23:16:23 +0300 (EEST)</I>
<P><UL>
<LI> Previous message: <A HREF="003912.html">[Gtk-sharp-list] treeview header size
</A></li>
<LI> Next message: <A HREF="003905.html">[Gtk-sharp-list] Gtk# 0.18 on WinXP : Desktop freezes if window is moved
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#3921">[ date ]</a>
<a href="thread.html#3921">[ thread ]</a>
<a href="subject.html#3921">[ subject ]</a>
<a href="author.html#3921">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>
On Fri, 23 Apr 2004, John Luke wrote:
&gt;<i> On Thu, 2004-04-22 at 14:17 +0300, Andrei Ivanov wrote:
</I>&gt;<i> &gt; Hello,
</I>&gt;<i> &gt; I've created a treeview and I'm trying to alter the size of its header.
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; The only way that I found about how to get a reference to the buttons
</I>&gt;<i> &gt; that create the header is like this:
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; CellRendererText renderer = new CellRendererText();
</I>&gt;<i> &gt; TreeViewColumn column = new TreeViewColumn(&quot;Name&quot;, renderer, &quot;text&quot;, 0);
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; column.Widget = new Gtk.Label(&quot;aa&quot;);
</I>&gt;<i> &gt; column.Widget.Show();
</I>&gt;<i> &gt; treeview1.AppendColumn(column);
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; //column.Widget -&gt; Label
</I>&gt;<i> &gt; //column.Widget.Parent -&gt; Alignment
</I>&gt;<i> &gt; //column.Widget.Parent.Parent -&gt; HBox
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; Gtk.Button header = (Gtk.Button)column.Widget.Parent.Parent.Parent;
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; My problem is that I don't know how to alter the size of that button.
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; In glade, the common properties tab of a normal button include width and
</I>&gt;<i> &gt; height, but the header button doesn't seem to have them.
</I>&gt;<i> &gt;
</I>&gt;<i>
</I>&gt;<i> TreeViewColumn has FixedWidth, MaxWidth, and MinWidth properties, is
</I>&gt;<i> that what you want? Or if you add the CellRenderer with PackStart to the
</I>&gt;<i> column you can specify if you want it to expand or not.
</I>&gt;<i>
</I>&gt;<i> This might be useful if it helps to have examples in C of the TreeView:
</I>&gt;<i> <A HREF="http://scentric.net/tutorial/">http://scentric.net/tutorial/</A>
</I>&gt;<i>
</I>
Unfortunately, that doesn't help me. I'm not trying to modify the column,
but the header of the column, and more exactly, the distance between the
label and the edge of the button. I've managed to modify the size of the
button, but not the padding :(
This is what I've been doing:
//nothing changes
(column.Widget as Label).Ypad = 0;
Gtk.Box box = (Gtk.Box)column.Widget.Parent.Parent;
//nothing changes
box.Spacing = 0;
//it works, doesn't do what I want
box.HeightRequest = 10;
//doesn't make any difference
box.SetChildPacking(column.Widget.Parent, false, false, 0, Gtk.PackType.Start);
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI> Previous message: <A HREF="003912.html">[Gtk-sharp-list] treeview header size
</A></li>
<LI> Next message: <A HREF="003905.html">[Gtk-sharp-list] Gtk# 0.18 on WinXP : Desktop freezes if window is moved
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#3921">[ date ]</a>
<a href="thread.html#3921">[ thread ]</a>
<a href="subject.html#3921">[ subject ]</a>
<a href="author.html#3921">[ author ]</a>
</LI>
</UL>
</body></html>