John Labenski <[EMAIL PROTECTED]> writes: > > On Jan 8, 2008 11:03 AM, Andre <[EMAIL PROTECTED]> wrote: > > I have an object which is a userdata. > > I expect it to be a wxfont. > > How could I verify that this is true? > > > > f = wx.wxNORMAL_FONT > > print(f) > print(tostring(f)) > print(wxlua.type(f)) > f_type = select(2, wxlua.type(f)) > print(f_type, wxlua.typename(f_type)) > > Running lua script '*untitled.lua' : Tue Jan 08 > userdata: 01CF2A28 [wxFont(014BB490, 159)] > userdata: 01CF2A28 [wxFont(014BB490, 159)] > wxFont 159 userdata 7 > 159 wxFont
so the test would be wxlua.typename(select(2, wxlua.type(f))) == 'wxFont' => a font or wxlua.type(f) == wxlua.type(wx.wxNORMAL_FONT) => a font the first test is more verbose but probably easier to understand thank you Andre ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users