def on_checkbutton_show_whitespace_toggled(self, widget): value = GtkSource.DrawSpacesFlags.ALL if widget.get_active() else 0 settings.set_flags('draw-spaces', value)