def update(self):
        self.glyph_window = CurrentGlyphWindow()
        if self.glyph_window is not None:
            self.glyph = CurrentGlyph()
            self.font = self.glyph.getParent()
            self.glyph_index = self.font.glyphOrder.index(self.glyph.name)
            self.font_index = self.all_fonts.index(self.font)
            self._update_text_box()
            return True
        else:
            f = CurrentFont()
            if f is not None:
                self.font = f
                self.font_index = self.all_fonts.index(self.font)
                glyph_names = get_glyphs(f)
                if len(glyph_names) > 0:
                    self.glyph = self.font[glyph_names[0]]
                    self.glyph_index = self.font.glyphOrder.index(self.glyph.name)
                    self.glyph_window = OpenGlyphWindow(self.glyph, newWindow=False)
                    self._update_text_box()
                    return True
                else:
                    print no_glyph_selected
                    return False
            else:
                print no_font_open
                return False

    # callbacks
dataset/ETHPy150Open gferreira/hTools2/Lib/hTools2/dialogs/glyph/switch.py/switchGlyphDialog.update/original