Instance.Destroy
This commit is contained in:
parent
9030646f39
commit
f4dc80713f
@ -219,6 +219,12 @@ impl Instance{
|
||||
Ok(crate::context::class_is_a(instance.class.as_str(),classname.to_str()?))
|
||||
})
|
||||
);
|
||||
methods.add_method("Destroy",|lua,this,()|
|
||||
dom(lua,|dom|{
|
||||
dom.destroy(this.referent());
|
||||
Ok(())
|
||||
})
|
||||
);
|
||||
methods.add_meta_function(mlua::MetaMethod::Index,|lua,(this,index):(mlua::AnyUserData,mlua::String)|{
|
||||
let index_str=index.to_str()?;
|
||||
let dereferent:Dereferent=mlua::AnyUserDataExt::get(&this,"Referent")?;
|
||||
|
Loading…
Reference in New Issue
Block a user