• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

.parent() help

Explorer ,
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

197

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

Explorer , 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,

Votes

Translate

Translate
LEGEND ,
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

Votes

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
Explorer ,
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/

Votes

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
Explorer ,
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,

Votes

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