2014-01-10 2 views
1

에게 좋은 결과가 발생합니다하나의 SimpleButton 나쁜 레이아웃

enter image description here

나쁜 결과 : 나는 사용자 경험이없는

enter image description here

따라서 리본 인터페이스를 사용하면 어떤 일이 발생하는지 이해할 수 없습니다.

  • 버그입니까?
  • 의도 된 동작입니까? 어떻게 든 레이아웃을 조정해야합니까?

코드 :

import wx 
import wx.lib.agw.ribbon as RB 
#import ribbon as RB 

class MyDialog(wx.Dialog): 
    def __init__(self, *ls, **kw): 
    wx.Dialog.__init__(self, *ls, **kw) 
    ribbon = RB.RibbonBar(self, -1) 

    page = RB.RibbonPage(ribbon, wx.ID_ANY, "Page") 
    panel = RB.RibbonPanel(page, wx.ID_ANY, "Create Project") 
    bbar = RB.RibbonButtonBar(panel) 
    bmp = wx.ArtProvider.GetBitmap(wx.ART_NEW, wx.ART_OTHER, wx.Size(48, 48)) 
    bbar.AddSimpleButton(wx.ID_ANY, "New", bmp, '') 
    #bbar.AddSimpleButton(wx.ID_ANY, "New2", bmp, '') # uncomment for the good result 

    ribbon.Realize() 
    s = wx.BoxSizer(wx.VERTICAL) 
    s.Add(ribbon, 0, wx.EXPAND) 
    self.SetSizer(s) 

app = wx.PySimpleApp() 
dlg = MyDialog(None, title="Test Ribbon", size=(200,150)) 
dlg.ShowModal() 
dlg.Destroy() 

답변

관련 문제