Open aome510 opened 3 years ago
Hi, I belive that cursive TextView is an eqivalent of let's say Qt's label. TBH, I don't think having focus on such element is required. You should redesign, in order to use correct "widgets" for the job.
Hi, thanks for the reply. I'm new to UI library so don't really have much information about what "widgets" I need to use for my case.
I want to have a view element that can be able to wrap words and add highlight upon being focused but there doesn't seem to be any view structs in Cursive::views
support it. My current work-around is to implement a basic version of Cursive::views::TextView
but with focus
enabled: text_view.rs. This seems to work well at least for now.
I just wonder why there are some with focus
enabled by default but not TextView
.
It is I believe done because labels, never? need focus? The thing here is that I believe that the name TextView is misleading. In other gui frameworks it is called label.
Are there any ways to focus a
TextView
element? My use case is that I want to create a select list usingLinearLayout
(vertical) andTextView
. This results in an error becauseTextView
uses the default implementation oftake_focus
fromView
. UsingSelectView
is an alternative, but it restricts thelabel
to be within one single row. I wonder whyfocus
is not supported forTextView
. Are there any difficulties involved supporting this feature that I may miss?