[SOLVED] showMessageBox button choice always returns -1

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
telly23
Prole
Posts: 2
Joined: Sun Apr 17, 2016 3:32 pm

[SOLVED] showMessageBox button choice always returns -1

Post 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
Last edited by telly23 on Sun Apr 17, 2016 5:54 pm, edited 1 time in total.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: showMessageBox button choice always returns -1

Post 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.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
telly23
Prole
Posts: 2
Joined: Sun Apr 17, 2016 3:32 pm

Re: showMessageBox button choice always returns -1

Post by telly23 »

Okay I quicky compiled the last git commit, and indeed the bug seems fixed.
Thank you very much for the help :D
Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot] and 7 guests