strange geometry problem

Nick Buchholz nbuchholz at noao.edu
Wed Dec 23 16:19:20 EST 2009


Hi all, 
     I'm doing a GUI for describing connectors and the signals attached.  the system runs on 
CentOS release 5.2 (FINAL) using python 2.5 and tcl/tk 8.4

I have a class Pin that contains two class attributes that are dialogs. They are built by a helper
routine as follows: 
    if type(Pin.clkDialog) == type(None):
         Pin.clkDialog = bldTypeDlg(self.cnctr.gui.parent,
                                    ("Clock State Selector", "Choose a Default \nClock State\n\n\n\n"),
                                    CLKVALUES, 0)
         Pin.clkDialog.geometry('+%d+%d'%(400,400))
         Pin.clkDialog.withdraw()

the second dialog is similar but with different strings passed in.
they are activated from one field of an instance variable dialog  self.valDialog

The strange behavior is as follows:
  The first time the class dialogs are activated they appear in front of but immediately go behind the 
valDialog and are hidden. After moving the valDialog and using the class dialogs, subsequent activations
appear at a location that is effected by the geometry spec in the activate routine.

the activation code is
#####################################################################################
#####################################################################################
    def getClkState(self, event):
        Pin.clkDialog.geometry('+%d+%d'%(400,400))
        rslt = Pin.clkDialog.tkraise()
        resp = Pin.clkDialog.activate()

        if resp == 'OK':
            self.clkNominal = Pin.clkDialog.get()
            self.entries[5].setentry(self.clkNominal)
            self.valDisps[4].setentry( self.clkNominal  )
        else:
            return "break"

#####################################################################################
#####################################################################################
    def getLgcState(self, event):
        Pin.lgcDialog.geometry('+%d+%d'%(400,400))
        rslt = Pin.lgcDialog.tkraise()
        resp = Pin.lgcDialog.activate()
        if resp == 'OK':
            self.lgcNominal = Pin.lgcDialog.get()
            self.entries[5].setentry(self.lgcNominal)
            self.valDisps[4].setentry( self.lgcNominal  )
        else:
            return "break"

Any ideas on what's going on?  and how to fix it?


Nick
nbuchholz at noao.edu
Day phone: (520) 318-8203
"Time is an illusion, Lunchtime doubly so" - Ford Prefect
Time is an illusion perpetrated by the manufacturers of space.




More information about the Python-list mailing list