cinnamon - How to show menu on St.Button? - Stack Overflow

I want to create a button in applet popup menu, that shows a popup menu when clicked.My current attemt

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?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745275259a4620000.html

相关推荐

  • cinnamon - How to show menu on St.Button? - Stack Overflow

    I want to create a button in applet popup menu, that shows a popup menu when clicked.My current attemt

    4小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信