Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Gui, +Label and +Owner


  • Please log in to reply
4 replies to this topic
Tekl
  • Members
  • 814 posts
  • Last active: May 03 2009 03:28 PM
  • Joined: 24 Sep 2004
Hi,

If I use +Label before +Owner +AlwaysOnTop +ToolWindow
the options have no effect. They only work if +Label is done after it.
Tekl

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
I can't reproduce it with the following test script:
Gui 2:Add, Text,, Window #2 (owns Window #1)
Gui 2:Show

[color=darkred]Gui +LabelX[/color]
Gui +AlwaysOnTop +ToolWindow +Owner2
Gui, Add, Text,, Window #1
Gui Show
return

XClose:
ExitApp
If it's possible for you to create a simple script that reproduces it, I'd appreciate it.

By the way, the following wording was recently added:

For performance reasons, it is better to set all options in a single line, and to do so before creating the window (that is, before any use of other sub-commands such as "Gui Add").

For example, it's a little more efficient to put all options in one line such as:
Gui +LabelX +AlwaysOnTop +ToolWindow +Owner2

Tekl
  • Members
  • 814 posts
  • Last active: May 03 2009 03:28 PM
  • Joined: 24 Sep 2004
Hi Chris,

I changed the script so it does not work as expected:

Gui, 25:Default
Gui +LabelY
Gui Add, Text,, Window #2 (owns Window #1) 
Gui Show 

Gui, 5:Default
Gui +LabelX
Gui +Owner25 +AlwaysOnTop +ToolWindow
Gui, Add, Text,, Window #1 
Gui Show 
return 

XEscape:
XClose: 
ExitApp

YEscape:
YClose: 
ExitApp

I don't see the ToolWindow anymore, just a normal window.
Tekl

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Thanks for the script. This problem is caused by the fact that the first line below creates its window:

Gui +LabelX
Gui +Owner25 +AlwaysOnTop +ToolWindow

Because the window is created, the second line's +Owner cannot succeed (as documented). But due to a bug, the failure of +owner also prevents the options to the right of it from being processed.

This will be fixed in the next update. In the meantime (and for all future scripts), it's best to combine all +Options on a single line (including +Label) because it substantially improves performance.

Thanks for reporting this.

Tekl
  • Members
  • 814 posts
  • Last active: May 03 2009 03:28 PM
  • Joined: 24 Sep 2004
Ok, so I'll scan all my scripts and combine the options.
Tekl