如何为gnotebook()标签分配图标? [英] How to assign icons to `gnotebook()` tabs?

查看:103
本文介绍了如何为gnotebook()标签分配图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用gWidgets2创建一个选项卡式GUI,我希望每个选项卡都具有一个关联的图标(图像).

I am using gWidgets2 to create a tabbed GUI, and I would like each tab to have an associated icon (image).

考虑:

require(gWidgets2)
w <- gwindow("notebook example", visible=T)
nb <- gnotebook(container=w)
gbutton("Refresh", label="Refresh", container=nb) ## note label argument
gbutton("Info", label="Info", container=nb)

如何在第一个标签的标签旁边分配refresh图标?第二个选项卡上的info图标?

How can I assign the refresh icon next to the label of the 1st tab? And the info icon to the 2nd tab?

推荐答案

使用最新的gWidgets2RGtk2 GIT,您可以轻松完成:

With latest GIT of gWidgets2RGtk2 you can simply do:

nb$add_tab_icon(1, "refresh")
nb$add_tab_icon(2, "info")

这篇关于如何为gnotebook()标签分配图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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