[gimp] plug-ins: Lua goat-exercise now showing its own source too.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] plug-ins: Lua goat-exercise now showing its own source too.
- Date: Fri, 16 Aug 2019 15:36:37 +0000 (UTC)
commit bbfa8f8e3e7d53afd81eaa8bf772751287e9454a
Author: Jehan <jehan girinstud io>
Date: Fri Aug 16 17:36:00 2019 +0200
plug-ins: Lua goat-exercise now showing its own source too.
plug-ins/goat-exercises/goat-exercise-lua.lua | 15 +++++++++++++++
1 file changed, 15 insertions(+)
---
diff --git a/plug-ins/goat-exercises/goat-exercise-lua.lua b/plug-ins/goat-exercises/goat-exercise-lua.lua
index 1e55f48484..6b0914e367 100755
--- a/plug-ins/goat-exercises/goat-exercise-lua.lua
+++ b/plug-ins/goat-exercises/goat-exercise-lua.lua
@@ -66,6 +66,21 @@ function run(procedure, args, data)
label:show()
-- TODO: show source.
+ local contents = GLib.file_get_contents(arg[0])
+ if (contents) then
+ local scrolled = Gtk.ScrolledWindow()
+ scrolled:set_vexpand (true)
+ box:pack_start(scrolled, true, true, 1)
+ scrolled:show()
+
+ local view = Gtk.TextView()
+ view:set_wrap_mode(Gtk.WrapMode.WORD)
+ view:set_editable(false)
+ local buffer = view:get_buffer()
+ buffer:set_text(contents, -1)
+ scrolled:add(view)
+ view:show()
+ end
while (true) do
local response = dialog:run()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]