name space misunderstanding

Hi,

On this code:
from wx.py import editor
self.m_notebook = editor.EditorNotebook(parent=self,id=-1,style=wx.NB_LEFT)

I get a
TypeError: __init__() got an unexpected keyword argument 'style'

Yet if I look at the code, style is there ...

Any clue ? thanks

Philippe

···

--
_________________________
Philippe C. Martin
www.snakecard.com
_________________________

editor.EditorNotebook(parent=self,id=-1,style=wx.NB_LEFT)
I get a
TypeError: __init__() got an unexpected keyword argument 'style'
Yet if I look at the code, style is there ...

I have seen this in other places. As far as I know it means the function is
not expecting **kwargs, only an argument list. So, try dropping the style=
part.

/d

And that works ... but I do want those tabs on the left :slight_smile: !

I'll have to patch editor.py for now I guess.

Thanks,

Philippe

···

On Friday 15 December 2006 09:49, Donn Ingle wrote:

> editor.EditorNotebook(parent=self,id=-1,style=wx.NB_LEFT)
> I get a
> TypeError: __init__() got an unexpected keyword argument 'style'
> Yet if I look at the code, style is there ...

I have seen this in other places. As far as I know it means the function is
not expecting **kwargs, only an argument list. So, try dropping the style=
part.

/d

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

--
_________________________
Philippe C. Martin
www.snakecard.com
_________________________

Philippe C. Martin wrote:

···

On Friday 15 December 2006 13:42, Robin Dunn wrote:

Philippe C. Martin wrote:

Hi,

On this code:
from wx.py import editor
self.m_notebook =
editor.EditorNotebook(parent=self,id=-1,style=wx.NB_LEFT)

I get a
TypeError: __init__() got an unexpected keyword argument 'style'

Yet if I look at the code, style is there ...

No it isn't.

class EditorNotebook(wx.Notebook):
     """A notebook containing a page for each editor."""

     def __init__(self, parent):
...

The __init__ method only takes a parent parameter. You are probably
looking at the next line where it calls wx.Notebook.__init__ and is
passing a style value to it.

Most correct - could these be added ?

I don't see why not. Send me a patch. (See the bottom of http://wxpython.org/codeguidelines.php)

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