- 浏览: 2541801 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
wxpython入门(六)菜单项
参考书籍
http://wiki.woodpecker.org.cn/moin/WxPythonInAction
第十章 创建和使用wxPython菜单
创建菜单
如何创建一个菜单栏
wx.MenuBar构造函数:wx.MenuBar()
一旦菜单栏被创建了,使用SetMenuBar()方法将它附加给一个wx.Frame(或其子类)。通常这些都在框架的__init__或OnInit()方法中实施:
menubar = wx.MenuBar()
self.SetMenuBar
如何创建一个菜单并把它附加到菜单栏
wx.Menu的构造函数:
wx.Menu(title="", style=0)
examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, "SimpleMenuExample")
p = wx.Panel(self)
menuBar = wx.MenuBar()# 创建一个菜单栏
menu = wx.Menu()# 创建一个菜单
menuBar.Append(menu, "Left")# 添加菜单到菜单栏
menu2 = wx.Menu()
menuBar.Append(menu2, "Middle")
menu3 = wx.Menu()
menuBar.Append(menu3, "Right")
self.SetMenuBar(menuBar)
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
给下拉菜单添加项目,使用wx.Menu的Append()方法:
Append(id, string, helpStr="", kind=wx.ITEM_NORMAL)
examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, "Simple Menu Example")
p = wx.Panel(self)
self.CreateStatusBar()
menu = wx.Menu()
simple = menu.Append(-1, "Simple menu item", "This is some help text")
menu.AppendSeparator() #分隔符
exit = menu.Append(-1, "Exit")
self.Bind(wx.EVT_MENU, self.OnSimple, simple)
self.Bind(wx.EVT_MENU, self.OnExit, exit)
menuBar = wx.MenuBar()
menuBar.Append(menu, "Simple Menu")
self.SetMenuBar(menuBar)
def OnSimple(self, event):
wx.MessageBox("You selected the simple menu item")
def OnExit(self, event):
self.Close()
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
运行时添加菜单,examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1,"Add Menu Items")
p = wx.Panel(self)
self.txt = wx.TextCtrl(p, -1, "new item")
btn = wx.Button(p, -1, "Add Menu Item")
self.Bind(wx.EVT_BUTTON, self.OnAddItem, btn)# 绑定按钮的事件
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(self.txt, 0, wx.ALL, 20)
sizer.Add(btn, 0, wx.TOP|wx.RIGHT, 20)
p.SetSizer(sizer)
self.menu = menu = wx.Menu()
simple = menu.Append(-1, "Simple menu item")
menu.AppendSeparator()
exit = menu.Append(-1, "Exit")
self.Bind(wx.EVT_MENU, self.OnSimple, simple)
self.Bind(wx.EVT_MENU, self.OnExit, exit)
menuBar = wx.MenuBar()
menuBar.Append(menu, "Menu")
self.SetMenuBar(menuBar)
def OnSimple(self, event):
wx.MessageBox("You selected the simple menu item")
def OnExit(self, event):
self.Close()
def OnAddItem(self, event):
item = self.menu.Append(-1, self.txt.GetValue())# 添加菜单项
self.Bind(wx.EVT_MENU, self.OnNewItemSelected, item)# 绑定一个菜单事件
def OnNewItemSelected(self, event):
wx.MessageBox("You selected a new item")
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
如何在一个菜单中找到一个特定的菜单项
examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1,"Find Item Example")
p = wx.Panel(self)
self.txt = wx.TextCtrl(p, -1, "new item")
btn = wx.Button(p, -1, "Add Menu Item")
self.Bind(wx.EVT_BUTTON, self.OnAddItem, btn)
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(self.txt, 0, wx.ALL, 20)
sizer.Add(btn, 0, wx.TOP|wx.RIGHT, 20)
p.SetSizer(sizer)
self.menu = menu = wx.Menu()
simple = menu.Append(-1, "Simple menu item")
menu.AppendSeparator()
exit = menu.Append(-1, "Exit")
self.Bind(wx.EVT_MENU, self.OnSimple, simple)
self.Bind(wx.EVT_MENU, self.OnExit, exit)
menuBar = wx.MenuBar()
menuBar.Append(menu, "Menu")
self.SetMenuBar(menuBar)
def OnSimple(self, event):
wx.MessageBox("You selected the simple menu item")
def OnExit(self, event):
self.Close()
def OnAddItem(self, event):
item = self.menu.Append(-1, self.txt.GetValue())
self.Bind(wx.EVT_MENU, self.OnNewItemSelected, item)
def OnNewItemSelected(self, event):
item = self.GetMenuBar().FindItemById(event.GetId()) #得到菜单项
text = item.GetText()
wx.MessageBox("You selected the '%s' item" % text)
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
控制一个菜单的有效和无效
examples:
import wx
ID_SIMPLE = wx.NewId()
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1,"Enable/Disable Menu Example")
p = wx.Panel(self)
self.btn = wx.Button(p, -1, "Disable Item", (20,20))
self.Bind(wx.EVT_BUTTON, self.OnToggleItem, self.btn)
menu = wx.Menu()
menu.Append(ID_SIMPLE, "Simple menu item")
self.Bind(wx.EVT_MENU, self.OnSimple, id=ID_SIMPLE)
menu.AppendSeparator()
menu.Append(wx.ID_EXIT, "Exit")
self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT)
menuBar = wx.MenuBar()
menuBar.Append(menu, "Menu")
self.SetMenuBar(menuBar)
def OnSimple(self, event):
wx.MessageBox("You selected the simple menu item")
def OnExit(self, event):
self.Close()
def OnToggleItem(self, event):
menubar = self.GetMenuBar()
enabled = menubar.IsEnabled(ID_SIMPLE)
menubar.Enable(ID_SIMPLE, not enabled)
self.btn.SetLabel((enabled and "Enable" or "Disable") + " Item")
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
菜单项与快捷键的关联(略)
开关菜单项
examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1,"Toggle Items Example")
p = wx.Panel(self)
menuBar = wx.MenuBar()
menu = wx.Menu()
exit = menu.Append(-1,"Exit")
self.Bind(wx.EVT_MENU,self.OnExit,exit)
menuBar.Append(menu, "Menu")
menu = wx.Menu()
menu.AppendCheckItem(-1, "CheckItem1")
menu.AppendCheckItem(-1, "CheckItem2")
menu.AppendCheckItem(-1, "CheckItem3")
menu.AppendSeparator()
menu.AppendRadioItem(-1, "RadioItem1")
menu.AppendRadioItem(-1, "RadioItem2")
menu.AppendRadioItem(-1, "RadioItem3")
menuBar.Append(menu, "Toggle Items")
self.SetMenuBar(menuBar)
def OnExit(self, event):
self.Close()
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
嵌套的子菜单
examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1,"Sub-menu Example")
p = wx.Panel(self)
menu = wx.Menu()
submenu = wx.Menu()
submenu.Append(-1,"Sub-item 1")
submenu.Append(-1,"Sub-item 2")
menu.AppendMenu(-1,"Sub-menu", submenu)#添加子菜单
menu.AppendSeparator()
exit = menu.Append(-1, "Exit")
self.Bind(wx.EVT_MENU, self.OnExit, exit)
menuBar = wx.MenuBar()
menuBar.Append(menu, "Menu")
self.SetMenuBar(menuBar)
def OnExit(self, event):
self.Close()
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
右键弹出式菜单
examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1,"Popup Menu Example")
self.panel = p = wx.Panel(self)
wx.StaticText(p, -1,
"Right-click on the panel to show a popup menu",
(25,25))
self.popupmenu = wx.Menu()#创建一个菜单
for text in "one two three four five".split():#填充菜单
item = self.popupmenu.Append(-1, text)
self.Bind(wx.EVT_MENU, self.OnPopupItemSelected, item)
p.Bind(wx.EVT_CONTEXT_MENU, self.OnShowPopup)#绑定一个显示菜单事件
def OnShowPopup(self, event):#弹出显示
pos = event.GetPosition()
pos = self.panel.ScreenToClient(pos)
self.panel.PopupMenu(self.popupmenu, pos)
def OnPopupItemSelected(self, event):
item = self.popupmenu.FindItemById(event.GetId())
text = item.GetText()
wx.MessageBox("You selected item '%s'" % text)
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
自定义的菜单
拷贝了一个小的png小图在菜单前面,examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1,"Fancier Menu Example")
p = wx.Panel(self)
menu = wx.Menu()
bmp = wx.Bitmap("open.png", wx.BITMAP_TYPE_PNG)
item = wx.MenuItem(menu, -1, "Open")
item.SetBitmap(bmp)#增加一个自定义的位图
menu.AppendItem(item)
font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
font.SetWeight(wx.BOLD)
item = wx.MenuItem(menu, -1, "Has Bold Font")
item.SetFont(font)#改变字体
menu.AppendItem(item)
item = wx.MenuItem(menu, -1, "Has Red Text")
item.SetTextColour("red")#改变文本颜色
menu.AppendItem(item)
menu.AppendSeparator()
exit = menu.Append(-1, "Exit")
self.Bind(wx.EVT_MENU, self.OnExit, exit)
menuBar = wx.MenuBar()
menuBar.Append(menu, "Menu")
self.SetMenuBar(menuBar)
def OnExit(self, event):
self.Close()
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
参考书籍
http://wiki.woodpecker.org.cn/moin/WxPythonInAction
第十章 创建和使用wxPython菜单
创建菜单
如何创建一个菜单栏
wx.MenuBar构造函数:wx.MenuBar()
一旦菜单栏被创建了,使用SetMenuBar()方法将它附加给一个wx.Frame(或其子类)。通常这些都在框架的__init__或OnInit()方法中实施:
menubar = wx.MenuBar()
self.SetMenuBar
如何创建一个菜单并把它附加到菜单栏
wx.Menu的构造函数:
wx.Menu(title="", style=0)
examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, "SimpleMenuExample")
p = wx.Panel(self)
menuBar = wx.MenuBar()# 创建一个菜单栏
menu = wx.Menu()# 创建一个菜单
menuBar.Append(menu, "Left")# 添加菜单到菜单栏
menu2 = wx.Menu()
menuBar.Append(menu2, "Middle")
menu3 = wx.Menu()
menuBar.Append(menu3, "Right")
self.SetMenuBar(menuBar)
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
给下拉菜单添加项目,使用wx.Menu的Append()方法:
Append(id, string, helpStr="", kind=wx.ITEM_NORMAL)
examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, "Simple Menu Example")
p = wx.Panel(self)
self.CreateStatusBar()
menu = wx.Menu()
simple = menu.Append(-1, "Simple menu item", "This is some help text")
menu.AppendSeparator() #分隔符
exit = menu.Append(-1, "Exit")
self.Bind(wx.EVT_MENU, self.OnSimple, simple)
self.Bind(wx.EVT_MENU, self.OnExit, exit)
menuBar = wx.MenuBar()
menuBar.Append(menu, "Simple Menu")
self.SetMenuBar(menuBar)
def OnSimple(self, event):
wx.MessageBox("You selected the simple menu item")
def OnExit(self, event):
self.Close()
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
运行时添加菜单,examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1,"Add Menu Items")
p = wx.Panel(self)
self.txt = wx.TextCtrl(p, -1, "new item")
btn = wx.Button(p, -1, "Add Menu Item")
self.Bind(wx.EVT_BUTTON, self.OnAddItem, btn)# 绑定按钮的事件
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(self.txt, 0, wx.ALL, 20)
sizer.Add(btn, 0, wx.TOP|wx.RIGHT, 20)
p.SetSizer(sizer)
self.menu = menu = wx.Menu()
simple = menu.Append(-1, "Simple menu item")
menu.AppendSeparator()
exit = menu.Append(-1, "Exit")
self.Bind(wx.EVT_MENU, self.OnSimple, simple)
self.Bind(wx.EVT_MENU, self.OnExit, exit)
menuBar = wx.MenuBar()
menuBar.Append(menu, "Menu")
self.SetMenuBar(menuBar)
def OnSimple(self, event):
wx.MessageBox("You selected the simple menu item")
def OnExit(self, event):
self.Close()
def OnAddItem(self, event):
item = self.menu.Append(-1, self.txt.GetValue())# 添加菜单项
self.Bind(wx.EVT_MENU, self.OnNewItemSelected, item)# 绑定一个菜单事件
def OnNewItemSelected(self, event):
wx.MessageBox("You selected a new item")
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
如何在一个菜单中找到一个特定的菜单项
examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1,"Find Item Example")
p = wx.Panel(self)
self.txt = wx.TextCtrl(p, -1, "new item")
btn = wx.Button(p, -1, "Add Menu Item")
self.Bind(wx.EVT_BUTTON, self.OnAddItem, btn)
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(self.txt, 0, wx.ALL, 20)
sizer.Add(btn, 0, wx.TOP|wx.RIGHT, 20)
p.SetSizer(sizer)
self.menu = menu = wx.Menu()
simple = menu.Append(-1, "Simple menu item")
menu.AppendSeparator()
exit = menu.Append(-1, "Exit")
self.Bind(wx.EVT_MENU, self.OnSimple, simple)
self.Bind(wx.EVT_MENU, self.OnExit, exit)
menuBar = wx.MenuBar()
menuBar.Append(menu, "Menu")
self.SetMenuBar(menuBar)
def OnSimple(self, event):
wx.MessageBox("You selected the simple menu item")
def OnExit(self, event):
self.Close()
def OnAddItem(self, event):
item = self.menu.Append(-1, self.txt.GetValue())
self.Bind(wx.EVT_MENU, self.OnNewItemSelected, item)
def OnNewItemSelected(self, event):
item = self.GetMenuBar().FindItemById(event.GetId()) #得到菜单项
text = item.GetText()
wx.MessageBox("You selected the '%s' item" % text)
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
控制一个菜单的有效和无效
examples:
import wx
ID_SIMPLE = wx.NewId()
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1,"Enable/Disable Menu Example")
p = wx.Panel(self)
self.btn = wx.Button(p, -1, "Disable Item", (20,20))
self.Bind(wx.EVT_BUTTON, self.OnToggleItem, self.btn)
menu = wx.Menu()
menu.Append(ID_SIMPLE, "Simple menu item")
self.Bind(wx.EVT_MENU, self.OnSimple, id=ID_SIMPLE)
menu.AppendSeparator()
menu.Append(wx.ID_EXIT, "Exit")
self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT)
menuBar = wx.MenuBar()
menuBar.Append(menu, "Menu")
self.SetMenuBar(menuBar)
def OnSimple(self, event):
wx.MessageBox("You selected the simple menu item")
def OnExit(self, event):
self.Close()
def OnToggleItem(self, event):
menubar = self.GetMenuBar()
enabled = menubar.IsEnabled(ID_SIMPLE)
menubar.Enable(ID_SIMPLE, not enabled)
self.btn.SetLabel((enabled and "Enable" or "Disable") + " Item")
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
菜单项与快捷键的关联(略)
开关菜单项
examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1,"Toggle Items Example")
p = wx.Panel(self)
menuBar = wx.MenuBar()
menu = wx.Menu()
exit = menu.Append(-1,"Exit")
self.Bind(wx.EVT_MENU,self.OnExit,exit)
menuBar.Append(menu, "Menu")
menu = wx.Menu()
menu.AppendCheckItem(-1, "CheckItem1")
menu.AppendCheckItem(-1, "CheckItem2")
menu.AppendCheckItem(-1, "CheckItem3")
menu.AppendSeparator()
menu.AppendRadioItem(-1, "RadioItem1")
menu.AppendRadioItem(-1, "RadioItem2")
menu.AppendRadioItem(-1, "RadioItem3")
menuBar.Append(menu, "Toggle Items")
self.SetMenuBar(menuBar)
def OnExit(self, event):
self.Close()
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
嵌套的子菜单
examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1,"Sub-menu Example")
p = wx.Panel(self)
menu = wx.Menu()
submenu = wx.Menu()
submenu.Append(-1,"Sub-item 1")
submenu.Append(-1,"Sub-item 2")
menu.AppendMenu(-1,"Sub-menu", submenu)#添加子菜单
menu.AppendSeparator()
exit = menu.Append(-1, "Exit")
self.Bind(wx.EVT_MENU, self.OnExit, exit)
menuBar = wx.MenuBar()
menuBar.Append(menu, "Menu")
self.SetMenuBar(menuBar)
def OnExit(self, event):
self.Close()
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
右键弹出式菜单
examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1,"Popup Menu Example")
self.panel = p = wx.Panel(self)
wx.StaticText(p, -1,
"Right-click on the panel to show a popup menu",
(25,25))
self.popupmenu = wx.Menu()#创建一个菜单
for text in "one two three four five".split():#填充菜单
item = self.popupmenu.Append(-1, text)
self.Bind(wx.EVT_MENU, self.OnPopupItemSelected, item)
p.Bind(wx.EVT_CONTEXT_MENU, self.OnShowPopup)#绑定一个显示菜单事件
def OnShowPopup(self, event):#弹出显示
pos = event.GetPosition()
pos = self.panel.ScreenToClient(pos)
self.panel.PopupMenu(self.popupmenu, pos)
def OnPopupItemSelected(self, event):
item = self.popupmenu.FindItemById(event.GetId())
text = item.GetText()
wx.MessageBox("You selected item '%s'" % text)
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
自定义的菜单
拷贝了一个小的png小图在菜单前面,examples:
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1,"Fancier Menu Example")
p = wx.Panel(self)
menu = wx.Menu()
bmp = wx.Bitmap("open.png", wx.BITMAP_TYPE_PNG)
item = wx.MenuItem(menu, -1, "Open")
item.SetBitmap(bmp)#增加一个自定义的位图
menu.AppendItem(item)
font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
font.SetWeight(wx.BOLD)
item = wx.MenuItem(menu, -1, "Has Bold Font")
item.SetFont(font)#改变字体
menu.AppendItem(item)
item = wx.MenuItem(menu, -1, "Has Red Text")
item.SetTextColour("red")#改变文本颜色
menu.AppendItem(item)
menu.AppendSeparator()
exit = menu.Append(-1, "Exit")
self.Bind(wx.EVT_MENU, self.OnExit, exit)
menuBar = wx.MenuBar()
menuBar.Append(menu, "Menu")
self.SetMenuBar(menuBar)
def OnExit(self, event):
self.Close()
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show()
app.MainLoop()
发表评论
-
NodeJS12 and Zlib
2020-04-01 07:44 468NodeJS12 and Zlib It works as ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 328Traefik 2020(1)Introduction and ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 428Private Registry 2020(1)No auth ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 376Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 465NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 413Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 330Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 242GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 443GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 320GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 306Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 310Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 285Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 302Serverless with NodeJS and Tenc ... -
NodeJS MySQL Library and npmjs
2020-02-07 06:21 278NodeJS MySQL Library and npmjs ... -
Python Library 2019(1)requests and aiohttp
2019-12-18 01:12 256Python Library 2019(1)requests ... -
NodeJS Installation 2019
2019-10-20 02:57 565NodeJS Installation 2019 Insta ... -
Monitor Tool 2019(2)Monit on Multiple Instances and Email Alerts
2019-10-18 10:57 256Monitor Tool 2019(2)Monit on Mu ... -
Sqlite Database 2019(1)Sqlite3 Installation and Docker phpsqliteadmin
2019-09-05 11:24 361Sqlite Database 2019(1)Sqlite3 ... -
Supervisor 2019(2)Ubuntu and Multiple Services
2019-08-19 10:53 363Supervisor 2019(2)Ubuntu and Mu ...
相关推荐
- 菜单条和菜单项的创建 - 菜单事件处理 - **第11章**:使用sizer放置小部件 - sizer的作用及其类型 - 不同类型的sizer布局管理 - **第12章**:操作基本图形图像 - 图像加载与显示 - 图像处理技术 - **第三...
- 展示了如何创建菜单栏和上下文菜单,以及如何响应菜单项的选择。 - **第十一章:使用sizer放置构件** - 讲解了sizer的作用及其使用方法,帮助开发者更好地控制控件的位置和大小。 - **第十二章:操作基本图像** ...
- **创建过程**:步骤式指导如何创建和添加菜单项到应用程序中。 - **动态更新**:探讨如何根据用户的选择动态地修改菜单内容。 9. **布局管理与Sizers** - **Sizers概念**:解释Sizers的作用及其在wxPython布局...
- **创建菜单**:首先创建一个`wx.Menu`对象,然后使用`Append()`方法添加菜单项。 - **创建菜单栏**:使用`wx.MenuBar`类来创建菜单栏,并将各个菜单添加到其中。 - **绑定事件处理**:通过`Bind()`方法将事件绑定...
4. **MenuBar**:用于创建菜单栏,放置各种菜单项。 5. **ToolBar**:创建工具栏,放置快捷操作按钮。 在使用wxFormBuilder时,通常需要遵循以下步骤: 1. **添加组件**:向Frame、Panel或其他容器中添加所需的...
这些库允许用户通过点击按钮、选择菜单项等方式与程序交互,而非仅仅通过命令行。在本项目中,小组可能使用这些库设计了一个应用程序,让用户能够直观地加载、查看和分析ARGO数据,甚至执行一些基本的数据处理操作。...
书中可能会讲解wxPython控件的使用,如面板、菜单、对话框等,并展示如何实现复杂的用户交互。 3. PyQt:基于Qt库的Python绑定,功能强大且支持多种操作系统。书中可能涵盖了QWidgets、QML、信号与槽机制等核心概念...
2. **消息处理**:处理来自用户的事件,如点击按钮、选择菜单项等。 3. **窗口类注册**:定义窗口的样式、颜色、字体等属性。 4. **控件操作**:创建和操作各种窗口控件,如按钮、列表框、文本框等。 5. **绘图**:...
7. **菜单栏和菜单项**:Tkinter允许创建菜单栏和下拉菜单,这些菜单可以包含多个菜单项,每个菜单项可以关联一个回调函数。 8. **图像显示**:Tkinter支持显示图像,使用`PhotoImage`类可以加载和显示图片。 9. *...
在本章中,我们将深入探讨如何使用Python来创建图形用户界面(GUI,Graphical User Interface),这是一项重要的技能,能够帮助开发者构建具有直观交互性的应用软件。GUI为用户提供了一种易于理解和使用的操作方式,...