multiple screens and Tkinter/Togl

Michel Sanner sanner at
Thu Aug 30 03:45:00 CEST 2001


I have 2 screens on my unix box and I can use the screenName argument to get a 
Tkinter.Tk instance to appear on either screen. But when I try to create an togl 
Widget I get an Xserver error that kills my python interpreter. Here is the code 
creating the problem

import Tkinter
r1 = Tkinter.Tk(screenName=":0.0")'package', 'require', 'Togl')
r2 = Tkinter.Tk(screenName=":0.1")'package', 'require', 'Togl')
f1 = Tkinter.Frame(r1)
f2 = Tkinter.Frame(r2)

class OGL(Tkinter.Widget):
    def __init__(self, master, ident):
        cnf = ()
        kw = {'double':1} #, 'depth':1, 'accum':1, 'ident':ident}
        Tkinter.Widget.__init__(self, master, 'togl', cnf, kw )

o1 = OGL(f1, '1')
o2 = OGL(f2, '2')

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  1 (X_CreateWindow)
  Serial number of failed request:  149
  Current serial number in output stream:  151

My 2 screens have different resolution and depth but it does not seem to be a 
problem for regulat Tk widgets.

I am also wondering if the fact the screenName is an argument to Tk means that a 
Tkinter application cannot have windows on 2 screens at the same time (unless 
they do not share the same interpreter).

Any Ideas or comments would be very welcome



>>>>>>>>>> AREA CODE CHANGE <<<<<<<<< we are now 858 !!!!!!!

Michel F. Sanner Ph.D.                   The Scripps Research Institute
Assistant Professor			Department of Molecular Biology
					  10550 North Torrey Pines Road
Tel. (858) 784-2341				     La Jolla, CA 92037
Fax. (858) 784-2860
sanner at              

More information about the Python-list mailing list