Fixed wxJS GetKeyState. Fixed crash when manipulating a destroyed button.
This was SVN commit r6935.
This commit is contained in:
parent
de78e22094
commit
cc572d26c7
@ -88,6 +88,9 @@ bool Button::GetProperty(wxButton *p,
|
||||
int id,
|
||||
jsval *vp)
|
||||
{
|
||||
if ( p == NULL )
|
||||
return false;
|
||||
|
||||
if ( id == P_LABEL )
|
||||
*vp = ToJS(cx, p->GetLabel());
|
||||
|
||||
@ -100,6 +103,9 @@ bool Button::SetProperty(wxButton *p,
|
||||
int id,
|
||||
jsval *vp)
|
||||
{
|
||||
if ( p == NULL )
|
||||
return false;
|
||||
|
||||
if ( id == P_LABEL )
|
||||
{
|
||||
wxString label;
|
||||
|
@ -101,7 +101,7 @@ JSBool wxjs::gui::GetKeyState(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
||||
int key;
|
||||
if (! FromJS(cx, argv[0], key))
|
||||
return JS_FALSE;
|
||||
*rval = (wxGetKeyState((wxKeyCode)key) ? JS_TRUE : JS_FALSE);
|
||||
*rval = (wxGetKeyState((wxKeyCode)key) ? JSVAL_TRUE : JSVAL_FALSE);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user