sudipshil9862 / fonts-compare

fonts rendering and comparing
GNU General Public License v2.0
5 stars 2 forks source link

not able to access "AppWindow class" variable and functions from "@classmethod label_font_change_newversion" #48

Closed sudipshil9862 closed 1 year ago

sudipshil9862 commented 1 year ago

error was: self.fontversion_checkbox.get_active() cannot found fontversion_checkbox

    @classmethod
    def label_font_change_newversion(
            self, dialogButton, _param_spec: Any, label: Gtk.Label) -> None:
        global FONTSIZE
        pango_font_description = dialogButton.get_font_desc()
        pango_font_description.set_size(int(FONTSIZE) * Pango.SCALE)
        pango_attr_font_description = Pango.AttrFontDesc.new(pango_font_description)
        pango_attr_list = Pango.AttrList.new()
        pango_attr_list.insert(attr=pango_attr_font_description)
        label.set_attributes(attrs=pango_attr_list)
        print(self.fontversion_checkbox.get_active()) #for testing
sudipshil9862 commented 1 year ago

It seems the fontversion_checkbox is not defined at the class level, but rather at the instance level within the init method. so I'm gonna Keep the label_font_change_newversion method as an instance method

sudipshil9862 commented 1 year ago

removing @ classmethod