如何添加标签到wxWidgets wxBitmapButton? [英] How do I add a label to wxWidgets wxBitmapButton?

查看:364
本文介绍了如何添加标签到wxWidgets wxBitmapButton?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用具有标签(文字)和图片或图标的wxWidgets创建按钮。如果我选择wxBitmapButton有一个称为标签的字段。但是每当我在该字段中写任何东西,它不会更新wxFormBuilder中的代码。我也试过wxButton-> SetLabel(),但没有运气。

How do I create a button using wxWidgets that has both a label(text) and an image or icon. If I select wxBitmapButton there is a field called "label". But whenever I write anything in that field it doesn't update code in the wxFormBuilder. I have also tried wxButton->SetLabel() but no luck.

任何帮助或建议将不胜感激。

Any help or suggestions would be appreciated.

推荐答案

只能在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.

这篇关于如何添加标签到wxWidgets wxBitmapButton?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆