The IntVar constructor takes a NativePtr as an argument.
IntVar
NativePtr
How do I create an IntVar from Int?
Int
You could try this:
memScoped { val intVar = alloc<IntVar>() intVar.value = 123 }
Check out value for more information