On 6/28/07, Klaas Holwerda <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have in my binding file:
>
> %class %noclassinfo a2dRestrictionEngine, a2dEvtHandler
> %endclass
>
> %enum a2dRestrictionEngine::a2dSnapToWhat
>          snapToGridPosX
>          snapToGridPosY
>          snapToGridPos
> %endenum

This looks ok.

> And i thought it should now be used like this:
>
> cmdh:SetSnapFeatures(
>         wx.a2dRestrictionEngine.snapToGridPos + 
> wx.a2dRestrictionEngine.snapToPinsUnconnected +
>         wx.a2dRestrictionEngine.snapToObjectPos + 
> wx.a2dRestrictionEngine.snapToObjectVertexes )
>
> But i get an "attempt to perfrom arithmetic on field snapToGridPos ( a nil 
> value ).
> Obviously it does not understand that snapToGridPos is something, but i don't 
> understand how to fix it.
>
> Any ideas?

This looks right too, try this to show if they're installed

for k, v in pairs(wx.a2dRestrictionEngine) do print(k, v) end

or if you link the wxluasocket library, run this to show all of the
items in the lua _G (global) table.

wxlua.LuaStackDialog()

or run samples/bindings.wx.lua to look a little closer at the bindings.

and... check that they're actually installed, they should be in the
cpp file generated with the same name as the .i file where you
declared the %class a2dRestrictionEngine. Probably just grep for the
enums to see if they're there.

-John Labenski

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to