Jump to content

Recommended Posts

Posted

So far, I've found that

  • AddText isn't exposed.
  • TEXTAREA_SCROLLDOWN isn't exposed.
  • Lock/Unlock isn't exposed.

 

--Get the displays
local displays = GetDisplays()

--Create a window
local window = CreateWindow("Console", 0, 0, 800 * displays[1].scale, 600 * displays[1].scale, displays[1], WINDOW_CENTER | WINDOW_TITLEBAR)

local ui = CreateInterface(window)
local parent = ui.background


local x = 8
local y = 8
local sz = parent:ClientSize()

local log = CreateTextArea(x, y, sz.x - x * 2, sz.y - 40 - y, parent, TEXTAREA_SCROLLDOWN)
log:SetLayout(1, 1, 1, 1)
local textentryfield = CreateTextField(x, sz.y - 32, sz.x - x * 2, 24, parent)
textentryfield:SetLayout(1, 1, 0, 1)


while not window:Closed() do
    local ev = WaitEvent()
	--ui:ProcessEvent(ev)

    if ev.id == EVENT_PRINT then
		if log.text == "" then 
			log:AddText(ev.text)
		else
			log:AddText("\n" .. ev.text)
		end
    elseif ev.id == EVENT_WIDGETACTION then
        if ev.source == textentryfield then
            textentryfield:Lock()
			Print("] " .. ev.text)
			textentryfield:Activate()
			textentryfield:SetText("")
			textentryfield:UnLock()
        end
    elseif ev.id == EVENT_WINDOWCLOSE then
        return 0
    end
end

 

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Posted

I can see Lock/Unlock in the Lua binding code. What makes you think it is not present? I can see they are not in the documentation, which means they won't show up in autocompletion and syntax highlighting, but they should still work.

  • Like 1

Let's build cool stuff and have fun. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...