mail-archives/gtk-sharp-list/2006-April/007096.html

145 строки
5.0 KiB
HTML
Исходник Обычный вид История

2019-06-06 22:02:55 +03:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] Background Coloring: Tables, HBoxes, VBoxes
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Background%20Coloring%3A%20Tables%2C%20HBoxes%2C%20VBoxes&In-Reply-To=">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="007095.html">
<LINK REL="Next" HREF="007097.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] Background Coloring: Tables, HBoxes, VBoxes</H1>
<B>Graham Oneale</B>
<A HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Background%20Coloring%3A%20Tables%2C%20HBoxes%2C%20VBoxes&In-Reply-To="
TITLE="[Gtk-sharp-list] Background Coloring: Tables, HBoxes, VBoxes">graham at resonline.com.au
</A><BR>
<I>Mon Apr 17 03:07:52 EDT 2006</I>
<P><UL>
<LI>Previous message: <A HREF="007095.html">[Gtk-sharp-list] Reg. gst-sharp.
</A></li>
<LI>Next message: <A HREF="007097.html">[Gtk-sharp-list] Background Coloring: Tables, HBoxes, VBoxes
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#7096">[ date ]</a>
<a href="thread.html#7096">[ thread ]</a>
<a href="subject.html#7096">[ subject ]</a>
<a href="author.html#7096">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Still waiting for a reply on this,
Hope somebody can help.
Graham.
-----Original Message-----
From: Graham Oneale
Sent: Wednesday, 22 March 2006 8:59 AM
To: 'Michael Hutchinson'
Subject: RE: [Gtk-sharp-list] Background Coloring: Tables, HBoxes,
VBoxes
Hi Michael,
Thanks for the quick response. This works perfectly when setting the bg
color of the window, however if you attempt to do a myTable.modifyBg()
it fails. Or a box container of any sort.
Any ideas what items I can apply styles to?
Thanks
-----Original Message-----
From: Michael Hutchinson [mailto:<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">m.j.hutchinson at gmail.com</A>]
Sent: Wednesday, 22 March 2006 4:03 AM
To: Graham Oneale
Cc: <A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">gtk-sharp-list at lists.ximian.com</A>
Subject: Re: [Gtk-sharp-list] Background Coloring: Tables, HBoxes,
VBoxes
On 3/21/06, Graham Oneale &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">graham at resonline.com.au</A>&gt; wrote:
&gt;<i>
</I>&gt;<i> Is it possible to set a background color on any of these widgets?
</I>&gt;<i>
</I>&gt;<i> I have an application in which certain container objects will require
</I>a
&gt;<i> background color and foreground color.
</I>
<A HREF="http://ometer.com/gtk-colors.html">http://ometer.com/gtk-colors.html</A> has some useful info.
It can sometimes be tricky to determine where a widget is getting its
colour choice from, whether it's using Fg, Base, or Bg, and which
state it's using.
It's made harder when some widgets simply defer to the background of
the widgets behind them. Tthis is the case with containers' borders.
Try the following code:
using System;
using Gtk;
class WindowTester {
static void Main ()
{
Application.Init ();
Window window = new Window (&quot;This is a window&quot;);
window.DeleteEvent += delegate {Application.Quit ();};
window.SetDefaultSize (200, 200);
Table tab = new Table (2, 2, true);
window.Add (tab);
tab.BorderWidth = 10;
tab.Attach (new Button (&quot;One&quot;), 0, 1, 0, 1);
tab.Attach (new Button (&quot;Two&quot;), 0, 1, 1, 2);
tab.Attach (new Button (&quot;Three&quot;), 1, 2, 0, 2);
window.ModifyBg (StateType.Normal, new Gdk.Color(255, 0, 0));
window.ShowAll ();
Application.Run ();
}
}
Hope this helps,
Michael Hutchinson
_______________________________________________
Gtk-sharp-list maillist - <A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">Gtk-sharp-list at lists.ximian.com</A>
<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">http://lists.ximian.com/mailman/listinfo/gtk-sharp-list</A>
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="007095.html">[Gtk-sharp-list] Reg. gst-sharp.
</A></li>
<LI>Next message: <A HREF="007097.html">[Gtk-sharp-list] Background Coloring: Tables, HBoxes, VBoxes
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#7096">[ date ]</a>
<a href="thread.html#7096">[ thread ]</a>
<a href="subject.html#7096">[ subject ]</a>
<a href="author.html#7096">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">More information about the Gtk-sharp-list
mailing list</a><br>
</body></html>