admin管理员组文章数量:1417709
I want to create a button in applet popup menu, that shows a popup menu when clicked. My current attemt does show nothing:
const powerIcon = new St.Icon({style_class: 'footer-icon', y_align: St.Align.END, style: 'margin-right: 0', icon_name: 'system-shutdown'});
const powerIconButton = new St.Button({style_class: 'footer-button', x_align: St.Align.MIDDLE});
powerIconButton.add_actor(powerIcon);
powerIconButton.connect('clicked', Lang.bind(this, this._on_power_icon_clicked));
this.powerMenuManager = new PopupMenu.PopupMenuManager(powerIconButton);
this.powerMenu = new PopupMenu.PopupComboMenu(powerIconButton, {style_class: 'power-menu-box'});
this.powerMenu.addMenuItem(new PopupMenu.PopupComboBoxMenuItem({}));
this.powerMenuManager.addMenu(this.powerMenu);
... later in class
_on_power_icon_clicked() {
this.powerMenu.toggle();
}
is it possible, to impement a popup menu in a menu like this?
本文标签: cinnamonHow to show menu on StButtonStack Overflow
版权声明:本文标题:cinnamon - How to show menu on St.Button? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745275258a2651145.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论