Where can I find some info when I want them?

For example,
wx.Frame(parent, id=-1, title="", pos=wx.DefaultPosition,
        size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE,
        name="frame")

for paremeter "pos", its value is given as wx.DefaultPosition, but if
I don't know wx.DefaultPosition at all in advance, which document can
help me to find all possible values for this "pos" ? same question
for "size", "style"

I'm an newer for wxPython,
thanks in advance

Hi,

For example,
wx.Frame(parent, id=-1, title="", pos=wx.DefaultPosition,
size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE,
name="frame")

for paremeter "pos", its value is given as wx.DefaultPosition, but if
I don't know wx.DefaultPosition at all in advance, which document can
help me to find all possible values for this "pos" ? same question
for "size", "style"

I'm an newer for wxPython,
thanks in advance

Welcome to the wonderful world of wxPython!

The "pos" is the position of the frame on your screen. The visible
values can start a (0,0) and go up to whatever your maximum screen
resolution is. I think if you used your maximum value though, you
probably wouldn't be able to see much of anything of your application
as it would mostly be off-screen.

The "size" is pretty much the same way. You just use values that are
equal to or less than the maximum screen resolution.

The "styles" are a little trickier. I usually do a quick Google search
for the widget I am interested in. So my first hit for a wx.Frame was
this:

http://www.wxpython.org/docs/api/wx.Frame-class.html

If you go there, you won't find any styles. Fortunately, the web pages
shows a tree of other classes that the frame sub-classes. So, you need
to go up the tree until you find the styles. I found some of them on
the Window level: wxPython API Documentation — wxPython Phoenix 4.2.2 documentation

However, that doesn't look like it shows all the styles. If I don't
find it this way, I usually go to Robin's book or try Andrea's docs.
Looks like Andrea's has the styles online so if you don't have the
book, you can use it:

http://xoomer.virgilio.it/infinity77/wxPython/Widgets/wx.Frame.html

- Mike

···

On May 27, 2:29 am, guoguo <999...@gmail.com> wrote:

guoguo wrote:

For example,
wx.Frame(parent, id=-1, title="", pos=wx.DefaultPosition,
        size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE,
        name="frame")

for paremeter "pos", its value is given as wx.DefaultPosition, but if
I don't know wx.DefaultPosition at all in advance, which document can
help me to find all possible values for this "pos" ? same question
for "size", "style"
  

Seems to be a recurring theme, hopefully this will not get the documentation discussion started again :wink: .

In addition to Mike's tips:

Keep in mind that when you look at e.g. a wx.Frame you also need to go up the hierarchy for things like style, as a wx.Frame is inheriting some of them from wx.Window.

Using the Python prompt is something helpful, e.g. in the case of wx.DefaultPosition:

import wx
>>> wx.DefaultPosition
wx.Point(-1, -1)

Then you could look up wxPoint or wxFrame, I use Boa, so I would hit "ctrl-h" and type frame which gives me a large listing, selecting the second one which only shows "Frame" I get the class doc for wx.Frame in the new API format, which unfortunately is not very detailed, so I look at the "wxFrame" listing which is the C++ documentation and that gives me:

pos
The window position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform.

BTW, you could also do "help (wx.Point)" at your Python prompt.

And the following is a repeat from a recent post on where to get information from:

One of the best tools to get going is the wxPython demo (a separate download with the docs).
Then there is the wiki

http://wiki.wxpython.org/How%20to%20Learn%20wxPython\\
http://wiki.wxpython.org/ObstacleCourse

I you might also want to invest into:
The wxPIA: wxPythonInAction - wxPyWiki

Sale of this book supports the project and I wish it had been around when I started using wxPython a few years ago.

Werner

Thanks a lot for Mike Driscoll and Werner F. Bruhin's help :slight_smile: