Go Back   Winamp Forums > Skinning and Design > Modern Skins

Reply
Thread Tools Search this Thread Display Modes
Old 11th July 2002, 14:13   #1
Gonzotek
Gunslinger
 
Gonzotek's Avatar
 
Join Date: May 2000
Location: Terminus
Posts: 4,693
I had a discussion with Francis along these lines months ago. Here's the deal: Even though you can show(), hide(), and toggle() containers, they aren't guiobjects, and thus cannot use .isVisible, nor is there an onShowContainer nor onHideContainer, nor onToggle (although you can .toggle() it.).

What you can do, however, is get the total number of containers ( getNumContainers() ), then use a for loop to walk through them . Inside the for loop, do enumContainer(i), to get each container one at a time. Once you have the container in a temp object, you do tempcontainer.getNumLayouts, and start another for loop. Inside the second loop, you check each layout of the temp container to determine if it is visible or not.

If the container you're looking for exists, and if any layout of the container is visible, set an int to 1, and then you can exit the loops, check if the int is 1, and do your stuff. Not exactly easy, is it? In speaking to Francis about it, he explained that a container isn't a guiobject, and thus can't be seen, so I asked Francis: If I can show, hide, and toggle a container, then why can't I check it visibility, or use onShowContainer, etc? It just makes sense to be able to access that information in a simple way. I don't care if it's my shade mode, or main mode showing, I just want to know if the container is open or not, right?


[edit] If you're having trouble following my ramble, the code for it is already in QuarkAmp...I *think* the code for that should still be correct for the latest builds.[/edit]
-=Gonzotek=-

I was away for a while.
But I'm feeling much better now.
Gonzotek is offline   Reply With Quote
Old 11th July 2002, 16:54   #2
mc^^^^
Forum King
 
mc^^^^'s Avatar
 
Join Date: Aug 2001
Location: Perth, Australia MSN: mcbriar@ii.net Posts: All your posts are belong to me!!!!
Posts: 2,607
my way would be to show the container onscriptloaded, and at the same time set an int to 1, make a button in maki that hides the container, and at that same time changes the int to 0. understand?

mc^^^^ is offline   Reply With Quote
Old 11th July 2002, 17:40   #3
Gonzotek
Gunslinger
 
Gonzotek's Avatar
 
Join Date: May 2000
Location: Terminus
Posts: 4,693
Quote:
Originally posted by mc^^^^
my way would be to show the container onscriptloaded, and at the same time set an int to 1, make a button in maki that hides the container, and at that same time changes the int to 0. understand?
But that doesn't solve the problem:
Quote:
is there a way in maki do do something only if the container is visible?
Setting the int in onscriptloaded doesn't help us to know when the user has opened or closed the container after the script is loaded.

-=Gonzotek=-

I was away for a while.
But I'm feeling much better now.
Gonzotek is offline   Reply With Quote
Old 11th July 2002, 18:27   #4
CremoNe
Senior Member
 
CremoNe's Avatar
 
Join Date: Feb 2002
Location: Italy
Posts: 396
can't you add 1 to the int each time you toggle, so that you can chec if it's on or off by the parity?
CremoNe is offline   Reply With Quote
Old 11th July 2002, 19:00   #5
mc^^^^
Forum King
 
mc^^^^'s Avatar
 
Join Date: Aug 2001
Location: Perth, Australia MSN: mcbriar@ii.net Posts: All your posts are belong to me!!!!
Posts: 2,607
make a button in maki to show/hide the container depending on whether the int is 1 or 0

code:

if (containervisible ==1) {
container.hide();
containervisible = 0;
}
else {
container.show();
containervisible = 1;
}



save and load the container's state into the studio.xnf, and run that onscriptloaded.

that way if you want something to happen only if the container is visible, you would do this:

code:

if (containervisible ==1) {
//do shit
}



s-i-m-p-l-e

mc^^^^ is offline   Reply With Quote
Old 11th July 2002, 19:04   #6
Gonzotek
Gunslinger
 
Gonzotek's Avatar
 
Join Date: May 2000
Location: Terminus
Posts: 4,693
It always comes back to not being able to attach get the hide/show/toggle events of containers. There is NO onShow, onHide, or OnToggle for containers, so there isn't an event to cause the int to increment. Like I explained in my first post, I asked Francis about it: I can show, hide and toggle containers, but I can't use onShow, onHide, and onToggle. Why not?

He said that he'd add the functionality, but that was when Winamp3 was still in alpha. Now we're at rc3(almost), and they still aren't in. Not that I'm bitching, but I think it's safe to assume that they won't be there before 3 final.

-=Gonzotek=-

I was away for a while.
But I'm feeling much better now.
Gonzotek is offline   Reply With Quote
Old 11th July 2002, 19:05   #7
Gonzotek
Gunslinger
 
Gonzotek's Avatar
 
Join Date: May 2000
Location: Terminus
Posts: 4,693
Quote:
Originally posted by mc^^^^
make a button in maki to show/hide the container depending on whether the int is 1 or 0

code:

if (containervisible ==1) {
container.hide();
containervisible = 0;
}
else {
container.show();
containervisible = 1;
}



save and load the container's state into the studio.xnf, and run that onscriptloaded.

that way if you want something to happen only if the container is visible, you would do this:

code:

if (containervisible ==1) {
//do shit
}



s-i-m-p-l-e
And what happens when the user doesn't use the button, but uses the Windows menu? Not so simple.

-=Gonzotek=-

I was away for a while.
But I'm feeling much better now.
Gonzotek is offline   Reply With Quote
Old 11th July 2002, 19:11   #8
mc^^^^
Forum King
 
mc^^^^'s Avatar
 
Join Date: Aug 2001
Location: Perth, Australia MSN: mcbriar@ii.net Posts: All your posts are belong to me!!!!
Posts: 2,607
you win

mc^^^^ is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Skinning and Design > Modern Skins

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump