PolycodeViewBase.lua 753 B

123456789101112131415161718192021222324252627282930313233
  1. class "PolycodeViewBase"
  2. function PolycodeViewBase:__getvar(name)
  3. if name == "resizable" then
  4. return Polycode.PolycodeViewBase_get_resizable(self.__ptr)
  5. end
  6. end
  7. function PolycodeViewBase:__setvar(name,value)
  8. if name == "resizable" then
  9. Polycode.PolycodeViewBase_set_resizable(self.__ptr, value)
  10. return true
  11. end
  12. return false
  13. end
  14. function PolycodeViewBase:PolycodeViewBase(...)
  15. local arg = {...}
  16. for k,v in pairs(arg) do
  17. if type(v) == "table" then
  18. if v.__ptr ~= nil then
  19. arg[k] = v.__ptr
  20. end
  21. end
  22. end
  23. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  24. self.__ptr = Polycode.PolycodeViewBase(unpack(arg))
  25. end
  26. end
  27. function PolycodeViewBase:__delete()
  28. if self then Polycode.delete_PolycodeViewBase(self.__ptr) end
  29. end