For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > January 2005 > Configure BrowseEntry does not work









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 Configure BrowseEntry does not work
Andre Bartsch

2005-01-07, 8:57 am

Hello PERL Peoples!

-----------------------------------------------------------------------------------------------------
First of all, I wish you a Happy New Year! I hope all your PERL problems
will be solved this year ;-)
-----------------------------------------------------------------------------------------------------

I started the new year by creating a nice PERL gui to sending snmp traps.
For the selection of traps
I used a BrowseEntry widget:

my $brTRAP = $frTraps->BrowseEntry( -label => 'Trap ID:',
-variable => \$TrapID,
-background => $lb_bg,
-state => 'readonly',
-command => \&selectTRAP,
-width => 5,
-listwidth => 15,
-choices => \@traps) ->pack( -padx => 5,
-pady => 5,
-side => 'left');

After the RUN button was pressed the state of most widgets will set to
'disabled'. This works fine except
for the BrowseEntry widget:

$brTRAP->Tk::configure(-state => 'disabled', -background => $en_dis_bg,
-foreground => $en_dis_fg);

Each time I try to change the state of this widget (as shown above) I
recieved the following PERL error message:

Tk::Error: unknown option "-state" at
E:\ActivePerl\scripts\TrapGenerator\snmp
TrapGenerator_v02a.pl line 545.
Tk callback for .frame6.browseentry
Tk callback for .frame9.button
Tk::__ANON__ at E:/Perl/site/lib/Tk.pm line 247
Tk::Button::butUp at E:/Perl/site/lib/Tk/Button.pm line 111
<ButtonRelease-1>
(command bound to event)

I can not find any fault in my code. I assume this could be a PERL error?
I use ActiveState PERL:
v5.8.4 built for MSWin32-x86-multi-thread / Binary build 810 provided by
ActiveState Corp.

I hope you can help me! Thank you very much in advance!
Andre.

--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/m2/
Jason Mather

2005-01-07, 8:56 pm

Andre Bartsch wrote:
> Hello PERL Peoples!
>
> -----------------------------------------------------------------------------------------------------
>
> First of all, I wish you a Happy New Year! I hope all your PERL
> problems will be solved this year ;-)
> -----------------------------------------------------------------------------------------------------
>
>
> I started the new year by creating a nice PERL gui to sending snmp
> traps. For the selection of traps
> I used a BrowseEntry widget:
>
> my $brTRAP = $frTraps->BrowseEntry( -label => 'Trap ID:',
> -variable => \$TrapID,
> -background => $lb_bg,
> -state => 'readonly',
> -command => \&selectTRAP,
> -width => 5,
> -listwidth => 15,
> -choices => \@traps) ->pack( -padx => 5,
> -pady => 5,
> -side => 'left');
>
> After the RUN button was pressed the state of most widgets will set to
> 'disabled'. This works fine except
> for the BrowseEntry widget:
>
> $brTRAP->Tk::configure(-state => 'disabled', -background => $en_dis_bg,
> -foreground => $en_dis_fg);
>
> Each time I try to change the state of this widget (as shown above) I
> recieved the following PERL error message:
>
> Tk::Error: unknown option "-state" at
> E:\ActivePerl\scripts\TrapGenerator\snmp
TrapGenerator_v02a.pl line 545.
> Tk callback for .frame6.browseentry
> Tk callback for .frame9.button
> Tk::__ANON__ at E:/Perl/site/lib/Tk.pm line 247
> Tk::Button::butUp at E:/Perl/site/lib/Tk/Button.pm line 111
> <ButtonRelease-1>
> (command bound to event)
>
> I can not find any fault in my code. I assume this could be a PERL
> error? I use ActiveState PERL:
> v5.8.4 built for MSWin32-x86-multi-thread / Binary build 810 provided
> by ActiveState Corp.
>
> I hope you can help me! Thank you very much in advance!
> Andre.
>


When I run the following code on a BrowseEntry widget it lists -state
as an option

@c = $b_e->Tk::BrowseEntry::configure;
foreach $i (@c) {
print $i->[0]."\n";
}

When I change it to this, it no longer lists -state

@c = $b_e->Tk::configure;
foreach $i (@c) {
print $i->[0]."\n";
}


-- Jason
Sponsored Links







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

Copyright 2008 codecomments.com