Skip to content

bug: [1.7] Button Click events seems to produce a table instead of a string #55

@ajh123

Description

@ajh123

Describe the bug

When a button gets clicked, instead of a string like "mouse_click" or "mouse_up" the event (2nd parameter) is a table.

To Reproduce

Steps to reproduce the behavior:

  1. A small program can be used to test the behaviour:
local basalt = require("basalt")

local main = basalt.createFrame()

main:addButton()
:setText("Start")
:setPosition(1, 1)
:setSize("7", "1")
:onClick(function(self, event, button, x, y)
	basalt.debug("Event ("..tostring(event)..") = {")
	if type(event) == "table" then
		for k, v in pairs(event) do
			basalt.debug(k.."="..tostring(v)..",")
		end
	end
	basalt.debug("}")
end)

basalt.autoUpdate()
  1. Run the program.
  2. Click the "Start" button.
  3. Open the Basalt debug window.
  4. See something like the attached screenshot.

Expected behavior

Once the button is clicked, the Basalt debug window will contain:

Event (mouse_click) = {
}

Screenshots

If applicable, add screenshots to help explain your problem.

basalt_error2

^ The contents of the event.

Additional context

Add any other context about the problem here.
N/A ?

Checklist

[ X ] I am running the latest version.
Tick the box if you are running the latest version!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions