| Description: |
OriginalBugID: 1566 Bug
Version: 8.0.5
SubmitDate: '1999-03-19'
LastModified: '1999-09-13'
Severity: MED
Status: Closed
Submitter: pat
ChangedBy: hobbs
RelatedBugIDs: 2691
OS: All
OSVersion: NA
Machine: NA
FixedInVersion: NA
ClosedDate: '1999-09-13'
From: Rolf Schroedter <Rolf.Schroedter@dlr.de>
Newsgroups: comp.lang.tcl
Subject: Re: Strange button.tcl bug?
Date: Mon, 15 Mar 1999 10:35:34 +0100
Organization: DLR, Inst.f.Planetenerkundung
Message-ID: <36ECD466.2E25CAA9@dlr.de>
References: <36EB1540.C550575C@mail.netanya.ac.il>
This is a funny kind of bug that has already been reported
several times.
Don't use 'reserved' filenames like "button.tcl", "menu.tcl",...
Otherwise Tk's option data base will not be configured properly.
The only conclusion for me is to use only nonsense filenames
as "gnlfkr.tcl".
Regards,
Rolf.
Samy Zafrany wrote:
>
> I have handed my students a file called "button.tcl"
> with the famous button example:
>
> button .b -text Hello -command {puts "Hello World!"}
> pack .b
> ...
> (Tcl is installed in c:\tcl on our college labs)
> So at the DOS prompt we write
> D:\SOMEDIR\> wish button.tcl
> A very starnge thing happened!
> The button shows up ok, but when I enter the "Hello" button, I get the
> following error message: "Error: unknown option -state".
>
> I have renamed the "button.tcl" file to "but.tcl" and everything worked
> fine!
> This is ver strange to me!?!?! Can someone explain this weird behaviour?
>
> I suspect it has to do with the c:\tcl\lib\tk8.0\button.tcl file
> but I still don't see how.
> Samy.
The problem occurs when confusion arises over class names.
A script takes the root filename of the script as the class
name for the primary toplevel. Tk will then tie that in
to known classes when creating the toplevel, so a toplevel
will try to be configured with class Radiobutton...
-- 09/13/1999 hobbs
|