Menu

#26 option clear command apparently reads the ~/.Xdefaults file

open-invalid
1
2002-04-06
2000-10-31
No

OriginalBugID: 5963 Bug
Version: 8.3
SubmitDate: '2000-06-29'
LastModified: '2000-08-14'
Severity: MED
Status: Closed
Submitter: techsupp
ChangedBy: ericm
OS: Windows NT
Machine: Dell OptiPlex GX1
ClosedDate: '2000-08-14'

Name:
Allen Flick

Comments:
Although, in my example under Windows, TclTk is accessing the
~/.Xdefaults file, which is a Unix
thing, I'd like to see it remain in future releases. This would make Tk
truly platform independent,
and if Tk under Unix accesses this file a second time (since X does it
in Unix) and that's deemed
to be a problem for some reason, it wouldn't be too hard to check the
platform type. That's built
right into TclTk anyway.

ReproducibleScript:
Within a *wish8.3*, at the console.

% pack [button .b1 -text Button1]
% pack [button .b2 -text Button2 -bg red]
% pack [button .b3 -text Button3]
% option add *Button.background blue
% option add *Button.foreground yellow
% pack [button .b4 -text Button4]
% option clear
% pack [button .b5 -text Button5]
% option clear

At this point I had to rename my ~/.Xdefaults file, so it wouldn't be reread.

% pack [button .b6 -text Button6]
% pack [button .b7 -text Button7]
% option clear
% pack [button .b8 -text Button8]
%

ObservedBehavior:
After each *option clear* command, the default background was apparently taken from the
~/.Xdefaults file, as it was always reset to cyan except for the one time I renamed the
~/.Xdefaults file, temporarily.

DesiredBehavior:
I would expect to see the option database all cleared as manual states, and if
the ~/.Xdefaults file is to be accessed as described in the manual (for Unix)
then it do so as the manual states, the *next* time the database is accessed.

The option database is implicitly accessed whenever a widget is created. The behavior you are seeing is therefore consistent with the documentation: [option clear] clears the database, and the next time the database is accessed (when the next widget is created), .Xdefaults is reread.

Eric Melski The Other Tcl Guy
ericm at ajubasolutions.com Ajuba Solutions

-- 08/14/2000 ericm

Discussion

  • Brent B. Welch

    Brent B. Welch - 2000-10-31
    • priority: 5 --> 1
    • status: open --> closed-invalid
     
  • Don Porter

    Don Porter - 2001-04-25
    • labels: 104343 --> 318678
     
  • Don Porter

    Don Porter - 2002-04-06
    • labels: 318678 -->
    • milestone: 102505 -->
    • status: closed-invalid --> open-invalid
     
  • Don Porter

    Don Porter - 2002-04-06

    Logged In: YES
    user_id=80530

    re-opened as a feature request. Allen, is this still
    something you want? Close it if you don't.

     
  • Don Porter

    Don Porter - 2002-04-06
    • labels: --> 57. [option]
    • assigned_to: nobody --> caflick
     
  • Nobody/Anonymous

    Logged In: NO

    Yes, I think this is the right thing, for like I previously
    stated, "this would (help) make Tk truly platform
    independent" and I think that's one aspect of Tcl/Tk that is
    put forth as one of its key points for use.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.