Erik Leunissen <lo...@the.footer.invalid> wrote:
> On 19/05/2019 21:12, Rich wrote:
>> Why does the "window names" subcommand of the text widget not do what
>> you want?
>>
>
> Hi Rich,
>
> You seem to misunderstand the problem that I have :-)
Yes, indeed, upon review of your OP, I have misunderstood the problem.
> It's not that [$w window names] is inadequate per se.
>
> It's that I don't have the name of the embedding text widget in the
> first place, and I'd rather not traverse the widget hierarchy in
> search for it.
I'm not sure that you have any other option. If the heirarchy is
fixed, you'll need to traverse it at least once to collect at least the
names of the text widgets. Then, knowing that, you just have to search
each text widgets embedded windows list to find the containing text.
But if the heirarchy changes dynamically as the app executes, you
likely have no choice but to do the traversal each time you want to do
the reverse lookup.