зеркало из https://github.com/mono/mail-archives.git
143 строки
6.6 KiB
HTML
143 строки
6.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [Gtk-sharp-list] Changing the background color of button
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Changing%20the%20background%20color%20of%20button&In-Reply-To=43FB738E.2040806%40free.fr">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<LINK REL="Previous" HREF="006961.html">
|
|
<LINK REL="Next" HREF="006963.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[Gtk-sharp-list] Changing the background color of button</H1>
|
|
<B>Paulo Augusto</B>
|
|
<A HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Changing%20the%20background%20color%20of%20button&In-Reply-To=43FB738E.2040806%40free.fr"
|
|
TITLE="[Gtk-sharp-list] Changing the background color of button">PauloMorfeo at portugalmail.pt
|
|
</A><BR>
|
|
<I>Thu Feb 23 01:46:55 EST 2006</I>
|
|
<P><UL>
|
|
<LI>Previous message: <A HREF="006961.html">[Gtk-sharp-list] Changing the background color of button
|
|
</A></li>
|
|
<LI>Next message: <A HREF="006963.html">[Gtk-sharp-list] Changing the background color of button
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#6962">[ date ]</a>
|
|
<a href="thread.html#6962">[ thread ]</a>
|
|
<a href="subject.html#6962">[ subject ]</a>
|
|
<a href="author.html#6962">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>You seem to be using a Gtk.EventBox, adding to it a label and then
|
|
trying to change the colour of the event box.
|
|
I don't know much of Gtk but i doubt that that is suposed to work... The
|
|
event box is just used to get events, not for showing. So, you can
|
|
change the colour of the EventBox that it will never show. Maybe you
|
|
should be trying instead to change the colour of the label which is
|
|
inside the EventBox and is what's really showing.
|
|
|
|
|
|
About buttons, i know i'm using:
|
|
Gtk.Button.ModifyFg (...);
|
|
|
|
And it changes the colour of the button. Maybe you should try instead to
|
|
use a button like i am. Unless you reallt want to mess around with
|
|
labels and event boxes.
|
|
|
|
|
|
|
|
Ter, 2006-02-21 às 21:09 +0100, xiii29 escreveu:
|
|
><i> Thanks ...
|
|
</I>><i>
|
|
</I>><i> I've tried but it does'nt work ...
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i> Paulo Augusto a écrit :
|
|
</I>><i> > I was puzzled by the same thing about buttons for a long time until i
|
|
</I>><i> > figured it out.
|
|
</I>><i> > Try changing the foreground, instead.
|
|
</I>><i> >
|
|
</I>><i> >
|
|
</I>><i> >
|
|
</I>><i> > Sáb, 2006-02-18 às 00:28 +0100, xiii29 escreveu:
|
|
</I>><i> >
|
|
</I>><i> > > Hi,
|
|
</I>><i> > >
|
|
</I>><i> > > I'm wondering how to change the background color of a button. I'm able
|
|
</I>><i> > > to change label's one but not the button's one ...
|
|
</I>><i> > >
|
|
</I>><i> > > Here is the code I'm using :
|
|
</I>><i> > >
|
|
</I>><i> > > // -5.1.1-
|
|
</I>><i> > > Gtk.HBox hbox = new Gtk.HBox();
|
|
</I>><i> > >
|
|
</I>><i> > > // --> Label
|
|
</I>><i> > > // -----> Event Box
|
|
</I>><i> > > Gtk.EventBox box = new Gtk.EventBox();
|
|
</I>><i> > > // -----> ModifyBG
|
|
</I>><i> > > box.ModifyBg(Gtk.StateType.Normal, new Gdk.Color( 255,
|
|
</I>><i> > > 0, 0));
|
|
</I>><i> > > // -----> Creating Label
|
|
</I>><i> > > Gtk.Label lbl = new Gtk.Label(objP.Name);
|
|
</I>><i> > > // ----> Adding Label to box
|
|
</I>><i> > > box.Add(lbl);
|
|
</I>><i> > > // ----> Adding box to HBOX
|
|
</I>><i> > > hbox.PackStart(box);
|
|
</I>><i> > >
|
|
</I>><i> > >
|
|
</I>><i> > > // --> Bouton
|
|
</I>><i> > > // -----> Event Box
|
|
</I>><i> > > box = new Gtk.EventBox();
|
|
</I>><i> > > // -----> ModifyBG
|
|
</I>><i> > > box.ModifyBg(Gtk.StateType.Normal, new Gdk.Color( 255,
|
|
</I>><i> > > 0, 0));
|
|
</I>><i> > > // -----> Creating Label
|
|
</I>><i> > > Gtk.Button btn = new Gtk.Button(objP.Name);
|
|
</I>><i> > > btn.ModifyBg(Gtk.StateType.Normal, new Gdk.Color( 0,
|
|
</I>><i> > > 255, 0));
|
|
</I>><i> > > // ----> Adding Label to box
|
|
</I>><i> > > box.Add(btn);
|
|
</I>><i> > > // ----> Adding box to HBOX
|
|
</I>><i> > > hbox.PackStart(box);
|
|
</I>><i> > >
|
|
</I>><i> > > // -5.1.3-
|
|
</I>><i> > > objVBox.Add(hbox);
|
|
</I>><i> > >
|
|
</I>><i> > > _______________________________________________
|
|
</I>><i> > > Gtk-sharp-list maillist - <A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">Gtk-sharp-list at lists.ximian.com</A>
|
|
</I>><i> > > <A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">http://lists.ximian.com/mailman/listinfo/gtk-sharp-list</A>
|
|
</I>><i> > >
|
|
</I>><i> > _______________________________________________
|
|
</I>><i> > Gtk-sharp-list maillist - <A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">Gtk-sharp-list at lists.ximian.com</A>
|
|
</I>><i> > <A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">http://lists.ximian.com/mailman/listinfo/gtk-sharp-list</A>
|
|
</I>><i> >
|
|
</I>><i> >
|
|
</I>><i> >
|
|
</I>><i>
|
|
</I></PRE>
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI>Previous message: <A HREF="006961.html">[Gtk-sharp-list] Changing the background color of button
|
|
</A></li>
|
|
<LI>Next message: <A HREF="006963.html">[Gtk-sharp-list] Changing the background color of button
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#6962">[ date ]</a>
|
|
<a href="thread.html#6962">[ thread ]</a>
|
|
<a href="subject.html#6962">[ subject ]</a>
|
|
<a href="author.html#6962">[ 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>
|