I’ve used wxFormBuilder to put a wxRichTextCtrl on my form. After doing
this, I run xrcise and try to use the control. The variable for the rich
text control is a FixNum. On examination, I saw that the class name in
the xrc file is “unknown”.
Is there no way to use this control without manually laying out the
controls - or writing this routine in C++? Does anyone know a
workaround?
I’ve used wxFormBuilder to put a wxRichTextCtrl on my form. After doing
this, I run xrcise and try to use the control. The variable for the rich
text control is a FixNum. On examination, I saw that the class name in
the xrc file is “unknown”.
Is there no way to use this control without manually laying out the
controls - or writing this routine in C++? Does anyone know a
workaround?
I worked around it by designing the XRC with a bog-standard
Wx::TextCtrl, then in the initialise method of the inheriting Ruby
class, replacing it with a RichTextCtrl.
I wrote a convenience method to handle it properly. It’s called like
this (assuming a TextCtrl mapped to the instance var @text_box)
I wrote a convenience method to handle it properly. It’s called like
this (assuming a TextCtrl mapped to the instance var @text_box)
thanks, that worked fine for me, too.
One thing to note is that, strangely, it doesn’t work if the RTC is the
only control in the sizer. So make sure that there is at least one more
control in the same sizer with your edit control.
Cheers,
Tony
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.