Dear Paul, many thanks. It works now. However in my case the difference
between the reference and symmetry related chain is not strong.
Changes in bot these lines have no effect
coot.set_symmetry_colour(0.4, 0.4, 0.4)
coot.set_default_bond_thickness(2)
What can I do?
Many thanks for all your efforts, br Georg.
import gi
gi.require_version("Gtk", "4.0")
from gi.repository import Gtk
import coot
import coot_utils
import coot_gui_api
def toggle_quicksymm(button):
"""
Toggle Quick Symmetry based on the button's active state for ALL
open molecules.
Displays ALL ATOMS instead of just C-alphas.
"""
if button.get_active():
# Global settings
coot.set_show_symmetry_master(1)
coot.set_show_unit_cells_all(0)
coot.set_symmetry_colour(0.4, 0.4, 0.4)
coot.set_symmetry_size(15)
coot.set_default_bond_thickness(2)
# Apply to all open molecules
for imol in coot_utils.model_molecule_number_list():
coot.set_symmetry_colour_by_symop(imol, 0)
coot.set_symmetry_molecule_rotate_colour_map(imol, 0)
coot.set_symmetry_whole_chain(imol, 0)
# 0 = False (Show all atoms instead of just C-alphas)
coot.symmetry_as_calphas(imol, 0)
coot.add_status_bar_text("Quick Symmetry: ON (All Atoms)")
else:
coot.set_show_symmetry_master(0)
coot.set_show_unit_cells_all(0)
coot.add_status_bar_text("Quick Symmetry: OFF")
# Create a GTK4 ToggleButton natively
quicksymm_button = Gtk.ToggleButton(label="QuickSymm")
quicksymm_button.connect("toggled", toggle_quicksymm)
coot_gui_api.main_toolbar().append(quicksymm_button)
Am 24.05.2026 um 02:24 schrieb Paul Emsley:
On 23/05/2026 21:42, Georg Mlynek wrote:
I then asked Gemini 3.1 Pro (which has access to the Wincoot folder):
Can you figure out in the code which problem there is in the
coot_gui.coot_toolbar_button function?
9:29 PM
Yes, I can! I looked into the source code for coot_gui.py and found exactly why
it is failing.
The coot_gui.coot_toolbar_button function in your version of Coot 1 is
unfortunately completely broken due to several severe coding errors left by the
Coot developers during their transition to the new GTK4 interface.
Well, yes... I suppose so. We don't use coot_gui (much?) now. It's
basically abandoned since Gtk3+.
I wrote a blog post
https://pemsley.github.io/coot/blog/2026/04/11/adding-toolbar-buttons.html
That should get you going.
Paul.
########################################################################
To unsubscribe from the COOT list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=COOT&A=1
This message was issued to members of www.jiscmail.ac.uk/COOT, a mailing list
hosted by www.jiscmail.ac.uk, terms & conditions are available at
https://www.jiscmail.ac.uk/policyandsecurity/