Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Menubar object issue with onSelect event #118

Open
C2Gamser opened this issue Aug 6, 2024 · 0 comments
Open

bug: Menubar object issue with onSelect event #118

C2Gamser opened this issue Aug 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@C2Gamser
Copy link

C2Gamser commented Aug 6, 2024

Describe the bug

The bug occurs when trying to use the 'onSelect' event to execute a function. When attempting to use onSelect(function goes here) in code, the function is not executed when the user selects an entry in the menubar.

To Reproduce
local basalt = require("basalt")

local main = basalt.createFrame()

local example_bar = main:addMenubar()
example_bar:setOptions({"Entry 1", "Entry 2", "Entry 3"})

example_bar:onSelect(function(self, event, item)
basalt.debug("Selected item: ", item.text)
end)

Then click on an entry in the program

Expected behavior

You expect to see the debug appear with the correct item (this works when you swap menuBar with list) however, it does not execute.

Screenshots
Here I have selected an entry with the code described above, and there is no debug that has run.
image

Additional context

I asked in the computer craft discord for help, someone said its probably a bug.

Checklist

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

@C2Gamser C2Gamser added the bug Something isn't working label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant