- 324

- Belgium
- Mightylieven
I am building an app for ac. anybody know why the button is not clickable? The button shows but I can't click on it...
import ac
class ButtonTestApp:
def init(self):
# Create the app window
self.app_window = ac.newApp("Button Test")
ac.setSize(self.app_window, 200, 200)
# Label to show button click status
self.label = ac.addLabel(self.app_window, "Press the button")
ac.setPosition(self.label, 10, 50)
# Button to trigger click event
self.button = ac.addButton(self.app_window, "Click Me")
ac.setPosition(self.button, 10, 100)
ac.setSize(self.button, 180, 30)
ac.addOnClickedListener(self.button, self.on_button_click)
def on_button_click(self, *args):
# Update the label when the button is clicked
ac.setText(self.label, "Button Clicked!")
button_test_app = None
def acMain(ac_version):
global button_test_app
button_test_app = ButtonTestApp()
return "Button Test"
def acUpdate(deltaT):
global button_test_app
if button_test_app:
pass
import ac
class ButtonTestApp:
def init(self):
# Create the app window
self.app_window = ac.newApp("Button Test")
ac.setSize(self.app_window, 200, 200)
# Label to show button click status
self.label = ac.addLabel(self.app_window, "Press the button")
ac.setPosition(self.label, 10, 50)
# Button to trigger click event
self.button = ac.addButton(self.app_window, "Click Me")
ac.setPosition(self.button, 10, 100)
ac.setSize(self.button, 180, 30)
ac.addOnClickedListener(self.button, self.on_button_click)
def on_button_click(self, *args):
# Update the label when the button is clicked
ac.setText(self.label, "Button Clicked!")
button_test_app = None
def acMain(ac_version):
global button_test_app
button_test_app = ButtonTestApp()
return "Button Test"
def acUpdate(deltaT):
global button_test_app
if button_test_app:
pass
Last edited: