添加笔记本时,在gtk中看不到sashwindow鼠标抓取器光标

时间:2019-06-30 09:41:22

标签: wxpython

如果将wxNotebook添加到wxSashWindow,则看不到调整大小的鼠标光标。 如果我添加一个wxText而不是wxNotebook,它将起作用。 如果用户尝试调整右侧左侧窗扇窗口的大小,则调整大小抓手应该可见。

这仅在gtk中,在Windows中有效。 我的问题:有什么解决方法吗?是bug,win32和gtk之间的平台不一致吗? 谢谢

import wx

def OnSashDrag(event):
    eobj = event.GetEventObject()
    if eobj is sash1:
        eobj.SetSize((event.GetDragRect().width, 200))

app = wx.App()
frame = wx.Frame(None, -1, 'Frame')
sash1 = wx.SashWindow(frame, style=wx.SW_3D)
sash1.SetSashVisible(wx.SASH_RIGHT, True)
sash1.SetSize((200, 200))
sash2 = wx.SashWindow(frame, style=wx.SW_3D)
sash2.SetSize((200, 200))
sash2.SetPosition((250,0))
sash2.SetSashVisible(wx.SASH_LEFT, True)
frame.Bind(wx.EVT_SASH_DRAGGED_RANGE, OnSashDrag)

#only in gtk, in win32 it works (grip is shown) with notebook
#annoying, is it a bug in gtk only?
#python 2.7.9 and wxpython 2.8.12.1
nb1 = wx.Notebook(sash1, -1, wx.DefaultPosition, (-1, -1))#, wx.CLIP_CHILDREN)

#if line above is comment out, and remove comment on following line, the sash window drag grip is shown in gtik
#tb = wx.TextCtrl(sash1, -1, "test", wx.DefaultPosition, (-1, -1))

frame.Show()
app.MainLoop()

0 个答案:

没有答案