PwmComboBox problem on Win95 fixed 
Author Message
 PwmComboBox problem on Win95 fixed

I eventually got it !

Here are my modifications (thanks Fredrik) to the _postList method of the
PmwComboBox widget to get it work properly on WIn95 with Tcl/Tk 8.0a1 :
This assume you add 'import os' at the beginning of PmwComboBox.py

==============================================================
    def _postList(self, event = None):
 if not self._isPosted:
     self._isPosted = 1
     self._drawArrow(sunken=1)
     # Make sure that the arrow is displayed sunken.
     self.update_idletasks()
     x = self._entryfield.winfo_rootx()
     y = self._entryfield.winfo_rooty() + \
  self._entryfield.winfo_height()
     w = self._entryfield.winfo_width() + self._arrowBtn.winfo_width()
     h =  self.__listbox.winfo_height()
     sh = self.winfo_screenheight()
     if y + h > sh and y > sh / 2:
  y = self._entryfield.winfo_rooty() - h
     self._list.configure(hull_width=w)

# Jerome Gay - Added os.name test and moved the 2 lines geometry/deiconify
below
            if os.name == "nt": self._popup.deiconify() # Tk 8.0 bug!!!
#     self._popup.geometry('+%d+%d' % (x, y))
#     self._popup.deiconify()
     self._popup.wait_visibility()
     self._popup.grab_set_global()
     self._popup.tkraise()
     self._popup.focus_set()

# The two lines moved from above :
     self._popup.geometry('+%d+%d' % (x, y))
     self._popup.deiconify()

     self._drawArrow()
     # Ignore the first release of the mouse button after posting the
     # dropdown list, unless the mouse enters the dropdown list.
     self._ignoreRelease = 1



Sun, 02 Apr 2000 03:00:00 GMT  
 PwmComboBox problem on Win95 fixed


Quote:
> I eventually got it !

> Here are my modifications (thanks Fredrik) to the _postList method of the
> PmwComboBox widget to get it work properly on WIn95 with Tcl/Tk 8.0a1 :
> This assume you add 'import os' at the beginning of PmwComboBox.py

Unfortunately, your changes broke the X version.  Here is a patch for
Pmw.ComboBox that I hope will work on all platforms.  At the end is a
similar patch for Pmw.Balloon.

If anyone checks these patches, could they let me know 1) if they fix
the problems on Win95 and 2) they don't break on other systems.

PS:  For those who haven't been following this thread, the problem was
that under Win95 the Pmw.ComboBox and Pmw.Balloon popup windows were
positioned incorrectly at the top left corner of the screen.  It
appears that this may have been caused by a bug in Tk.  These patches
give a work around for the bug.

======================================================================
*** PmwComboBox.py.orig Thu Oct 16 13:13:32 1997
--- PmwComboBox.py      Thu Oct 16 13:14:52 1997
***************
*** 1,5 ****
--- 1,6 ----
  # Based on iwidgets2.2.0/combobox.itk code.

+ import os
  import string
  import types
  import Tkinter
***************
*** 321,333 ****

            self._list.configure(hull_width=w)

!           self._popup.geometry('+%d+%d' % (x, y))
            self._popup.deiconify()
            self._popup.wait_visibility()
            self._popup.grab_set_global()
            self._popup.tkraise()
            self._popup.focus_set()

            self._drawArrow()

            # Ignore the first release of the mouse button after posting the
--- 322,341 ----

            self._list.configure(hull_width=w)

!           # To avoid flashes on X and to position the window
!           # correctly on Win95 (caused by Tk bugs):
!           if os.name != "nt":
!               self._popup.geometry('%+d%+d' % (x, y))
            self._popup.deiconify()
+
            self._popup.wait_visibility()
            self._popup.grab_set_global()
            self._popup.tkraise()
            self._popup.focus_set()

+           if os.name == "nt":
+               self._popup.geometry('%+d%+d' % (x, y))
+
            self._drawArrow()

            # Ignore the first release of the mouse button after posting the
======================================================================

======================================================================
*** PmwBalloon.py.orig  Thu Oct 16 13:17:36 1997
--- PmwBalloon.py       Thu Oct 16 13:18:02 1997
***************
*** 115,125 ****
        y = widget.winfo_rooty() + \
            widget.winfo_height() + self['yoffset']

-       self.geometry('+' + str(x) + '+' + str(y))
-
        self._label.configure(text=balloonHelp)

!       self.show()
!       self.tkraise()
!
!
--- 115,126 ----
        y = widget.winfo_rooty() + \
            widget.winfo_height() + self['yoffset']

        self._label.configure(text=balloonHelp)

!       # To avoid flashes on X and to position the window
!       # correctly on Win95 (caused by Tk bugs):
!       if os.name != "nt":
!           self.geometry('%+d%+d' % (x, y))
!       self.deiconify()
!       if os.name == "nt":
!           self.geometry('%+d%+d' % (x, y))
======================================================================

--
Greg McFarlane



Mon, 03 Apr 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Bug Fix: Problems compiling DLL's after win95 upgrade

2. Win95 virtual redirector fix

3. locale for fix for win95+exec+copy

4. Tk8.0 problems: tk_popup: bug+fix, font problem

5. VSE refactoring browser fix and fix needed

6. DEC FIXED, BIN FIXED...

7. Converting in-fix notation to Post-fix

8. fixed point vs fixed decimal

9. Problem when formating a variable delimited file to fixed length

10. Fixed point addition problems

11. Fix for WheelWidget (events.st problem)

12. There must be someone out there who can fix this problem

 

 
Powered by phpBB® Forum Software