简体   繁体   中英

Splitter window display issue

I am writing a program which has a TreeCtrl on the left and a RichTextCtrl on the right. Following is the code of the splitter, panel and other elements.

The problem is that in windows, the bottom of the treectrl and textctrl is hidden. The statusbar covers the bottom of the splitter. But even after removing the statusbar I cannot see the bottom of the treectrl (hides up to 6 rows).

self.panel=wx.Panel(self,wx.ID_ANY)
self.splitter=wx.SplitterWindow(
    self.panel,-1,size=wx.DisplaySize(),style=wx.SP_LIVE_UPDATE)
self.splitter.SetMinimumPaneSize(5)
self.datatree=wx.TreeCtrl(self.splitter,1,style=wx.TR_HIDE_ROOT|wx.TR_ROW_LINES)
self.display=wx.richtext.RichTextCtrl(
    self.splitter,1,style=wx.VSCROLL|wx.HSCROLL|wx.WANTS_CHARS)
self.display.SetFont(self.displayfont)
self.handler=wx.richtext.RichTextXMLHandler()
self.splitter.SplitVertically(self.datatree,self.display)
self.logger=self.CreateStatusBar()

I think the issue here may be that you've explicitly told the SplitterWindow to take up the entire display size. Try omitting the size argument to the constructor, or adjust it down some, to see if that has any effect.

If omitting the size parameter does not help, I'd suggest creating Panels with Sizers that contain your Tree and your Rich Text Control, then splitting those Panels vertically within the Splitter Window.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM