2

As the documentation suggests here, have a GtkSource.View object, i've retrieved its buffer and passed in as parameter in GtkSource.FileLoader.new . Basically here is my code:

    # set file loader
    file = GtkSource.File()
    file.set_location(Gio.File.new_for_path('/home/ishan/Desktop/net_neutrality/index.html'))

    x = GtkSource.FileLoader.new(self.code.get_buffer(), file)
    #self.code refers to a GtkSource.View object

Now the main problem is, i see nothing loaded from the file. SourceView is blank. So am I supposed to call GtkSource.FileLoader.load_async in order to "sort of" trigger the loading? Or is it something else that i'm missing?

Ishan Khare
  • 1,745
  • 4
  • 28
  • 59

1 Answers1

1

Yes you need to call load_async to load the file to the buffer.

elnabo
  • 264
  • 1
  • 2
  • 10