Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 913577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:35:05+00:00 2026-05-15T17:35:05+00:00

Is there a way to put radio menu items in a GNOME panel applet’s

  • 0

Is there a way to put radio menu items in a GNOME panel applet’s context menu, and then control which of the items is marked as active? The official documentation is less than helpful, and all of the applets installed on my computer use normal menu items, so I can’t look at their source code for any guidance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:35:05+00:00Added an answer on May 15, 2026 at 5:35 pm

    In the XML file defining the context menu, for each radio <menuitem> set type="radio" and the group property to the name of the radio item group, like this:

    <Root>
      <popups>
        <popup name="button3">
          <menuitem name="Foo" verb="DoFoo" label="Foo is awesome" type="radio" group="mygroup"/>
          <menuitem name="Bar" verb="DoBar" label="Bar is cool" type="radio" group="mygroup"/>
          <menuitem name="Baz" verb="DoBaz" label="Baz rocks" type="radio" group="mygroup"/>
        </popup>
      </popups>
    </Root>
    

    You don’t set up handlers to respond to the items being selected the same way you would for normal menu items. Instead, you listen for the “ui-event” signal on the BonoboUIComponent for the menu:

    BonoboUIComponent *component = panel_applet_get_popup_component (applet);
    g_signal_connect (component, "ui-event", G_CALLBACK (popup_component_ui_event_cb), NULL);
    /* ... */
    static void
    popup_component_ui_event_cb (BonoboUIComponent *component,
                                 const gchar *path,
                                 Bonobo_UIComponent_EventType type,
                                 const gchar *state_string,
                                 gpointer data)
    {
    }
    

    path will be the full path (see below) of the item that was clicked. state_string will be the new state value of the item (see below). There will be two events for each click of a radio item: one to deselect the old item, and one to select the new one.

    To manipulate the checked state of the buttons, use bonobo_ui_component_set_prop to set the “state” property to “0” (unchecked) or “1” (checked). To be safe, explicitly uncheck the old value; there are some corner cases where you could otherwise wind up with multiple radio items in the same group checked (particularly if the context menu hasn’t yet actually been drawn).

    BonoboUIComponent *component = panel_applet_get_popup_component (applet);
    bonobo_ui_component_set_prop (component, "/commands/Foo", "state", "1", NULL);
    bonobo_ui_component_set_prop (component, "/commands/Bar", "state", "0", NULL);
    bonobo_ui_component_set_prop (component, "/commands/Baz", "state", "0", NULL);
    

    Note that you identify the radio item by “/commands/name”, where name is the name you gave the item in the XML file.

    You could likewise use bonobo_ui_component_get_prop to look for which radio item is checked, but you’re better off using the event handlers to detect when the user clicks on one.

    In general, the documentation for BonoboUIComponent in libbonoboui should provide more information about ways to manipulate items in the menu.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to hide radio buttons inside a RadioButtonList control programmatically?
Simply put, is there a way to create a 2D javascript array using similar
Is there way in next piece of code to only get the first record?
is there way thats i can preselect an item when the page loads or
Is there a way to enforce constraint checking in MSSQL only when inserting new
Is there any way to check whether a file is locked without using a
Is there a way to find the name of the program that is running
Is there a way to find the number of files of a specific type
Is there a way to take over the Entity Framework class builder? I want
Is there any way to capture the MouseDown even from the .NET 2.0 TextBox

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.