For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > May 2005 > Disabled Browse Entry boxes









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 Disabled Browse Entry boxes
Gumby

2005-05-14, 7:13 pm

Hello,

I tried searching the forums and havent seen any fixes that will work
with my current problem. We have a series of Browse Entry boxes that
we use for selecting various things. We disable the ability to type in
them because it eliminates room for error. Currently when users run
the program from Linux the browse entry box shows up white, as the
background option would indicate. In windows it shows up greyed out.


The Windows side is a problem because it puts a grey background on
black text. Some of the people that use the program complain that its
hard to read at times. I was wondering if anyone has a way to make the
browse entry and white box in windows, or has any ideas on how to work
around this problem. I have included an example of the browse entry
box below.

Thanks


Example:

=begin
Note: I have tried switching the state and background options below to
see if they make some kind of a difference in how the box is initially
set up, nothing changed (even put in a $mw refresh to make sure).
=end
=cut

my $project;
my $projectEntryBox = $projectSelectionFrame->BrowseEntry(-variable
=>\$project, -state => 'readonly', -background => 'white', -browsecmd
=>
sub
{
#Data manip goes here
})->grid(-column => 25, -row => 1, -columnspan =>
11, , -sticky => 'nsew');

thundergnat

2005-05-14, 7:13 pm

Gumby wrote:
> Hello,
>
> I tried searching the forums and havent seen any fixes that will work
> with my current problem. We have a series of Browse Entry boxes that
> we use for selecting various things. We disable the ability to type in
> them because it eliminates room for error. Currently when users run
> the program from Linux the browse entry box shows up white, as the
> background option would indicate. In windows it shows up greyed out.
>
>
> The Windows side is a problem because it puts a grey background on
> black text. Some of the people that use the program complain that its
> hard to read at times. I was wondering if anyone has a way to make the
> browse entry and white box in windows, or has any ideas on how to work
> around this problem. I have included an example of the browse entry
> box below.
>
> Thanks
>


Why not just set the -disabledbackground to 'white'?


use warnings;
use strict;
use Tk;

my $project = MainWindow->new;
my $projectSelectionFrame = $project->Frame->pack;

my $projectEntryBox = $projectSelectionFrame->BrowseEntry(-variable
=>\$project, -state => 'readonly', -background => 'white', -browsecmd
=>
sub
{
#Data manip goes here
},
-disabledbackground => 'white',
)->grid(-column => 25, -row => 1, -columnspan =>
11, , -sticky => 'nsew');

MainLoop;
OdedDV

2005-05-14, 7:13 pm

Use the -readonlybackground to set the background to the same background
your normal Entry widgets have.

my $project;
my $projectEntryBox = $projectSelectionFrame->BrowseEntry(-variable
=>\$project, -state => 'readonly', -background =>
'white', -readonlybackground => 'white', -browsecmd
=>
sub
{
#Data manip goes here
})->grid(-column => 25, -row => 1, -columnspan =>
11, , -sticky => 'nsew');


Regards,
Oded

"Gumby" <georgeziv@hotmail.com> wrote in message
news:1115991617.014646.74250@g49g2000cwa.googlegroups.com...
> Hello,
>
> I tried searching the forums and havent seen any fixes that will work
> with my current problem. We have a series of Browse Entry boxes that
> we use for selecting various things. We disable the ability to type in
> them because it eliminates room for error. Currently when users run
> the program from Linux the browse entry box shows up white, as the
> background option would indicate. In windows it shows up greyed out.
>
>
> The Windows side is a problem because it puts a grey background on
> black text. Some of the people that use the program complain that its
> hard to read at times. I was wondering if anyone has a way to make the
> browse entry and white box in windows, or has any ideas on how to work
> around this problem. I have included an example of the browse entry
> box below.
>
> Thanks
>
>
> Example:
>
> =begin
> Note: I have tried switching the state and background options below to
> see if they make some kind of a difference in how the box is initially
> set up, nothing changed (even put in a $mw refresh to make sure).
> =end
> =cut
>
> my $project;
> my $projectEntryBox = $projectSelectionFrame->BrowseEntry(-variable
> =>\$project, -state => 'readonly', -background => 'white', -browsecmd
> =>
> sub
> {
> #Data manip goes here
> })->grid(-column => 25, -row => 1, -columnspan =>
> 11, , -sticky => 'nsew');
>



Sponsored Links







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

Copyright 2008 codecomments.com