PDA

View Full Version : 2 Questions about SetDoNotDraw in CG & Callbacks



kltv
08-01-2004, 02:46 AM
I've figured out my earlier issues, now I have a couple more.

I'm trying to build a skin for the CG module that has a series of buttons similar to the switcher program bus, where only one of the buttons should be "on" at once. How do I tell the other buttons to turn "off" when another one has been turned "on." I'm thinking I need a callback like the mouse ones, can a callback be any function?

In the ToasterCG module, is SetDoNotDraw the equivalent for the Do Not Render checkbox in the interface? It didn't seem to work on the image layer I was trying to hide and reveal.

Thanks again!
Kris

kltv
08-03-2004, 07:37 PM
Would the GetButtonState() callback help me with this? Could I use it to check the state of the other buttons? The other thought I had was to use a timer callback to periodically check the states. Would something like that work?

Kris

kltv
08-04-2004, 11:25 PM
Anyone have any ideas? It seems like something I should be able to do, if I knew programming better. My own brain can't seem to figure it out.

Kris

Blake
08-09-2004, 10:42 AM
Originally posted by kltv
Would the GetButtonState() callback help me with this? Could I use it to check the state of the other buttons? The other thought I had was to use a timer callback to periodically check the states. Would something like that work?

Kris

Well, you could just turn the other buttons off when a button is clicked. Suppose you have 3 buttons, btnA, btnB, btnC...



//Not real code, just the theory of it

btnA {
onclick{
btnB.off()
btnC.off()
}
}

btnB {
onclick{
btnA.off()
btnC.off()
}
}

btnC {
onclick{
btnA.off()
btnB.off()
}
}


That should work for what you're doing, and is a little simpler than calling GetButtonState() multiple times so often.

-Blake

kltv
08-09-2004, 02:29 PM
Thanks for the reply Blake! That's exactly what I'm trying to do.

Would that work in just ToasterScript or would it need to be in a C++ program?

Thanks!
Kris