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 8001531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:07:01+00:00 2026-06-04T16:07:01+00:00

I have a problem with the Gtk.RadioButton widget’s Clicked event. Here is the example

  • 0

I have a problem with the Gtk.RadioButton widget’s Clicked event.
Here is the example code:

using System;
using Gtk;

public partial class MainWindow: Gtk.Window
{   
    public MainWindow (): base (Gtk.WindowType.Toplevel)
    {
        Build ();
        RadioButton rbt1 = new RadioButton (null, "rbt1");
        RadioButton rbt2 = new RadioButton (rbt1, "rbt2");
        RadioButton rbt3 = new RadioButton (rbt1, "rbt3");
        VBox vbx1 = new VBox ();
        vbx1.PackStart (rbt1, false, false, 0);
        vbx1.PackStart (rbt2, false, false, 0);
        vbx1.PackStart (rbt3, false, false, 0);
        this.Add (vbx1);
        this.ShowAll ();
        rbt1.Clicked+= HandleClicked;
    rbt2.Clicked+= HandleClicked1;
    rbt3.Clicked+= HandleClicked2;
    }

    void HandleClicked2 (object sender, EventArgs e)
    {
        Console.WriteLine ("rbt3.Clicked");
    }

    void HandleClicked1 (object sender, EventArgs e)
    {
        Console.WriteLine ("rbt2.Clicked");
    }

    void HandleClicked (object sender, EventArgs e)
    {
        Console.WriteLine ("rbt1.Clicked");
    }
 }

The issue is:

When i click rbt2, the output is :

rbt1.Clicked
rbt2.Clicked

When i click rbt3, the output is :

rbt2.Clicked
rbt3.Clicked

When i click rbt1, the output is:

rbt3.Clicked
rbt1.Clicked

But what I expect is that when I click rbt*, the only output is “rbt*.Clicked”.

  • 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-06-04T16:07:02+00:00Added an answer on June 4, 2026 at 4:07 pm

    Your expectation is wrong. You should connect to the Toggled signal instead and check whether the button is being activated or deactivated:

    void HandleToggled(object sender, EventArgs e)
    {
        if(sender.Active)
        {
            Console.WriteLine("rbt1.Toggled");
        }
    }
    

    In your case, the Clicked signal is called when the button is activated or deactivated. Clicking on a deactivated button activates it, and deactivates a different button, so two signals are called. The Toggled signal is also called in both cases. I’m not quite sure what the difference is, it may be that Clicked is not guaranteed to be called if the button’s state is changed programmatically.

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

Sidebar

Related Questions

Problem: I have a gtk.Dialog. Whenever the 'minimize' button on the dialog is clicked,
The problem is basically this, in python's gobject and gtk bindings. Assume we have
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
Here is the code that I have so far to define the icon: icon_bg
I have a glade GUI and i'm using dome gtk.MessageDialog widgets created with pygtk
I'm into a problem with a GTK+ C application. I have a container that,
I have problem when i using ListView and Linq as datasource. The error down:
I have problem with customizing each page using pagecontrol and UIScrollView. I'm customizing Page
I have a problem with compiling a basic and really simple example of PyGTK
I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL,

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.