wxPython的Controls组件

本文介绍了wxPython中控件的分类,包括动态小组件、静态组件和其他组件,并详细解释了按钮作为控件的继承关系及其与其他窗口类别的区别。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Controls组件可以分为以下几类:

1、动态小组件:
wx.ToggleButton
wx.CheckBox
wx.TextCtrl
wx.SpinCtrl
wx.ComboBox
wx.BitmapButton
wx.Slider
wx.Choice
wx.RadioButton
wx.Button
wx.ScrollBar
wx.Grid
wx.RadioBox
wx.SpinButton
wx.ListBox

2、静态组件:
wx.StaticBitmap:
wx.StaticBox
wx.Gauge
wx.StaticText
wx.StaticLine

3、其他组件:
wx.ToolBar
wx.MenuBar
wx.StatusBar

 

The button widget inherits from 4 different base classes. The closest class is the wx.Control class.
A button widget is a kind of a small window. All widgets that appear on the screen are windows. Therefore they inherit from wx.Window class.
Not all widgets are controls. For example wx.Dialog is not a kind of control.wx.Frame it can contain any window that is not a frame or dialog
The controls are widgets that are placed on other widgets called containers. That's why we have a separate wx.Control base class.

 

这段话的总体意思是:button也是一个window,所有的可以展现在屏幕上的组件都是窗口,所以这些控制器都从wx.Windows继承;

wx.Dialog 不是一个控制器,这个构件和wx.Frame是同一个级别的,所以不能被wx.Frame所包含。

放置控制组件的组件是容器,所以我们才会有一个单独的wx.Controls基类

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值