Old 4th June 2003, 00:51   #1
AndrewMackowski
Member
 
Join Date: Mar 2002
Posts: 92
Problems with onShowLayout()

I'm working on a script for my new skin, and I'm having trouble with the event
code:
container.onShowLayout(layout newlayout)


I can get it to work when I have the code:

code:
System.onShowLayout(layout newlayout)


but I believe that this returns all layouts for all containers--I only want the layouts in the main container. So, I wrote this:
code:

Global container maincontainer;

System.onScriptLoaded() {
maincontainer = getContainer("main");
//stuff...
}

maincontainer.onShowLayout(layout newlayout) {
//more stuff...
}



However, onShowLayout is never called when I have "maincontainer" in front of it instead of "System". Any suggestions?
AndrewMackowski is offline   Reply With Quote
Old 4th June 2003, 02:24   #2
rpeterclark
Major Dude
(Reviewer)
 
rpeterclark's Avatar
 
Join Date: Aug 2002
Location: South Florida
Posts: 1,388
Maybe you could do something like this:

code:

Global container maincontainer;

System.onScriptLoaded() {
maincontainer = getContainer("main");
}

System.onShowLayout(layout newlayout) {
if (newlayout.getContainer() == maincontainer) {
//stuff...
}
}



It's not tested, but seems like it might work.
rpeterclark is offline   Reply With Quote
Old 5th June 2003, 05:23   #3
AndrewMackowski
Member
 
Join Date: Mar 2002
Posts: 92
Yeah, thanks, I'm doing something like that. Unfortunately I think it slows down the code to scan what the layout is every time any layout is shown.
AndrewMackowski is offline   Reply With Quote
Old 5th June 2003, 06:06   #4
AndrewMackowski
Member
 
Join Date: Mar 2002
Posts: 92
also, I don't think you can use

code:
newlayout.getContainer()


because getContainer returns a container from an id.
AndrewMackowski is offline   Reply With Quote
Old 5th June 2003, 06:08   #5
AndrewMackowski
Member
 
Join Date: Mar 2002
Posts: 92
oh, wait, yes you can I just found it at the bottom of std.mi---good eyes!
AndrewMackowski is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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