[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: IUP NATIVEPARENT (was: Error handling in IUP)
- From: "Peter Loveday" <peter@...>
- Date: Mon, 28 Aug 2006 18:07:46 +0930
Finally got this to work :)
I've come across another issue now though. How do I use the NATIVEPARENT
attribute for iup.dialog?
Since its value is a HWND, in Lua this is an userdata.
So some how you show push that value in Lua and use it:
Right, I've found in fact it pretty much must be a light userdata too, or it
has the same issue as string (at least any use of lua_newuserdata does, as
it creates a new container to hold the actual pointer in). Makes sense I
suppose, as it is just a plain handle/pointer, so thats all fine.
However:
dlg = iup.dialog
{
nativeparent = nativeparent_hwnd,
...
}
This doesn't work.
Nor does
dlg.nativeparent = nativeparent_hwnd
The issue in these cases seems to be iuplua.lua's implementation of
ihandle_settable(), which will not pass through light userdata (pointer)
types to the underlying ihandle object.
I have, however, got it working setting it directly, using:
iup.SetAttribute(dlg, "NATIVEPARENT", nativeparent_hwnd)
Thanks!
Love, Light and Peace,
- Peter Loveday