diff options
author | Alex Auvolat <alex@adnab.me> | 2017-05-04 11:48:08 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2017-05-04 11:48:08 +0200 |
commit | 9bb1c5371affb2ff0b83256470dec7461b404264 (patch) | |
tree | 9db7cd56713864a07f047572bfa2d55a5a9933dd /src/sysapp | |
parent | 1161e1d8be014945266017cb0ce735537a287677 (diff) | |
download | kogata-9bb1c5371affb2ff0b83256470dec7461b404264.tar.gz kogata-9bb1c5371affb2ff0b83256470dec7461b404264.zip |
Beginning of tk.lua
Diffstat (limited to 'src/sysapp')
-rw-r--r-- | src/sysapp/login/main.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/sysapp/login/main.lua b/src/sysapp/login/main.lua index de258b9..6be064d 100644 --- a/src/sysapp/login/main.lua +++ b/src/sysapp/login/main.lua @@ -6,6 +6,8 @@ local draw = require 'lx.draw' local gui = require 'lx.gui' local mainloop = require 'lx.mainloop' +local tk = require 'lx.tk' + print("Hello, world!") gui.open() @@ -17,8 +19,13 @@ for x = 0, 255, 16 do end end +local f = draw.load_image('root:/logo.png') +local img = tk.image_widget(f) +tk.init(gui, img) + gui.show_cursor() +--[[ local fnt = draw.load_ttf_font('sys:/fonts/vera.ttf') if fnt == nil then print("Could not load vera.ttf!") @@ -32,7 +39,7 @@ gui.on_mouse_down = function (lb, rb, mb) gui.hide_cursor() gui.surface:write(gui.mouse_x, gui.mouse_y, string.format("Click at %d, %d", gui.mouse_x, gui.mouse_y), fnt, 16, gui.surface:rgb(0, 0, 255)) txt_x = gui.mouse_x - txt_y = gui.mouse_y + fnt:text_height(" ") + txt_y = gui.mouse_y + 16 gui.show_cursor() end end @@ -40,9 +47,10 @@ end gui.on_text_input = function(chr) gui.hide_cursor() gui.surface:write(txt_x, txt_y, chr, fnt, 16, gui.surface:rgb(0, 0, 255)) - txt_x = txt_x + fnt:text_width(chr) + txt_x = txt_x + fnt:text_width(chr, 16) gui.show_cursor() end +--]] mainloop.run() |