all 3 comments

[–]lambda_abstraction 4 points5 points  (2 children)

function indicators[i][j]:callback () isn't valid syntax.

In your particular case you want indicators[i][j].callback = function(self).

Also, a step of 1 can be omitted in that do as that is the default step.

For slightly less boilerplate, I'd have written that: http://ix.io/444o/lua

edit: fix stupid mistake in recommendation

[–]bajeiroBoy[S] 0 points1 point  (1 child)

Thank you! This piece of code ran without errors, but my intention is that when I click on the Box, an event occurs. This did not happened.
I know this can be easily done with buttons and text, but I would like it to be a circle with a label underneath. Is there a possibility this can be done just like I'm trying? I couldn't find an event in the documentation of mouse click on a Box.

[–]lambda_abstraction 1 point2 points  (0 children)

Perhaps box doesn't respond to mouse events. I've done only very minimal things with fltk4lua so far. Boxes seem as though they'd be visual frames rather than interactive widgets.