Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: Init GtkSource (+ minor formatting/style fixes) #736

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Library/demos/Menu Button/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ def update_css(_widget, _params):


circular_switch.connect("notify::active", update_css)

4 changes: 2 additions & 2 deletions src/Library/demos/Popovers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import workbench


def onClosed(popover):
def on_closed(popover):
name = popover.get_name()
print(f"{name} closed.")

Expand All @@ -14,4 +14,4 @@ def onClosed(popover):

for id in popover_ids:
popover = workbench.builder.get_object(id)
popover.connect("closed", onClosed)
popover.connect("closed", on_closed)
6 changes: 5 additions & 1 deletion src/langs/python/python-previewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@
gi.require_version("Adw", "1")
gi.require_version("Graphene", "1.0")
gi.require_version("Gsk", "4.0")
gi.require_version("GtkSource", "5")

from gi.repository import GLib, Gdk, Gtk, Adw, Graphene, Gio, Gsk
from gi.repository import GLib, Gdk, Gtk, Adw, Graphene, Gio, Gsk, GtkSource
from gi.repository.Gio import DBusConnection, DBusConnectionFlags

# Load non-GTK widget types
GtkSource.init()
Comment on lines +31 to +32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want to do this in the demo code too

so that the code works when they copy paste it to their app

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Also the reason why I decided to keep the "gi.requires_version" in there too. We may also want to update the JS demos to specify the versions on import then.

Copy link
Contributor

@sonnyp sonnyp Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may also want to update the JS demos to specify the versions on import then.

I've been having an internal war on this - it's ... tricky.

reminder to talk about this : #738



# Table of Contents
# =================
Expand Down