lxn / walk

A Windows GUI toolkit for the Go Programming Language
Other
6.79k stars 885 forks source link

CheckBox - read if checked crashed #703

Open josprou opened 3 years ago

josprou commented 3 years ago

Hi, I have a login form that breaks when I go to read if the CheckBox is checked. The code is the following:

loginform.txt

The line that breaks is the following: var remember = dlg.remembermeCheck.CheckState()

The exception produces a "runtime error: invalid memory address or nil pointer reference" error

Thank you

A greeting

josprou commented 3 years ago

Puedo formular la misma pregunta del siguiente modo: ¿Cómo puedo obtener el valor de un checkBox al pulsar sobre un botón?

lxn commented 3 years ago

It looks like you do not initialize LoginDialog.remembermeCheck, which you access in LoginDialog.onLoginButtonClicked. In newLoginDialog only the local variable remembermeCheck is initialized.