Old 18th February 2005, 20:57   #1
Michgelsen
Major Dude
 
Michgelsen's Avatar
 
Join Date: Oct 2003
Location: Netherlands
Posts: 1,416
Two togglebuttons, one function, with maki

Ok, I need to have two togglebuttons that control the same function.
Now, I started with one, which worked, and later added the second one.
When I click the second one, the first one is supposed to change along. That works, but the function the first one controls doesn't switch along.

Example: The first one is "on". Thus the second one looks as if it's "on". When I click the first one, it goes off, and the function it controls goes off. The second one looks off now too. Everything ok.
But, when they both are on and I click the second one, they both LOOK like they are off but they aren't! My notifier (that what it's for) still keeps poppin' up.

Here's my maki, what do I do wrong..?
PHP Code:
//System.onScriptLoaded() section

onoff eq.getObject("notifieronoff");
alwaysselector eq.getObject("alwaysselector");
onoff2 eq.getObject("notifieronoff2");
alwaysselector2 eq.getObject("alwaysselector2");

if(
getPrivateInt("AudioRack""notifieronoff"on) == 1) {on 1;}
if(
getPrivateInt("AudioRack""notifieronoff"on) != 1) {on 0;}
if(
on == 1) {onoff.setActivated(1); onoff2.setActivated(1);}
if(
on == 0) {onoff.setActivated(0); onoff2.setActivated(0);}

if(
getPrivateInt("AudioRack""minimizedonly"always) == 1) {always 1;}
if(
getPrivateInt("AudioRack""minimizedonly"always) != 1) {always 0;}
if(
always == 1) {alwaysselector.setActivated(1); alwaysselector2.setActivated(1);}
if(
always == 0) {alwaysselector.setActivated(0); alwaysselector2.setActivated(0);}
}


Onoff.onLeftButtonUp(int xint y) {
    
on onoff.getActivated();
    
onoff2.setActivated(on);
}
Onoff2.onLeftButtonUp(int xint y) {
    
onoff.leftClick();
}
Alwaysselector.onLeftButtonUp(int xint y) {
    
always alwaysselector.getActivated();
    
alwaysselector2.setActivated(always);
}
Alwaysselector2.onLeftButtonUp(int xint y) {
    
alwaysselector.leftClick();

Michgelsen is offline   Reply With Quote
Old 21st February 2005, 03:07   #2
leechbite
Major Dude
 
leechbite's Avatar
 
Join Date: Sep 2003
Location: Canada
Posts: 635
Send a message via Yahoo to leechbite
maybe

PHP Code:
onoff.onActivate(int on) {
  
onoff2.setActivatedNoCallBack(on==1);
}

onoff2.onActivate(int on) {
  
onoff.setActivatedNoCallBack(on==1);

leechbite is offline   Reply With Quote
Old 21st February 2005, 12:56   #3
Michgelsen
Major Dude
 
Michgelsen's Avatar
 
Join Date: Oct 2003
Location: Netherlands
Posts: 1,416
No that didn't work, but I tried to dubble code it:
PHP Code:
Onoff.onLeftButtonUp(int xint y) {
    
on onoff.getActivated();
    
onoff2.setActivated(on);
}
Onoff2.onLeftButtonUp(int xint y) {
    
on onoff2.getActivated();
    
onoff.setActivated(on);
}

Alwaysselector.onLeftButtonUp(int xint y) {
    
always alwaysselector.getActivated();
    
alwaysselector2.setActivated(always);
}
Alwaysselector2.onLeftButtonUp(int xint y) {
    
always alwaysselector2.getActivated();
    
alwaysselector.setActivated(always);

That did work, although I still don't get why it didn't work the first time, because in fact it just says the same right?
I didn't want to use that at first because it felt a bit weird but I guess it's ok. It works now.

Then one other thing: what's the difference between setActivated() and setActivatedNoCallback()? What is it that NoCallback adds?

BTW thanks for your help. I feared this topic would be forgotten since it's already 3 days ago I posted it.
Michgelsen is offline   Reply With Quote
Old 22nd February 2005, 03:29   #4
leechbite
Major Dude
 
leechbite's Avatar
 
Join Date: Sep 2003
Location: Canada
Posts: 635
Send a message via Yahoo to leechbite
setActivatedNoCallBack() is same with setActivated() except it wont call the function onActivate(int on).
leechbite is offline   Reply With Quote
Old 22nd February 2005, 19:45   #5
Michgelsen
Major Dude
 
Michgelsen's Avatar
 
Join Date: Oct 2003
Location: Netherlands
Posts: 1,416
Oh ok I get it. Thanks!
Michgelsen 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