You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type reflection.View:
field width is type i32 with value: 800
field heigh is type i32 with value: 480
field header is type *reflection.Header with value: reflection.Header{ .magic = 123, .title = { 97, 98, 99 } }
type *const reflection.View:
field width is type i32 with value: 800
field heigh is type i32 with value: 480
field header is type *reflection.Header with value: reflection.Header{ .magic = 123, .title = { 97, 98, 99 } }
The text was updated successfully, but these errors were encountered:
用awtk-mvvm框架做了一个项目,用C语言做下来感觉很烦琐:头文件要加特定格式的注释、有时要手写view_mode更麻烦。
现在很多声明式UI框架都是用支持反射的语言来实现,这样model实现起来就很简洁,awtk-mvvm也应该如此。
最近研究了下zig的反射,发现很有意思。如下例子:
@field(v, field.name)
就搞定了tkcobject
的get_prop
和set_prop
field.name
不存在会通不过编译输出为:
The text was updated successfully, but these errors were encountered: