Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I link a set of toggle buttons like radio buttons?

I am using Python 3 with gobject introspection for Gtk. How can I have more than one toggle button linked together so they behave similar to tabs or radiobuttons - e.g. one is selected by default, and when another is clicked the previously active one is de-selected.

I have tried using set_sensetive, but that greys out the widget that it is applied on.

like image 476
Marco Scannadinari Avatar asked Oct 24 '25 19:10

Marco Scannadinari


1 Answers

Use a Gtk.RadioButton and set draw indocator mode to False

button1 = Gtk.RadioButton("Product Codes")
button1.set_mode(False)

https://lazka.github.io/pgi-docs/Gtk-3.0/classes/ToggleButton.html#Gtk.ToggleButton.set_mode

enter image description here

Thx to:

  • https://stackoverflow.com/a/15123955/1907997 and
  • How can I link a set of toggle buttons like radio buttons?
like image 120
oxidworks Avatar answered Oct 26 '25 09:10

oxidworks