Пример #1
0
# Build Action Row
#
row1 = Handy.ActionRow()
row1.set_icon_name('firefox-symbolic')
row1.set_title("Action Row")
row1.set_subtitle("this is a subtitle")
row1.add_action(button)

# Create List Store
store = Gio.ListStore()
store.append(Flatpak("flatseal", "flathub"))
store.append(Flatpak("music", "flathub"))

# Build Combo Row
#
row2 = Handy.ComboRow()
row2.set_icon_name('face-wink')
row2.set_title("Combo Row")
row2.set_subtitle("this is a subtitle")
row2.bind_name_model(store, bind_model_func)

label = Gtk.Label.new(
    "This is shown when expanded. This is hidden when not expanded")

# Build Expandable Row
# https://lazka.github.io/pgi-docs/#Handy-0.0/classes/ExpanderRow.html
row3 = Handy.ExpanderRow()
row3.set_icon_name('battery-good')
row3.set_title("Expander Row")
row3.set_subtitle("this is a subtitle")
row3.set_expanded(False)
Пример #2
0
    # Criando o arquivo em modo de escrita.
    with open(filename, mode='w') as arquivo:
        # Preenchedo tempalte com os dados e salvando.
        arquivo.write(
            template.format(widget_name, gtk_versao, gtk_versao1,
                            pygobject_versao,
                            '\n- '.join(sorted(widget_props)),
                            '\n- '.join(sorted(widget_signals)),
                            '\n- '.join(sorted(widget_metodos_get)),
                            '\n- '.join(sorted(widget_metodos_set))))
        arquivo.close()


if __name__ == '__main__':
    # Widget que se deseja as informações
    widget = Handy.ComboRow()

    # Forma 1 de se coletar a versão do GTK+.
    gtk_versao = '%d.%d.%d' % (Gtk.MAJOR_VERSION, Gtk.MINOR_VERSION,
                               Gtk.MICRO_VERSION)

    # Forma 2 de se coletar a versão do GTK+.
    gtk_versao1 = '%d.%d.%d' % (Gtk.get_major_version(),
                                Gtk.get_minor_version(),
                                Gtk.get_micro_version())

    # Versão do PyGObject.
    pygobject_versao = GObject.pygobject_version

    # Nome do Widget.
    widget_name = widget.get_name()