lxn / walk

A Windows GUI toolkit for the Go Programming Language
Other
6.86k stars 887 forks source link

CheckBox - read if checked crashed #703

Open josprou opened 4 years ago

josprou commented 4 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 4 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 4 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.