About Store Forum Documentation Contact
Donations:
392$/mo



Post Reply 
Returning visible when not created
Author Message
fatcoder Offline
Member

Post: #1
Returning visible when not created
Calling visible() on a gui object returns true even when the gui object hasn't been created yet. Shouldn't a gui object's visibility be false until it is created?

Therefore checking if a gui object is visible requires doing this.

Code:
if(window.is() && window.visible())
{
... window is visible.
}

You should be able to do just this.

Code:
if(window.visible())
{
... window is visible.
}
10-28-2012 04:20 AM
Find all posts by this user Quote this message in a reply
TBJokers Offline
Member

Post: #2
RE: Returning visible when not created
Why would you check if it is visible before it is created?

Man, it's always that semicolon...
10-28-2012 11:51 AM
Visit this user's website Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #3
RE: Returning visible when not created
When you have a complex gui with windows that survive across states, sometimes a state doesn't know if a window has been created or not. All the state wants to know is if the window is visible or not.

I think that by default a window that has not been created yet should return false as visible, not true.
11-07-2012 03:34 AM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #4
RE: Returning visible when not created
Why dont u just add yourself a bool to your custom gui window class? On creation set the window to hide and bool on false.. and on show vice versa.

There is always evil somewhere, you just have to look for it properly.
11-07-2012 06:16 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: Returning visible when not created
it's safe to assume that when object is not yet created then it's not visible and not hidden (visibility is undefined), please use is() && visible() as in your codes
11-07-2012 04:48 PM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #6
RE: Returning visible when not created
Still makes no sense to me though... how can a gui object be considered visible before it has even been created?? Oh well, I guess I can live with it.
11-07-2012 10:44 PM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #7
RE: Returning visible when not created
Great to see this has been fixed in the latest update... just got to wait for a EE 1.0 update now.
11-13-2013 05:48 AM
Find all posts by this user Quote this message in a reply
Post Reply