Page 1 of 1

[SOLVED] showMessageBox button choice always returns -1

Posted: Sun Apr 17, 2016 3:41 pm
by telly23
HOW TO FIX : Compile and install the last commited version from the official bitbucket : https://bitbucket.org/rude/love

Hi everyone :D

I'm currently trying to show a message box so the user can make a choice. This is my code :

Code: Select all

local buttons = {"Yes", "No", escapebutton = 2, enterbutton = 1}
local pressedButton = love.window.showMessageBox("Make a choice", "Your choice ?", buttons)
print(pressedButton)
But whatever button I press, pressedButton seems to always be set to -1. This is my first lua project, so it may be a stupid mistake, but the box does show up and every thing seems to be working, except for the return value.

I tried to search on this forum but I saw no post about showMessageBox returing -1. The wiki doesn't even aknowledge this as possible return value.

Did I do something very stupid or is this a bug ?

EDIT: Forgot to give some infos about my setup:
I'm on archlinux, using i3
I installed lua and löve via yaourt, so they are up-to-date

Re: showMessageBox button choice always returns -1

Posted: Sun Apr 17, 2016 5:43 pm
by Nixola
I have the same issue in LÖVE 0.10.1, but not with love-hg from AUR (which I think is the latest commit in the repo?).
I'm using i3 on an Arch-based distro, too.

Re: showMessageBox button choice always returns -1

Posted: Sun Apr 17, 2016 5:52 pm
by telly23
Okay I quicky compiled the last git commit, and indeed the bug seems fixed.
Thank you very much for the help :D