I’ve been helping out on a wrapper for QT6, and I’m having problems with callbacks. Specifically, I get an error stating that “cfunction: closures are not supported on this platform”, and from what I gather, this seems to be specific to Apple Arm chips.
function clickedClear(displayWidget)
setText(displayWidget, "") # clear the displayWidget’s text
show(displayWidget) # redraw the displayWidget
end
app = QApplication(String[]) # make the QApplication
window = QWidget() # make the window
displayBox = QLineEdit("", window) # make a QLineEdit and fill it with an empty string
clearBtn = QPushButton( "clear", window ) # make a QPushbutton label ‘clear’
cc() = clickedClear(displayBox) # callback passing displayBox widget
clicked!(clearBtn, cc) # set the callback for clearBtn
How can I rewrite this so that it is kosher? From what I understand, the problem is that displayWidget is not in the same scope as the clickedClear() function.
Julia 1.11
MacOS 14.4.1
Apple M1 pro MacBook