wxRuby - 更改 TextCtrl Style 属性
我是 wxRuby 的新手,只是想弄清楚。创建 TextCtrl 后如何更改其样式。
tb = Wx::TextCtrl.new(panel, -1, :style => Wx::TE_PASSWORD)
正确设置文本输入,但是创建后是否可以更改此属性?
tb = Wx::TextCtrl.new(panel, -1)
tb.set_window_style(Wx::TE_PASSWORD)
不执行任何操作,并且在 set_style
或 set_default_style
中进行替换都会引发错误。
I'm brand new to wxRuby, and just trying to figure things out. How do I change the style of the TextCtrl after it has been created.
tb = Wx::TextCtrl.new(panel, -1, :style => Wx::TE_PASSWORD)
Sets the text input properly, but is it possible to change this property after it has been created?
tb = Wx::TextCtrl.new(panel, -1)
tb.set_window_style(Wx::TE_PASSWORD)
Does nothing, and subbing in set_style
or set_default_style
each throw errors.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为
set_style
方法旨在更改文本本身的样式,而不是 textctrl 的样式。我一直在试图找到一个改变textctrl样式的例子,但我还没有找到任何东西。I think that the
set_style
method is intended to change the styling of the text itself, not the style of the textctrl. I've been trying to find an example of changing the style of the textctrl, but I haven't found anything yet.