GtkCheckButton group property not working properly

I’m having a problem with some CheckButtons, I’m grouping them so that when they get focus, they activate themselves, it’s something that works with the GTK version I have installed (4.18.4) without developer intervention.

The problem comes when I group more than 2 CheckButtons, when I focus the first one, it gets activated, when I press right arrow key, the focus change to the second one and activates himself, but when I press the left arrow key to focus the first one, it doesn’t work, it doesn’t focus again.

I can only focus from the second one onwards.

This is the template code I’m using:

template MyWidget: Box {
  CheckButton button_0 {
    action-name: "some-action";
    action-target: "first";
    group: button_1;
  }

  CheckButton button_1 {
    action-name: "some-action";
    action-target: "second";
    group: button_2;
  }

  CheckButton button_2 {
    action-name: "some-action";
    action-target: "third";
    // No group for the last one
  }
}

The behavior you’re looking for is probably grouping them to the same button:

template MyWidget: Box {
  CheckButton button_0 {
    action-name: "some-action";
    action-target: "first";
  }

  CheckButton button_1 {
    action-name: "some-action";
    action-target: "second";
    group: button_0;
  }

  CheckButton button_2 {
    action-name: "some-action";
    action-target: "third";
    group: button_0;
  }
}
2 Likes