Skip to content

Commit

Permalink
python3 syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
UserBlackBox committed Aug 16, 2021
1 parent 3426f71 commit 7d87cf2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ def main():

builder = Gtk.Builder()
GObject.type_register(GtkSource.View)
GObject.type_register(GtkSource.Buffer)
GObject.type_register(GtkSource.LanguageManager)
GObject.type_register(GtkSource.Language)
GObject.type_register(GtkSource.StyleSchemeChooserButton)
builder.add_from_file(join(abspath(dirname(__file__)), "main.glade"))
window = builder.get_object("window1")

Expand All @@ -31,6 +35,11 @@ def main():
details_buffer = builder.get_object("details_buffer")
constants_buffer = builder.get_object("constants_buffer")

langmanager = GtkSource.LanguageManager()
lang = langmanager.get_language('python3')
codeBrowserBuffer.set_language(lang)
constants_buffer.set_language(lang)

class Handler:
def window1_onDestroy(self, *args):
Gtk.main_quit()
Expand Down

0 comments on commit 7d87cf2

Please sign in to comment.