.parent() help

Community Beginner ,
Nov 17, 2021 Nov 17, 2021

Copy link to clipboard

Copied

I'm writing a function to get screen position by entering container object and client position,

I have a problem. When I "container object. Parent. Parent", VSC will generate a new window object every time it is debugged

If I can't use. Parent (), do I have any other way to write this function?

TOPICS
Scripting

Views

82

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Nov 22, 2021 Nov 22, 2021

I found a problem

It is not the continuous use of. Parent, but the use of "Window" related operations (for example, if (XXX instanceof Window) {XXX}, VSC will generate a new window every time it is called,

Likes

Translate

Translate
Adobe Community Professional ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

.parent() refers to a UI layout group or property group. If you don't structure your code suitably, of course just daisy-chaining multiple such calls together won't do anything. Maybe you should re-read the scripting guide on how to address property groups and/ or create UI layouts. You haven't really offered any useful info, anyway, like explaining what you are actualyl trying to do or providing the complete code, so nobody can advise specifically.

 

Mylenium

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Sorry, I recorded a video to illustrate my problem.

https://www.bilibili.com/video/BV16r4y1k747/

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 22, 2021 Nov 22, 2021

Copy link to clipboard

Copied

LATEST

I found a problem

It is not the continuous use of. Parent, but the use of "Window" related operations (for example, if (XXX instanceof Window) {XXX}, VSC will generate a new window every time it is called,

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines