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

.parent() help

Explorer ,
Nov 17, 2021 Nov 17, 2021

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

Translate
LEGEND ,
Nov 18, 2021 Nov 18, 2021

.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

Translate
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

Sorry, I recorded a video to illustrate my problem.

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

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

Translate
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