[Q] Tkinter and Xdefaults.

Fred L. Drake, Jr. fdrake at cnri.reston.va.us
Wed Sep 22 10:11:14 EDT 1999


Leonid Gluhovsky writes:
 > How can one write a Tkinter application which uses the .Xdefaults file
 > under Unix?

  It's not hard, just very tedious.

 > We thought we could use Tk's option database, but found out that Tk
 > looks up options in the database according to Tk "window paths", which
 > under Tkinter are just automatically generated numbers.
 > 
 > Is there any way other than writing an Xdefaults reader and an
 > option database ourselves?

  This wouldn't solve the problem.
  The only solution I'm aware of is to use the name='...' keyword
parameter when creating widgets.  This allows real names to be
assigned to widgets that can be used with the options database.  I
think this is as close to the "right" way to do it as it gets with
Tkinter.  (I'd love to see it be easier; perhaps Phil Hunt can make
parrot helpful in this context?)


  -Fred

--
Fred L. Drake, Jr. <fdrake at cnri.reston.va.us>
Corporation for National Research Initiatives




More information about the Python-list mailing list