Weird result when trying to retrieve Frame size & position

debian sid
libwxbase2.8-0:amd64 2.8.12.1+dfsg2-2
libwxgtk2.8-0:amd64 2.8.12.1+dfsg2-2
wx2.8-i18n 2.8.12.1+dfsg2-2
libwxgtk-media2.8-0:amd64 2.8.12.1+dfsg2-2
libwxsvg2:amd64 2:1.4~dfsg-2+b1

···

===================================================

Hi list,

I have a simple frame and want to retrieve & print its size & position
when closing it.

In fact, it is working, but the content of the frame is clobbered:
almost anything in it isn't displayed, just a small square about
20x20 pixels on top-left of the frame.

So, why is the frame content not displayed?

Frame: self.winSize = None
        self.winPos = None
        self.winRect = None
        #
        self.disSize = wx.GetDisplaySize()
  #
  self.Bind( wx.EVT_SIZE, self.OnSize )
        self.Bind( wx.EVT_MOVE, self.OnMove )

OnSize: self.winSize = e.GetSize()

OnMove: self.winPos = e.GetPosition()
  self.winRect = self.GetRect()

OnCloseWindow: print self.disSize
    print self.winSize
    print self.winPos
    print self.winRect
    self.Destroy()

Result: (1366, 768)
  (693, 468)
  (234, 108)
  (234, 108, 693, 468)

Jean-Yves

Of course, the _last_ test worked: disabling OnSize() and just
using self.GetRect() into OnMove() is OK, sorry for the noise.

(But I still do not understand why in the 1st case, the frame content
doesn't display correctly).

Jean-Yves

···

On Mon, 23 Feb 2015 18:31:53 +0100 Bzzzz <lazyvirus@gmx.com> wrote:

So, why is the frame content not displayed?

Bzzzz wrote:

I have a simple frame and want to retrieve & print its size & position
when closing it.

In fact, it is working, but the content of the frame is clobbered:
almost anything in it isn't displayed, just a small square about
20x20 pixels on top-left of the frame.

So, why is the frame content not displayed?

Why did you not just send us the entire code? There might be 100 things
you are doing wrong. Without a runnable sample, there's no way to
advise you.

My guess, from your description, is that you are not using sizers.
Without sizers, all of your child windows will magnetically attach
themselves to the upper left corner of your window, overwriting one another.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

In fact, it is working, but the content of the frame is clobbered:
almost anything in it isn't displayed, just a small square about
20x20 pixels on top-left of the frame.

So, why is the frame content not displayed?

If you resize the frame manually by dragging the corner with the cursor,
does it display?