Open patrickbkr opened 2 months ago
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:
RichText
widget, to be part of T-W <-- I'm working on this at the momentTreeView
widget, building on RichText
, to be part of T-WSourceView
widget, not part of T-W, based on RichText
. It adds line numbers, highlights of breakpointed lines, markers of currently-executing line(s), ... <-- this is the custom composed widgetLocalsView
widget, not part of T-W, based on TreeView
. Maybe I can get away without inheriting if I get the interface of TreeView
just right.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.