回复: raw pointer in lua

"鸡肋" <[email protected]> Tue, 10 Jan 2012 11:04:50 +0800
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
Thanks!
   
  
  ------------------ 原始邮件 ------------------
  发件人: "Nigel Atkinson"<[email protected]>;
 发送时间: 2012年1月10日(星期二) 上午10:42
 收件人: "luabind-user"<[email protected]>; 
 
 主题: Re: [luabind] raw pointer in lua

  
 
On Mon, January 9, 2012 11:04 pm, wrote:
 
> code(C++):
> luabind::object_cast<bool>(m_luaObject["SetAttribute"](m_luaObject, this,
> strName, strValue));
>
> m_luaObject is luabind::object type. I call it's SetAttribute method and
> pass the second parameter "this" pointer. I had register the class of
> "this" in the lua.
> Now, I want to call some method through "this" pointer in the lua. How can
> I do it?
>
> code(LUA):
> function TextButton:SetAttribute(object, name, value)
> object.InternalFindUIObject("caption") -- "this" pointer, how can
> I user here?
> end
 
You should be able to call:
 
 
 
this:method()
 
 
 
Depending on what you have registered for the class that 'this' is an instance of.
 
I've attached a small example.
 
Nigel
 
 
 
>
>
> Thanks!
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual
> desktops for less than the cost of PCs and save 60% on VDI infrastructure
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> _______________________________________________
> luabind-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/luabind-user
>

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev

_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user