For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > June 2004 > Disassociating -activebackground from the indicator









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Disassociating -activebackground from the indicator
Eric Edlin

2004-06-11, 3:58 pm

This is a multi-part message in MIME format.

------_=_NextPart_001_01C44FDA.AA94C5B5
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello all,
=20
Is there a way to disassociate a checkbutton's -activebackground color
from the indicator color?
=20
I do not want my users to see the indicators change color when they
mouse-over the widget.
=20
Thanks,
=20
Eric
=20

------_=_NextPart_001_01C44FDA.AA94C5B5
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D742243117-11062004>Hello=20
all,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D742243117-11062004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D742243117-11062004>Is =
there a way to=20
disassociate a checkbutton's -activebackground color from the indicator=20
color?</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D742243117-11062004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D742243117-11062004>I do =
not want my=20
users to see the indicators change color when they mouse-over the=20
widget.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D742243117-11062004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D742243117-11062004>Thanks,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D742243117-11062004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D742243117-11062004>Eric</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>
=00
------_=_NextPart_001_01C44FDA.AA94C5B5--
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
Arms, Mike

2004-06-11, 8:56 pm

Steve Lidie [sol0@lehigh.edu] wrote:
>
> Eric Edlin wrote:
>
> Change the activebackground color to the background color?
>
> ptksh> $cb->pack
> # Tk::Checkbutton=HASH(0x98009c)
> ptksh> $bg=$cb->cget(-bg)
> # #d9d9d9
> ptksh> $cb->configure(-activebackground=>$bg)
> #
> ptksh>


Hi, Steve.

I gave your suggestion a try, but noticed no change
in behavior. When the mouse is out of the checkbutton's
box, the background color of the box is white. When the
mouse enters the checkbutton's box, it turns the same
grey color as the main windows background color. Here is
my log from "ptksh":

ptksh V2.01 perl V5.006001 Tk V800.024 MainWindow -> $mw

@INC:
C:/Perl/lib
C:/Perl/site/lib
$_@_.%_

2004-06-12, 3:56 am


"Arms, Mike" <marms@sandia.gov> wrote in message-id:
<cad6m6$f7s$1@fidoii.CC.Lehigh.EDU>
>
>Steve Lidie [sol0@lehigh.edu] wrote:
>
>Hi, Steve.
>
>I gave your suggestion a try, but noticed no change
>in behavior. When the mouse is out of the checkbutton's
>box, the background color of the box is white. When the
>mouse enters the checkbutton's box, it turns the same
>grey color as the main windows background color. Here is
>my log from "ptksh":
>
> ptksh V2.01 perl V5.006001 Tk V800.024 MainWindow -> $mw
>
> @INC:
> C:/Perl/lib
> C:/Perl/site/lib
> .
> Type 'h<Return>' at the prompt for help
> Reading history ...
> ptksh> $cb = $mw->Checkbutton->pack
> # Tk::Checkbutton=HASH(0x264c038)
> ptksh> $bg=$cb->cget(-bg)
> # SystemButtonFace
> ptksh> $cb->configure(-activebackground=>$bg)
> #
> ptksh>
>
>However, the following did the trick:
>
> ptksh> $cb->configure(-selectcolor => $bg)
>
>The perldocs for Tk::Checkbutton show this:
>
> Name: selectColor
> Class: Background
> Switch: -selectcolor
> Specifies a background color to use when the button
> is selected. If indicatorOn is true then the color
> applies to the indicator. Under Windows, this color
> is used as the background for the indicator
> regardless of the select state. If indicatorOn is
> false, this color is used as the background for the
> entire widget, in place of background or
> activeBackground, whenever the widget is selected.
> If specified as an empty string then no special color
> is used for displaying when the widget is selected.
>
>As I am testing this under Windows, that clause in the
>paragraph above makes me think that this behavior is
>unique to MSWin32.
>
>--
>Mike Arms
>
>


my $cb2_conf = $tl5->Checkbutton(-background => '#000000',
-foreground => '#000000',
-activebackground => '#000000',
-activeforeground => '#ffffff',
-selectcolor => '#ffffff',
-offvalue => '1',
-onvalue => '0',
-variable => \$OPT{Vk},);

I had a similar problem but this acts 'normally'.

HtH


Eric Edlin

2004-06-12, 3:56 am

I tried the same thing using -selectcolor before I sent my original post, but -activebackground seems to override it when the widget is active (ie moused-over).

If I change the -background to 'lightblue' for example I must also change -activebackground as well or the entire widget bg turns the default grey color when moused over. But when I do this, the indicator also changes when it is moused over. If I set -s
electcolor to 'white' for instance, the indicator is only white when the widget is inactive, but once it is moused-over, the indicator box turns 'lightblue'.

I want to be able to always keep the indicator white regardless if it is active or not.

I am running this on WinXP and since my solaris box is currently on loan, I have not tried it on Solaris.

Eric

Eric Edlin
Lead Applications Engineer
WW Field Operations and Services
(408) 428-5957



-----Original Message-----
From: Arms, Mike [mailto:marms@sandia.gov]
Sent: Friday, June 11, 2004 12:46 PM
To: 'Steve Lidie'; Eric Edlin
Cc: ptk@lists.Stanford.EDU
Subject: RE: Disassociating -activebackground from the indicator


Steve Lidie [sol0@lehigh.edu] wrote:
>
> Eric Edlin wrote:
>
> Change the activebackground color to the background color?
>
> ptksh> $cb->pack
> # Tk::Checkbutton=HASH(0x98009c)
> ptksh> $bg=$cb->cget(-bg)
> # #d9d9d9
> ptksh> $cb->configure(-activebackground=>$bg)
> #
> ptksh>


Hi, Steve.

I gave your suggestion a try, but noticed no change
in behavior. When the mouse is out of the checkbutton's
box, the background color of the box is white. When the
mouse enters the checkbutton's box, it turns the same
grey color as the main windows background color. Here is
my log from "ptksh":

ptksh V2.01 perl V5.006001 Tk V800.024 MainWindow -> $mw

@INC:
C:/Perl/lib
C:/Perl/site/lib
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com