Code Comments
Programming Forum and web based access to our favorite programming groups.I have several checkbuttons in a main window and a getOpenFile dialog box
that opens over them. When you double click on a file in the dialog box
the checkbutton below the dialog box is also activated. Is there any easy
way to fix this without changing the geometry?
Here is an example:
use Tk;
use strict;
my @vals = (1,2,3,4,5,6,7,8);
my ($key, %bt);
my $mw = MainWindow -> new(-title => 'a test program');
$mw ->geometry("300x300+150+90");
foreach $key (@vals) {
$bt{$key} = $mw -> Checkbutton(-text => $key) -> pack();
}
my $open = $mw -> Button(-text => 'open',
-command => \&open)-> pack();
my $exit_but = $mw -> Button(-text => 'Exit',
-command => \&close) -> pack();
MainLoop;
sub open {
$mw -> getOpenFile();
}
sub close {
$mw -> destroy;
}
Post Follow-up to this messageIn article < ae4e3b984230dd7b5b33cd56ea53977a@localho
st.talkaboutprogramming.
com>,
fleming.scott@nospam says...
> I have several checkbuttons in a main window and a getOpenFile dialog box
> that opens over them. When you double click on a file in the dialog box
> the checkbutton below the dialog box is also activated. Is there any easy
> way to fix this without changing the geometry?
What OS? Which version of Tk? I don't see this on Windows 2000,
ActiveState v5.8.6, Tk 804.027.
> Here is an example:
>
> use Tk;
> use strict;
>
> my @vals = (1,2,3,4,5,6,7,8);
> my ($key, %bt);
>
> my $mw = MainWindow -> new(-title => 'a test program');
> $mw ->geometry("300x300+150+90");
> foreach $key (@vals) {
> $bt{$key} = $mw -> Checkbutton(-text => $key) -> pack();
> }
> my $open = $mw -> Button(-text => 'open',
> -command => \&open)-> pack();
> my $exit_but = $mw -> Button(-text => 'Exit',
> -command => \&close) -> pack();
>
> MainLoop;
>
> sub open {
> $mw -> getOpenFile();
> }
>
> sub close {
> $mw -> destroy;
> }
--
Go to http://MarcDashevsky.com to send me e-mail.
Post Follow-up to this messageSorry; Windows XP ActiveState v5.6 Tk 800.024 ~Scott
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.