Skip to content

Commit

Permalink
show sidebar function
Browse files Browse the repository at this point in the history
  • Loading branch information
Adman committed Oct 25, 2013
1 parent a255416 commit 9c044cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions nxted/nxted.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,8 @@ def __init__(self, parent):
self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGING, self.tabChanged)
self.Bind(wx.EVT_CLOSE, self.OnQuit)

self._mgr.AddPane(PythonSidebar(self),
wx.aui.AuiPaneInfo().Name("sidebar").
TopDockable(False).BottomDockable(False).
Caption('Sidebar').Right().PaneBorder(False))
self.python_sidebar = PythonSidebar(self)
self.showSidebar(None)

self.OnNewChild(None)

Expand Down Expand Up @@ -546,6 +544,9 @@ def MakeMenuBar(self):
item = self.menu.Append(-1, "Previous\tCtrl-PgUp")
self.Bind(wx.EVT_MENU, self.Prev, item)

self.menu.AppendSeparator()

This comment has been minimized.

Copy link
@mrshu

mrshu Oct 26, 2013

Member

Do we really need a new item for this? Especially in the File menu?

Let's discuss this in detail in #59.

item = self.menu.Append(-1, "Show sidebar")
self.Bind(wx.EVT_MENU, self.showSidebar, item)
self.menu.AppendSeparator()
item = self.menu.Append(-1, "Preferences")
self.Bind(wx.EVT_MENU, self.onPreferences, item)
Expand Down Expand Up @@ -597,6 +598,14 @@ def OnQuit(self, evt):

self.Destroy()

def showSidebar(self, evt):
#if not (self.python_sidebar.IsShown()):

This comment has been minimized.

Copy link
@mrshu

mrshu Oct 26, 2013

Member

Was there a good reason why this line was commented out?

It actually works the way it should for me with this line so I've re-enabled it and added a comment about it in 7889c06

This comment has been minimized.

Copy link
@Adman

Adman Oct 27, 2013

Author Member

Doesn't work for me. Both windows & ubuntu

This comment has been minimized.

Copy link
@mrshu

mrshu Oct 27, 2013

Member

You are right -- I haven't tested it properly.

Did you have time to look at the latest commit (9e23d99) which fixes that?

This comment has been minimized.

Copy link
@Adman

Adman Oct 27, 2013

Author Member

Just tested it on Windows. When I'm trying to open the sidebar, it throws this error

File "C:\Python26\lib\site-packages\wx-2.8-msw-ansi\wx\aui.py", line 621, in _AddPane1
    return _aui.AuiManager__AddPane1(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed at ..\..\src\aui\framemanager.cpp(957) in wxAuiManager::AddPane(): A pane with that name already exists in the manager!

This comment has been minimized.

Copy link
@mrshu

mrshu Oct 27, 2013

Member

Yeah, that is somewhat expected.

What can we do about it? Probably the best way would be to just try to find it (in the manager) and show it rather than create it again and again.

This comment has been minimized.

Copy link
@mrshu

mrshu Oct 27, 2013

Member

This comment has been minimized.

Copy link
@Adman

Adman Oct 27, 2013

Author Member

Maybe GetPaneByName would be better.

This comment has been minimized.

Copy link
@mrshu

mrshu Oct 30, 2013

Member

What happened to this?

@Adman can you finish it?

This comment has been minimized.

Copy link
@Adman

Adman Oct 30, 2013

Author Member

Seems that it doesn't work only on windows.

This comment has been minimized.

Copy link
@Adman

Adman Oct 30, 2013

Author Member

Ok, I fixed it, could you test it on your linux ?

This comment has been minimized.

Copy link
@mrshu

mrshu Oct 30, 2013

Member

Ok, what about the GetPaneByName function? That does not work too?

self._mgr.AddPane(self.python_sidebar,
wx.aui.AuiPaneInfo().Name("sidebar").
TopDockable(False).BottomDockable(False).
Caption('Sidebar').Right().PaneBorder(False))
self._mgr.Update()

def onPreferences(self, evt):
pref = PreferencesDialog(self, -1, 'Preferences')
pref.ShowModal()
Expand Down
2 changes: 1 addition & 1 deletion nxtemu/__progs__/ewall_avoider.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def main():
else:
OnFwd(OUT_AB, 80)

ticker()#lfixed
ticker()#lfixed

0 comments on commit 9c044cb

Please sign in to comment.