Wrong position with wx.Dialog.__init__(..., pos=(500,500))

I'm trying to position a modal dialog (it's a class derived
from wx.Dialog, and I'm passing a "pos" parameter to
wx.Dialog.__init__()). It just won't work.

For example, I modified Validate.py to pass a position
parameter to wx.Dialog.__init__(), and it doesn't seem to work.
The behavior is identical with or without the "pos" parameter.
I tried passing both a wxPoint and a tuple (shown below).
Neither works. I even put a print statement in wx/windows.py to
make sure that the "pos" argument was being passed to
_windows.new_Dialog(), and it seems to be OK.

I also modified the Dialog.py, and it does work -- but it's not
using wx.Dialog.__init__(), it's doing

pre = wx.PreDialog()
pre.Create(..., pos, ...)

Here is a patch against the 2.5.1.5 demo files to show what
I've tried (Dialog.py does work, Validate.py doesn't).

Can somebody clue me in on what's happening?

diff -w -x '*pyc' -r -U5 wxPython-2.5.1.5/demo/Dialog.py wxPython-demos-gbe/demo/Dialog.py
--- wxPython-2.5.1.5/demo/Dialog.py 2004-04-01 13:49:18.000000000 -0600
+++ wxPython-demos-gbe/demo/Dialog.py 2004-05-20 15:42:18.343930258 -0500
@@ -85,15 +85,15 @@
         sizer.Fit(self)

···

#---------------------------------------------------------------------------

def runTest(frame, nb, log):
- win = TestDialog(frame, -1, "This is a Dialog", size=(350, 200),
+ win = TestDialog(frame, -1, "This is a Dialog", size=(350, 200), pos=(500,500),
                      #style = wxCAPTION | wxSYSTEM_MENU | wxTHICK_FRAME
                      style = wx.DEFAULT_DIALOG_STYLE
                      )
- win.CenterOnScreen()
+ #win.CenterOnScreen()
     val = win.ShowModal()
     
     if val == wx.ID_OK:
         log.WriteText("You pressed OK\n")
     else:
diff -w -x '*pyc' -r -U5 wxPython-2.5.1.5/demo/Validator.py wxPython-demos-gbe/demo/Validator.py
--- wxPython-2.5.1.5/demo/Validator.py 2004-04-01 13:49:18.000000000 -0600
+++ wxPython-demos-gbe/demo/Validator.py 2004-05-20 15:42:40.435655816 -0500
@@ -159,11 +159,11 @@

#----------------------------------------------------------------------

class TestValidateDialog(wx.Dialog):
     def __init__(self, parent):
- wx.Dialog.__init__(self, parent, -1, "Validated Dialog")
+ wx.Dialog.__init__(self, parent, -1, "Validated Dialog", pos=(500,500))

         self.SetAutoLayout(True)
         VSPACE = 10

         fgs = wx.FlexGridSizer(0, 2)

--
Grant Edwards
grante@visi.com

Grant Edwards wrote:

I'm trying to position a modal dialog (it's a class derived
from wx.Dialog, and I'm passing a "pos" parameter to
wx.Dialog.__init__()). It just won't work.

Which platform? If wxGTK or wxGTK2, which window manager are you using? I just tried this in PyShell (with wxPythonGTK2 2.5.1.5) and it worked as exepcted.

>>> d = wx.Dialog(None, -1, "title", (500,500))
>>> d.ShowModal()
5101

···

d.Destroy()

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

I'm trying to position a modal dialog (it's a class derived
from wx.Dialog, and I'm passing a "pos" parameter to
wx.Dialog.__init__()). It just won't work.

Which platform?

wxPythonGTK2-py2.3-2.5.1.5
wxGTK2.5-2.5.0
[Mandrake 10.0 official]

If wxGTK or wxGTK2, which window manager are you using?

fvwm2-2.4.17

Since it worked using one dialog creation method and not the
other (and since other window positioning stuff worked), it
didn't occur to me to try another wm. Since you asked, I tried
fluxbux and icewm, and it works under both those.

My guess: Under fvwm2, creating a window in a specific place
isn't working, but moving an existing window to a specific
place is. I'll see if I can figure out how to test that theory.

Or I could just switch to fluxbox and be done with it...

···

On Thu, May 20, 2004 at 04:20:54PM -0700, Robin Dunn wrote:

--
Grant Edwards
grante@visi.com