.. currentmodule:: gi.repository ============= Flags & Enums ============= Flags are subclasses of :class:`GObject.GFlags` and represent bit fields where some bits also have names: .. code:: pycon >>> Gtk.DialogFlags.MODAL >>> Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT >>> int(_) 3 >>> Gtk.DialogFlags(3) >>> isinstance(Gtk.DialogFlags.MODAL, Gtk.DialogFlags) True >>> Bitwise operations on them will produce a value of the same type. Enums are subclasses of :class:`GObject.GEnum` and represent a list of named constants: .. code:: pycon >>> Gtk.Align.CENTER >>> int(Gtk.Align.CENTER) 3 >>> int(Gtk.Align.END) 2 >>> Gtk.Align(1) >>> isinstance(Gtk.Align.CENTER, Gtk.Align) True