-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example of a custom composed widget #15
Comments
In IRC you mentioned a few days ago that you were working on building your own widget, but it doesn't look composed (it looks like you went the bespoke route instead). I think this is a generally useful request, and would in fact probably make a great example, but is it still a priority request for you? |
There are many open ends I'm chasing. I'm just picking the ones where I'm not blocked. My current plan is:
As a temporary workaround for the "custom" part (i.e. How do I create a widget without modifying the T-W sources?), I can just add the widget to my local clone of T-W and move it out later. As a temporary workaround for the "composed" part (i.e. How do I combine two SpanBuffers and a Divider into a new SourceView widget?), I can use a single SpanBuffer and output the line numbers at the start of each line and enforce line wrapping. So in summary, it's not the highest priority at the moment, but at some point it will turn into a blocker. |
I'm trying to implement a custom widget (The source view widget of the debugger I'm working on. I'm calling it
SourceWidget
). That widget should be a composition of aSpanBuffer
(the line numbers), a divider and anotherSpanBuffer
(the source text). As that widget will be specific to my use-case, it won't make sense to add it to T::W.I am missing an example of how to build a custom widget that's composed of others. Questions that have come to my mind trying to do so:
initial-layout($builder, ...)
method) without modifying T::W sources?T::W::Widget
,T::W::StandardWidgetBuilder
,T::W::L::WidgetBuilding
,T::W::Scrollable
I'm lacking in understanding of the overall T::W architecture. I think an example could help.
The text was updated successfully, but these errors were encountered: