Python 在Gtk.poover菜单中创建一个无线电操作

Python 在Gtk.poover菜单中创建一个无线电操作,python,gtk,gtk3,pygobject,Python,Gtk,Gtk3,Pygobject,在我的上一个问题()中,我可以找到一种方法来创建一个Gtk.poovermenu,其中包含一些model按钮(正常和切换)。但我真的很难用这种方式创建单选按钮 使用Gtk.ActionGroups,但它们是从Gtk 3.10开始的。我不知道如何构建一个Gio.ActionGroup(): 及 这同样适用于Gio.ActionMap(): 以及: 我不知道为什么会这样: actionmap = Gio.ActionMap.add_action(self, action_yes) a

在我的上一个问题()中,我可以找到一种方法来创建一个
Gtk.poovermenu
,其中包含一些
model按钮(正常和切换)。但我真的很难用这种方式创建单选按钮

使用
Gtk.ActionGroups
,但它们是从Gtk 3.10开始的。我不知道如何构建一个
Gio.ActionGroup
():

这同样适用于Gio.ActionMap
():

以及:

我不知道为什么会这样:

    actionmap = Gio.ActionMap.add_action(self, action_yes)
    actionmap = Gio.ActionMap.add_action(self, action_no)
希望有人能帮我解决这个问题:

from gi.repository import Gio, Gtk, GLib
import sys


class MainApplication(Gtk.Application):

    def __init__(self):
        Gtk.Application.__init__(self,
                                 application_id="needs.dot",
                                 flags=Gio.ApplicationFlags.FLAGS_NONE)
        self.connect("activate", self.activate_window)

    def activate_window(self, app):
        """
        The activate signal of Gtk.Application passes the MainApplication class
        to the window. The window is then set as a window of that class.
        """
        self.window = Gtk.ApplicationWindow()
        self.window.set_default_size(500, 400)

        self.hb = Gtk.HeaderBar()
        self.hb.set_show_close_button(True)
        self.hb.props.title = "HeaderBar & PopOverMenu"
        self.window.set_titlebar(self.hb)

        button_settings = Gtk.MenuButton()
        icon = Gio.ThemedIcon(name="format-justify-fill-symbolic")
        image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.BUTTON)
        button_settings.add(image)
        self.hb.pack_end(button_settings)

        self.builder = Gtk.Builder()
        self.builder.add_from_file("actionmap_layout.xml")
        pom_options = self.builder.get_object("pom_options")
        button_settings.set_popover(pom_options)
        #self.builder.connect_signals(self) #Not needed because of using actions?

        app.add_window(self.window)

        action_print = Gio.SimpleAction.new("print", None)
        action_print.connect("activate", self.print_something)
        app.add_action(action_print)

        action_toggle = Gio.SimpleAction.new_stateful("toggle", None, GLib.Variant.new_boolean(False))
        action_toggle.connect("change-state", self.toggle_toggled)
        app.add_action(action_toggle)

        action_yes = Gio.SimpleAction.new("yes", None)
        action_yes.connect("activate", self.print_something)
        app.add_action(action_yes)

        action_no = Gio.SimpleAction.new("no", None)
        action_no.connect("activate", self.print_something)
        app.add_action(action_no)
        actionmap = Gio.ActionMap.add_action(self, action_yes)
        actionmap = Gio.ActionMap.add_action(self, action_no)
        #action_group = Gio.ActionGroup.new()

        btn = Gtk.Button("Button")
        self.window.add(btn)
        self.window.show_all()

    def print_something(self, action, variable):
        print("something")

    def toggle_toggled(self, action, state):
        action.set_state(state)
        Gtk.Settings.get_default().set_property("gtk-application-prefer-dark-theme", state)

    def on_action_quit_activated(self, action):
        self.app.quit()


if __name__ == "__main__":
    """
    Creates an instance of the MainApplication class that inherits from
    Gtk.Application.
    """
    app = MainApplication()
    app.run(sys.argv)
XML接口:

<interface>
    <object class="GtkPopoverMenu" id ="pom_options">
      <child>
        <object class="GtkBox">
          <property name="visible">True</property>
          <property name="margin">10</property>
          <property name="orientation">vertical</property>
          <child>
            <object class="GtkModelButton" id="mb_print">
              <property name="visible">True</property>
              <property name="action-name">app.print</property>
              <property name="can_focus">True</property>
              <property name="receives_default">True</property>
              <property name="label" translatable="yes">Print</property>
            </object>
          </child>
          <child>
            <object class="GtkModelButton" id="mp_toggle">
              <property name="visible">True</property>
              <property name="action-name">app.toggle</property>
              <property name="can_focus">True</property>
              <property name="receives_default">True</property>
              <property name="label" translatable="yes">Night Mode</property>
            </object>
          </child>
          <child>
            <object class="GtkModelButton" id="mp_yes">
              <property name="visible">True</property>
              <property name="action-name">app.yes</property>
              <property name="can_focus">True</property>
              <property name="receives_default">True</property>
              <property name="label" translatable="yes">Yes</property>
            </object>
          </child>
          <child>
            <object class="GtkModelButton" id="mp_no">
              <property name="visible">True</property>
              <property name="action-name">app.no</property>
              <property name="can_focus">True</property>
              <property name="receives_default">True</property>
              <property name="label" translatable="yes">No</property>
            </object>
          </child>
        </object>
      </child>
    </object>
</interface>

真的
10
垂直的
真的
app.print
真的
真的
印刷品
真的
应用程序切换
真的
真的
夜间模式
真的
是的
真的
真的
对
真的
应用程序编号
真的
真的
不

还有一个。但它也没有说明如何正确使用收音机。切换似乎很简单,如上面的示例所示。

我修改了几周前编写的一些代码。这可能会有所帮助。与您尝试做的事情相比,这有点简单,但是,另一方面,它是有效的

有很多额外的代码。RadioMenuButtons是在MyPopup函数中创建的。它通过
btndef
参数调用,该参数包含一个元组列表。如果元组包含多个元素,则它将生成一个radiobutton组

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#  test_gtk3_popover.py
#  
#  Copyright 2015 John Coppens <john@jcoppens.com>
#  
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#  
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#  
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#  MA 02110-1301, USA.
#  
#

from gi.repository import Gtk

class MyPopup(Gtk.MenuButton):
    def __init__(self, btndefs):
        super(MyPopup, self).__init__()

        self.menu = Gtk.Menu()
        self.set_popup(self.menu)
        self.set_label(">")
        self.set_direction(Gtk.ArrowType.RIGHT)

        for btndef in btndefs:
            if len(btndef) == 1:                # This is a normal button
                item = Gtk.MenuItem()
                item.set_label(btndef[0])
                item.show()
                self.menu.append(item)
            else:
                group = None
                for radiodef in btndef:         # It's a selection of radiobuttons
                    item = Gtk.RadioMenuItem(label = radiodef)
                    if group == None:
                        group = item
                    else:
                        item.set_property("group", group)
                    item.show()
                    self.menu.append(item)


class MainWindow(Gtk.Window):
    def __init__(self):
        super(MainWindow, self).__init__()
        self.set_size_request(200, -1)
        self.connect("destroy", lambda x: Gtk.main_quit())

        self.hbox = Gtk.Box(orientation = Gtk.Orientation.HORIZONTAL)
        self.entry = Gtk.Entry()

        self.popup = MyPopup( (("String", "String no case", "Hexadecimal"),
                               ("Regexp",)) )

        self.hbox.pack_start(self.entry, True, True, 0)
        self.hbox.pack_start(self.popup, False, True, 0)

        self.add(self.hbox)

        self.show_all()

    def run(self):
        Gtk.main()


def main():
    mw = MainWindow()
    mw.run()
    return 0

if __name__ == '__main__':
    main()
#/usr/bin/env python
#-*-编码:utf-8-*-
#
#test_gtk3_popover.py
#  
#版权所有2015 John Coppens
#  
#这个程序是自由软件;您可以重新分发和/或修改它
#它是根据GNU通用公共许可证的条款发布的
自由软件基金会;许可证的第2版,或
#(由您选择)任何更高版本。
#  
#这个节目的发布是希望它会有用,
#但无任何保证;甚至没有任何关于
#适销性或适合某一特定目的。见
#有关更多详细信息,请参阅GNU通用公共许可证。
#  
#您应该已经收到GNU通用公共许可证的副本
#与此同时,;如果没有,请写信给自由软件
波士顿基金会51楼富兰克林街第五楼
#MA 02110-1301,美国。
#  
#
从gi.repository导入Gtk
类MyPopup(Gtk.MenuButton):
定义初始(自我,btndefs):
超级(MyPopup,self)。\uuuuu init\uuuuuuuuu()
self.menu=Gtk.menu()
self.set_弹出窗口(self.menu)
self.set_标签(“>”)
自设置方向(Gtk.箭头类型.右侧)
对于btndefs中的btndef:
如果len(btndef)=1:#这是一个正常按钮
item=Gtk.MenuItem()
item.set_标签(btndef[0])
项目.显示()
self.menu.append(项)
其他:
组=无
对于btndef中的radiodef:#这是一个单选按钮的选择
项目=Gtk.RadioMenuItem(标签=radiodef)
如果组==无:
组=项目
其他:
item.set_属性(“组”,组)
项目.显示()
self.menu.append(项)
类主窗口(Gtk.Window):
定义初始化(自):
超级(主窗口,自我)。\uuuu初始化
自我设置大小请求(200,-1)
self.connect(“销毁”,lambda x:Gtk.main_quit())
self.hbox=Gtk.Box(方向=Gtk.orientation.卧式)
self.entry=Gtk.entry()
self.popup=MyPopup(((“字符串”、“字符串无大小写”、“十六进制”),
(“Regexp”,))
self.hbox.pack\u启动(self.entry,True,True,0)
self.hbox.pack_start(self.popup,False,True,0)
self.add(self.hbox)
self.show_all()
def运行(自):
Gtk.main()
def main():
mw=主窗口()
mw.run()
返回0
如果uuuu name uuuuuu='\uuuuuuu main\uuuuuuu':
main()
我最近和他谈过,他有一个放射性行动小组的工作实例()。我根据问题相应地改编了我的例子。请注意XML接口的不同结构

Python:

import gi
gi.require_version("Gtk", "3.0")

from gi.repository import Gio, Gtk, GLib
import sys


class MainApplication(Gtk.Application):

    def __init__(self):
        Gtk.Application.__init__(self,
                                 application_id="needs.dots",
                                 flags=Gio.ApplicationFlags.FLAGS_NONE)
        # https://developer.gnome.org/gio/unstable/GApplication.html#g-application-id-is-valid
        self.connect("activate", self.activate_window)

    def activate_window(self, app):
        """
        The activate signal of Gtk.Application passes the
        MainApplication class
        to the window. The window is then set as a window
        of that class.
        """
        self.window = Gtk.ApplicationWindow()
        self.window.set_default_size(500, 400)
        app.add_window(self.window)

        self.hb = Gtk.HeaderBar()
        self.hb.set_show_close_button(True)
        self.hb.props.title = "HeaderBar & PopOverMenu"
        self.window.set_titlebar(self.hb)

        button_settings = Gtk.MenuButton()
        icon = Gio.ThemedIcon(name="format-justify-fill-symbolic")
        image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.BUTTON)
        button_settings.add(image)
        self.hb.pack_end(button_settings)

        self.builder = Gtk.Builder()
        self.builder.add_from_file("popovermenu_layout.xml")
        button_settings.set_menu_model(\
                        self.builder.get_object('options-menu'))

        # Add radiobutton group that includes all actions that
        # are named ***.radiogroup, 'radio-two' is the default
        # choice.
        detail_level = Gio.SimpleAction.new_stateful("radiogroup", \
                           GLib.VariantType.new("s"), \
                           GLib.Variant("s", "radio-two"))
        detail_level.connect("activate", self.radio_response)
        self.window.add_action(detail_level)

        # Connects to the action. The first part of the XML name
        # is left away:
        # <property name="action-name">app.print</property>
        # becomes simply "print".
        action_print = Gio.SimpleAction.new("print", None)
        action_print.connect("activate", self.print_something)
        app.add_action(action_print)

        # app.toggle becomes -> toggle
        action_toggle = Gio.SimpleAction.new_stateful("toggle", \
                            None, GLib.Variant.new_boolean(False))
        action_toggle.connect("change-state", self.toggle_toggled)
        app.add_action(action_toggle)

        btn = Gtk.Button("Button")
        self.window.add(btn)
        self.window.show_all()

    def print_something(self, action, variable):
        print("something")

    def toggle_toggled(self, action, state):
        action.set_state(state)
        Gtk.Settings.get_default().set_property( \
                "gtk-application-prefer-dark-theme", state)

    def radio_response(self, act_obj, act_lbl):
        # Not sure if this is the correct way of doing this.
        # but it seems to work.
        act_obj.set_state(act_lbl)

    def on_action_quit_activated(self, action):
        self.app.quit()

if __name__ == "__main__":
    """
    Creates an instance of the MainApplication class
    that inherits from Gtk.Application.
    """
    app = MainApplication()
    app.run(sys.argv)
导入gi
gi.要求_版本(“Gtk”、“3.0”)
从gi.repository导入Gio、Gtk、GLib
导入系统
主要应用类别(Gtk.应用):
定义初始化(自):
Gtk.应用程序_u初始_;(自身、,
application_id=“needs.dots”,
flags=Gio.ApplicationFlags.flags(无)
# https://developer.gnome.org/gio/unstable/GApplication.html#g-应用程序id有效
自连接(“激活”,自激活窗口)
def激活_窗口(自身、应用程序):
"""
Gtk的激活信号。应用程序通过
主应用程序类
到窗口。然后将窗口设置为窗口
那一类的。
"""
self.window=Gtk.ApplicationWindow()
self.window.set\u默认大小(500400)
应用程序添加窗口(自窗口)
self.hb=Gtk.HeaderBar()
self.hb.set\u show\u close\u按钮(真)
self.hb.props.title=“HeaderBar和PopOverMenu”
self.window.set_标题栏(self.hb)
按钮设置=Gtk.MenuButton()
icon=Gio.ThemedIcon(name=“format justify fill symbol”)
image=Gtk.image.new_from_gicon(图标,Gtk.IconSize.BUTTON)
按钮设置。添加(图像)
self.hb.pack\u end(按钮设置)
self.builder=Gtk.builder()
self.builder.add_from_文件(“弹出菜单”)
from gi.repository import Gio, Gtk, GLib
import sys


class MainApplication(Gtk.Application):

    def __init__(self):
        Gtk.Application.__init__(self,
                                 application_id="needs.dot",
                                 flags=Gio.ApplicationFlags.FLAGS_NONE)
        self.connect("activate", self.activate_window)

    def activate_window(self, app):
        """
        The activate signal of Gtk.Application passes the MainApplication class
        to the window. The window is then set as a window of that class.
        """
        self.window = Gtk.ApplicationWindow()
        self.window.set_default_size(500, 400)

        self.hb = Gtk.HeaderBar()
        self.hb.set_show_close_button(True)
        self.hb.props.title = "HeaderBar & PopOverMenu"
        self.window.set_titlebar(self.hb)

        button_settings = Gtk.MenuButton()
        icon = Gio.ThemedIcon(name="format-justify-fill-symbolic")
        image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.BUTTON)
        button_settings.add(image)
        self.hb.pack_end(button_settings)

        self.builder = Gtk.Builder()
        self.builder.add_from_file("actionmap_layout.xml")
        pom_options = self.builder.get_object("pom_options")
        button_settings.set_popover(pom_options)
        #self.builder.connect_signals(self) #Not needed because of using actions?

        app.add_window(self.window)

        action_print = Gio.SimpleAction.new("print", None)
        action_print.connect("activate", self.print_something)
        app.add_action(action_print)

        action_toggle = Gio.SimpleAction.new_stateful("toggle", None, GLib.Variant.new_boolean(False))
        action_toggle.connect("change-state", self.toggle_toggled)
        app.add_action(action_toggle)

        action_yes = Gio.SimpleAction.new("yes", None)
        action_yes.connect("activate", self.print_something)
        app.add_action(action_yes)

        action_no = Gio.SimpleAction.new("no", None)
        action_no.connect("activate", self.print_something)
        app.add_action(action_no)
        actionmap = Gio.ActionMap.add_action(self, action_yes)
        actionmap = Gio.ActionMap.add_action(self, action_no)
        #action_group = Gio.ActionGroup.new()

        btn = Gtk.Button("Button")
        self.window.add(btn)
        self.window.show_all()

    def print_something(self, action, variable):
        print("something")

    def toggle_toggled(self, action, state):
        action.set_state(state)
        Gtk.Settings.get_default().set_property("gtk-application-prefer-dark-theme", state)

    def on_action_quit_activated(self, action):
        self.app.quit()


if __name__ == "__main__":
    """
    Creates an instance of the MainApplication class that inherits from
    Gtk.Application.
    """
    app = MainApplication()
    app.run(sys.argv)
<interface>
    <object class="GtkPopoverMenu" id ="pom_options">
      <child>
        <object class="GtkBox">
          <property name="visible">True</property>
          <property name="margin">10</property>
          <property name="orientation">vertical</property>
          <child>
            <object class="GtkModelButton" id="mb_print">
              <property name="visible">True</property>
              <property name="action-name">app.print</property>
              <property name="can_focus">True</property>
              <property name="receives_default">True</property>
              <property name="label" translatable="yes">Print</property>
            </object>
          </child>
          <child>
            <object class="GtkModelButton" id="mp_toggle">
              <property name="visible">True</property>
              <property name="action-name">app.toggle</property>
              <property name="can_focus">True</property>
              <property name="receives_default">True</property>
              <property name="label" translatable="yes">Night Mode</property>
            </object>
          </child>
          <child>
            <object class="GtkModelButton" id="mp_yes">
              <property name="visible">True</property>
              <property name="action-name">app.yes</property>
              <property name="can_focus">True</property>
              <property name="receives_default">True</property>
              <property name="label" translatable="yes">Yes</property>
            </object>
          </child>
          <child>
            <object class="GtkModelButton" id="mp_no">
              <property name="visible">True</property>
              <property name="action-name">app.no</property>
              <property name="can_focus">True</property>
              <property name="receives_default">True</property>
              <property name="label" translatable="yes">No</property>
            </object>
          </child>
        </object>
      </child>
    </object>
</interface>
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#  test_gtk3_popover.py
#  
#  Copyright 2015 John Coppens <john@jcoppens.com>
#  
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#  
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#  
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#  MA 02110-1301, USA.
#  
#

from gi.repository import Gtk

class MyPopup(Gtk.MenuButton):
    def __init__(self, btndefs):
        super(MyPopup, self).__init__()

        self.menu = Gtk.Menu()
        self.set_popup(self.menu)
        self.set_label(">")
        self.set_direction(Gtk.ArrowType.RIGHT)

        for btndef in btndefs:
            if len(btndef) == 1:                # This is a normal button
                item = Gtk.MenuItem()
                item.set_label(btndef[0])
                item.show()
                self.menu.append(item)
            else:
                group = None
                for radiodef in btndef:         # It's a selection of radiobuttons
                    item = Gtk.RadioMenuItem(label = radiodef)
                    if group == None:
                        group = item
                    else:
                        item.set_property("group", group)
                    item.show()
                    self.menu.append(item)


class MainWindow(Gtk.Window):
    def __init__(self):
        super(MainWindow, self).__init__()
        self.set_size_request(200, -1)
        self.connect("destroy", lambda x: Gtk.main_quit())

        self.hbox = Gtk.Box(orientation = Gtk.Orientation.HORIZONTAL)
        self.entry = Gtk.Entry()

        self.popup = MyPopup( (("String", "String no case", "Hexadecimal"),
                               ("Regexp",)) )

        self.hbox.pack_start(self.entry, True, True, 0)
        self.hbox.pack_start(self.popup, False, True, 0)

        self.add(self.hbox)

        self.show_all()

    def run(self):
        Gtk.main()


def main():
    mw = MainWindow()
    mw.run()
    return 0

if __name__ == '__main__':
    main()
import gi
gi.require_version("Gtk", "3.0")

from gi.repository import Gio, Gtk, GLib
import sys


class MainApplication(Gtk.Application):

    def __init__(self):
        Gtk.Application.__init__(self,
                                 application_id="needs.dots",
                                 flags=Gio.ApplicationFlags.FLAGS_NONE)
        # https://developer.gnome.org/gio/unstable/GApplication.html#g-application-id-is-valid
        self.connect("activate", self.activate_window)

    def activate_window(self, app):
        """
        The activate signal of Gtk.Application passes the
        MainApplication class
        to the window. The window is then set as a window
        of that class.
        """
        self.window = Gtk.ApplicationWindow()
        self.window.set_default_size(500, 400)
        app.add_window(self.window)

        self.hb = Gtk.HeaderBar()
        self.hb.set_show_close_button(True)
        self.hb.props.title = "HeaderBar & PopOverMenu"
        self.window.set_titlebar(self.hb)

        button_settings = Gtk.MenuButton()
        icon = Gio.ThemedIcon(name="format-justify-fill-symbolic")
        image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.BUTTON)
        button_settings.add(image)
        self.hb.pack_end(button_settings)

        self.builder = Gtk.Builder()
        self.builder.add_from_file("popovermenu_layout.xml")
        button_settings.set_menu_model(\
                        self.builder.get_object('options-menu'))

        # Add radiobutton group that includes all actions that
        # are named ***.radiogroup, 'radio-two' is the default
        # choice.
        detail_level = Gio.SimpleAction.new_stateful("radiogroup", \
                           GLib.VariantType.new("s"), \
                           GLib.Variant("s", "radio-two"))
        detail_level.connect("activate", self.radio_response)
        self.window.add_action(detail_level)

        # Connects to the action. The first part of the XML name
        # is left away:
        # <property name="action-name">app.print</property>
        # becomes simply "print".
        action_print = Gio.SimpleAction.new("print", None)
        action_print.connect("activate", self.print_something)
        app.add_action(action_print)

        # app.toggle becomes -> toggle
        action_toggle = Gio.SimpleAction.new_stateful("toggle", \
                            None, GLib.Variant.new_boolean(False))
        action_toggle.connect("change-state", self.toggle_toggled)
        app.add_action(action_toggle)

        btn = Gtk.Button("Button")
        self.window.add(btn)
        self.window.show_all()

    def print_something(self, action, variable):
        print("something")

    def toggle_toggled(self, action, state):
        action.set_state(state)
        Gtk.Settings.get_default().set_property( \
                "gtk-application-prefer-dark-theme", state)

    def radio_response(self, act_obj, act_lbl):
        # Not sure if this is the correct way of doing this.
        # but it seems to work.
        act_obj.set_state(act_lbl)

    def on_action_quit_activated(self, action):
        self.app.quit()

if __name__ == "__main__":
    """
    Creates an instance of the MainApplication class
    that inherits from Gtk.Application.
    """
    app = MainApplication()
    app.run(sys.argv)
<interface>
  <menu id="options-menu">
    <section>
      <item>
    <attribute name="label">Print Message</attribute>
    <attribute name="action">app.print</attribute>
      </item>
    </section>
    <section>
      <item>
    <attribute name="label">Night Mode</attribute>
    <attribute name="action">app.toggle</attribute>
      </item>
    </section>
    <section>
      <item>
    <attribute name="label">Choice 1</attribute>
    <attribute name="action">win.radiogroup</attribute>
    <attribute name="target">radio-one</attribute>
      </item>
      <item>
    <attribute name="label">Choice 2</attribute>
    <attribute name="action">win.radiogroup</attribute>
    <attribute name="target">radio-two</attribute>
      </item>
      <item>
    <attribute name="label">Choice 3</attribute>
    <attribute name="action">win.radiogroup</attribute>
    <attribute name="target">radio-three</attribute>
      </item>
    </section>
  </menu>
</interface>