How to use the wxPython help system effectively

Hi,

For example, I know there is a 'control' attributes in the Frame
class, then I want to know the detail of the 'control', what is it,
what it contains. So I go to the online document and open the page
for wxFrame, but I did not see a description for the 'control', I then
went through the class hierarchy, TopLevelWindow, Window, ....,
still not found :frowning: How do I know where is the document for the
'control'? In general, how should I use the online document system?

I hope someone can give me a hint.

Thanks in advance.

Hi,

For example, I know there is a 'control' attributes in the Frame
class, then I want to know the detail of the 'control', what is it,
what it contains. So I go to the online document and open the page
for wxFrame, but I did not see a description for the 'control', I then
went through the class hierarchy, TopLevelWindow, Window, ....,
still not found :frowning:

Are you thinking of the wx.Control class? If so it is not in wx.Frame's hierarchy, but rather in a different branch from wx.Window.

How do I know where is the document for the
'control'? In general, how should I use the online document system?

I hope someone can give me a hint.

The indexes in the wx docs for 2.9 are rather good, and the search works in the online version too. We'll be having something as good for a wxPython-specific version of the docs with project Phoenix.

···

On 5/14/12 1:24 AM, narke wrote:

--
Robin Dunn
Software Craftsman

> Hi,

> For example, I know there is a 'control' attributes in the Frame
> class, then I want to know the detail of the 'control', what is it,
> what it contains. So I go to the online document and open the page
> for wxFrame, but I did not see a description for the 'control', I then
> went through the class hierarchy, TopLevelWindow, Window, ....,
> still not found :frowning:

Are you thinking of the wx.Control class? If so it is not in wx.Frame's
hierarchy, but rather in a different branch from wx.Window.

Did you mean the wxFrame.control is an instance of wxControl. I did
not know it. But, what I was asking is actually, where is the doc for
the 'control' property of the wxFrame class. Only you get the
description of the 'control' property, you can then know it's a
wxControl. But I did not find it in the wxFrame (and it's parent,
grandfather classes) documentation.

> How do I know where is the document for the
> 'control'? In general, how should I use the online document system?

> I hope someone can give me a hint.

The indexes in the wx docs for 2.9 are rather good, and the search works
in the online version too. We'll be having something as good for a
wxPython-specific version of the docs with project Phoenix.

Is the docs you mentioned located at "http://wxpython.org/
onlinedocs.php"? If so, I don't find a 'index' link on it.

···

On May 15, 12:35 am, Robin Dunn <ro...@alldunn.com> wrote:

On 5/14/12 1:24 AM, narke wrote:

Hi,

For example, I know there is a 'control' attributes in the Frame
class, then I want to know the detail of the 'control', what is it,
what it contains. So I go to the online document and open the page
for wxFrame, but I did not see a description for the 'control', I then
went through the class hierarchy, TopLevelWindow, Window, ....,
still not found :frowning:

Are you thinking of the wx.Control class? If so it is not in wx.Frame's
hierarchy, but rather in a different branch from wx.Window.

Did you mean the wxFrame.control is an instance of wxControl. I did
not know it. But, what I was asking is actually, where is the doc for
the 'control' property of the wxFrame class. Only you get the
description of the 'control' property, you can then know it's a
wxControl. But I did not find it in the wxFrame (and it's parent,
grandfather classes) documentation.

That's because there isn't one.

  >>> f = wx.Frame(None)
  >>> f.control
  Traceback (most recent call last):
    File "<input>", line 1, in <module>
  AttributeError: 'Frame' object has no attribute 'control'
  >>>

What makes you think that there is? I expect that there is something in the code you are looking at that is doing something like

    self.control = something

How do I know where is the document for the
'control'? In general, how should I use the online document system?

I hope someone can give me a hint.

The indexes in the wx docs for 2.9 are rather good, and the search works
in the online version too. We'll be having something as good for a
wxPython-specific version of the docs with project Phoenix.

Is the docs you mentioned located at "http://wxpython.org/
onlinedocs.php"? If so, I don't find a 'index' link on it.

Those are the 2.8 docs. Look at wxWidgets: Documentation, click Classes, then look at Class Index and Class Members

···

On 5/14/12 9:51 PM, narke wrote:

On May 15, 12:35 am, Robin Dunn<ro...@alldunn.com> wrote:

On 5/14/12 1:24 AM, narke wrote:

--
Robin Dunn
Software Craftsman

The indexes in the wx docs for 2.9 are rather good, and the search works
in the online version too. We'll be having something as good for a
wxPython-specific version of the docs with project Phoenix.

I think you meant "something even better" :smiley: . I'll forgive this lapsus :wink:

Is the docs you mentioned located at "http://wxpython.org/
onlinedocs.php"? If so, I don't find a 'index' link on it.

Those are the 2.8 docs. Look at wxWidgets: Documentation, click
Classes, then look at Class Index and Class Members

For standard classes, you can also look it up through the Phoenix
documentation, although the project is not complete yet:

http://xoomer.virgilio.it/infinity77/Phoenix/Frame.html

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On 15 May 2012 09:08, Robin Dunn wrote:

On 5/14/12 9:51 PM, narke wrote:

On May 15, 12:35 am, Robin Dunn<ro...@alldunn.com> wrote:

Yes, of course. Thank you for correcting me. :slight_smile:

···

On 5/15/12 12:26 AM, Andrea Gavana wrote:

On 15 May 2012 09:08, Robin Dunn wrote:

On 5/14/12 9:51 PM, narke wrote:

On May 15, 12:35 am, Robin Dunn<ro...@alldunn.com> wrote:

The indexes in the wx docs for 2.9 are rather good, and the search works
in the online version too. We'll be having something as good for a
wxPython-specific version of the docs with project Phoenix.

I think you meant "something even better" :smiley: . I'll forgive this lapsus :wink:

--
Robin Dunn
Software Craftsman

>>> Hi,

>>> For example, I know there is a 'control' attributes in the Frame
>>> class, then I want to know the detail of the 'control', what is it,
>>> what it contains. So I go to the online document and open the page
>>> for wxFrame, but I did not see a description for the 'control', I then
>>> went through the class hierarchy, TopLevelWindow, Window, ....,
>>> still not found :frowning:

>> Are you thinking of the wx.Control class? If so it is not in wx.Frame's
>> hierarchy, but rather in a different branch from wx.Window.

> Did you mean the wxFrame.control is an instance of wxControl. I did
> not know it. But, what I was asking is actually, where is the doc for
> the 'control' property of the wxFrame class. Only you get the
> description of the 'control' property, you can then know it's a
> wxControl. But I did not find it in the wxFrame (and it's parent,
> grandfather classes) documentation.

That's because there isn't one.

>>> f = wx.Frame(None)
>>> f.control
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'Frame' object has no attribute 'control'
>>>

What makes you think that there is? I expect that there is something in
the code you are looking at that is doing something like

self\.control = something

hum .... I think I begin to understand... You know I saw below code
in the wxPython getting started web page:

class MyFrame(wx.Frame):
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, title=title, size=(800,600))
        self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE)
        self.Show(True)
        self.CreateStatusBar()
        ...

Now I begin to realize, the self.control is not belong to wxFrame :slight_smile:

>>> How do I know where is the document for the
>>> 'control'? In general, how should I use the online document system?

>>> I hope someone can give me a hint.

>> The indexes in the wx docs for 2.9 are rather good, and the search works
>> in the online version too. We'll be having something as good for a
>> wxPython-specific version of the docs with project Phoenix.

> Is the docs you mentioned located at "http://wxpython.org/
> onlinedocs.php"? If so, I don't find a 'index' link on it.

Those are the 2.8 docs. Look athttp://docs.wxwidgets.org/trunk/, click
Classes, then look at Class Index and Class Members

Thanks, I though it's wxPython, but wxWidget may still same for me.
Thanks again!

···

On May 15, 3:08 pm, Robin Dunn <ro...@alldunn.com> wrote:

On 5/14/12 9:51 PM, narke wrote:
> On May 15, 12:35 am, Robin Dunn<ro...@alldunn.com> wrote:
>> On 5/14/12 1:24 AM, narke wrote:

--
Robin Dunn
Software Craftsmanhttp://wxPython.org

> >>> Hi,

> >>> For example, I know there is a 'control' attributes in the Frame
> >>> class, then I want to know the detail of the 'control', what is it,
> >>> what it contains. So I go to the online document and open the page
> >>> for wxFrame, but I did not see a description for the 'control', I then
> >>> went through the class hierarchy, TopLevelWindow, Window, ....,
> >>> still not found :frowning:

> >> Are you thinking of the wx.Control class? If so it is not in wx.Frame's
> >> hierarchy, but rather in a different branch from wx.Window.

> > Did you mean the wxFrame.control is an instance of wxControl. I did
> > not know it. But, what I was asking is actually, where is the doc for
> > the 'control' property of the wxFrame class. Only you get the
> > description of the 'control' property, you can then know it's a
> > wxControl. But I did not find it in the wxFrame (and it's parent,
> > grandfather classes) documentation.

> That's because there isn't one.

> >>> f = wx.Frame(None)
> >>> f.control
> Traceback (most recent call last):
> File "<input>", line 1, in <module>
> AttributeError: 'Frame' object has no attribute 'control'
> >>>

> What makes you think that there is? I expect that there is something in
> the code you are looking at that is doing something like

> self.control = something

hum .... I think I begin to understand... You know I saw below code
in the wxPython getting started web page:

class MyFrame(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, title=title, size=(800,600))
self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE)
self.Show(True)
self.CreateStatusBar()
...

Now I begin to realize, the self.control is not belong to wxFrame :slight_smile:

Sorry, now I again confused: why after the 'self.control =
wx.TextCtrl(...)' executed, the frame really gets a text control
inside it? What's the magic behind?

···

On May 16, 10:20 pm, narke <narkewo...@gmail.com> wrote:

On May 15, 3:08 pm, Robin Dunn <ro...@alldunn.com> wrote:
> On 5/14/12 9:51 PM, narke wrote:
> > On May 15, 12:35 am, Robin Dunn<ro...@alldunn.com> wrote:
> >> On 5/14/12 1:24 AM, narke wrote:

> >>> How do I know where is the document for the
> >>> 'control'? In general, how should I use the online document system?

> >>> I hope someone can give me a hint.

> >> The indexes in the wx docs for 2.9 are rather good, and the search works
> >> in the online version too. We'll be having something as good for a
> >> wxPython-specific version of the docs with project Phoenix.

> > Is the docs you mentioned located at "http://wxpython.org/
> > onlinedocs.php"? If so, I don't find a 'index' link on it.

> Those are the 2.8 docs. Look athttp://docs.wxwidgets.org/trunk/, click
> Classes, then look at Class Index and Class Members

Thanks, I though it's wxPython, but wxWidget may still same for me.
Thanks again!

> --
> Robin Dunn
> Software Craftsmanhttp://wxPython.org

Hi,

Sorry, now I again confused: why after the 'self.control =
wx.TextCtrl(...)' executed, the frame really gets a text control
inside it? What's the magic behind?

The TextCtrl is given the frame as its parent (i.e TextCtrl(self,...))
this starts a chain of calls to occur in the framework to add the text
ctrl as a child of the Frame instance where the object is keeping
reference to the other control object.

The wxFrame class has some special case handling for its first child
which will automatically do the layout of the control to fill the
space but outside that nothing magic.

Cody

···

On Wed, May 16, 2012 at 9:28 AM, narke <narkewoody@gmail.com> wrote:

On May 16, 10:20 pm, narke <narkewo...@gmail.com> wrote:

wx.TextCtrl(…) creates a text control which will return a reference to itself, the self.control= stores this reference as an attribute of the frame for access in the future. The attribute can be called anything at all as its just a variable name.

···

On 16 May 2012 15:28, narke narkewoody@gmail.com wrote:

On May 16, 10:20 pm, narke narkewo...@gmail.com wrote:

On May 15, 3:08 pm, Robin Dunn ro...@alldunn.com wrote:

On 5/14/12 9:51 PM, narke wrote:

On May 15, 12:35 am, Robin Dunnro...@alldunn.com wrote:

On 5/14/12 1:24 AM, narke wrote:

Hi,

For example, I know there is a ‘control’ attributes in the Frame

class, then I want to know the detail of the ‘control’, what is it,

what it contains. So I go to the online document and open the page

for wxFrame, but I did not see a description for the ‘control’, I then

went through the class hierarchy, TopLevelWindow, Window, …,

still not found :frowning:

Are you thinking of the wx.Control class? If so it is not in wx.Frame’s

hierarchy, but rather in a different branch from wx.Window.

Did you mean the wxFrame.control is an instance of wxControl. I did

not know it. But, what I was asking is actually, where is the doc for

the ‘control’ property of the wxFrame class. Only you get the

description of the ‘control’ property, you can then know it’s a

wxControl. But I did not find it in the wxFrame (and it’s parent,

grandfather classes) documentation.

That’s because there isn’t one.

f = wx.Frame(None)

f.control

Traceback (most recent call last):

File "<input>", line 1, in <module>

AttributeError: ‘Frame’ object has no attribute ‘control’

What makes you think that there is? I expect that there is something in

the code you are looking at that is doing something like

self.control = something

hum … I think I begin to understand… You know I saw below code

in the wxPython getting started web page:

class MyFrame(wx.Frame):

def __init__(self, parent, title):
    wx.Frame.__init__(self, parent, title=title, size=(800,600))
    self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE)
    self.Show(True)
    self.CreateStatusBar()
    ...

Now I begin to realize, the self.control is not belong to wxFrame :slight_smile:

Sorry, now I again confused: why after the 'self.control =

wx.TextCtrl(…)’ executed, the frame really gets a text control

inside it? What’s the magic behind?