在本文中,我們將學習與wxPython的wx.StatusBar類關聯的GetBorders()函數。 GetBorders()函數返回在字段區域內渲染字段文本時使用的水平和垂直邊框。
請注意,GetFieldRect返回的rect已經說明了此函數返回的水平和垂直邊框。
用法: wx.StatusBar.GetBorders(self)
參數:GetBorders()函數不需要任何參數。
代碼示例:
import wx
class Example(wx.Frame):
def __init__(self, *args, **kwargs):
super(Example, self).__init__(*args, **kwargs)
self.InitUI()
def InitUI(self):
self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)
self.statusbar = wx.StatusBar()
self.statusbar.Create(self, id = 1, style = wx.STB_DEFAULT_STYLE,
name = "Status Bar")
self.SetStatusBar(self.statusbar)
self.SetSize((350, 250))
# PRINT THE RETURNED wx.Size OBJECT
print(self.statusbar.GetBorders())
self.SetTitle('New Frame Title')
self.Centre()
def main():
app = wx.App()
ex = Example(None)
ex.Show()
app.MainLoop()
if __name__ == '__main__':
main()
輸出:
相關用法
- wxPython wx.MenuBar Attach()用法及代碼示例
- wxPython wx.Button SetLabel()用法及代碼示例
- wxPython wx.Button SetDefault()用法及代碼示例
- wxPython wx.MenuItem IsSeparator()用法及代碼示例
- wxPython wx.MenuItem IsSubMenu()用法及代碼示例
- wxPython wx.ToolBar SetDropdownMenu()用法及代碼示例
- wxPython wx.MenuItem SetBackgroundColour()用法及代碼示例
- wxPython wx.StatusBar Create()用法及代碼示例
- wxPython wx.ToolBar InsertSeparator()用法及代碼示例
- wxPython wx.MenuBar IsChecked()用法及代碼示例
注:本文由純淨天空篩選整理自RahulSabharwal大神的英文原創作品 wxPython – GetBorders() function in wx.StatusBar。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。