且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何添加标签到wxWidgets wxBitmapButton?

更新时间:2023-12-06 12:07:16

只能在wxWidgets 2.9.1或更高版本中执行此操作,并且可以使用wxBitmapButton或wxButton。引用文档

You can only do this in wxWidgets 2.9.1 or greater and can use either a wxBitmapButton or wxButton. To quote from the documentation:

从版本2.9.1开始,wxButton支持显示文本和图像
(目前只有在使用wxMSW,wxGTK或wxOSX / Cocoa ports时),参见
SetBitmap SetBitmapLabel(),SetBitmapDisabled()方法。在
中,以前的wxWidgets版本这个功能只有可用的
(现在很简单)wxBitmapButton类,它只能
显示没有文本的图像。

Since version 2.9.1 wxButton supports showing both text and an image (currently only when using wxMSW, wxGTK or wxOSX/Cocoa ports), see SetBitmap() and SetBitmapLabel(), SetBitmapDisabled() methods. In the previous wxWidgets versions this functionality was only available in (the now trivial) wxBitmapButton class which was only capable of showing an image without text.