|
From: Davy D. <dd...@ne...> - 2001-12-14 05:45:06
|
I noticed something about FXSwitcher that could possibly be improved... In my sound editor, I have some playing LED indicators which are just labels with an FXIcon... Well, I put two labels on a switcher: one with the 'LED-on' image and one with the 'LED-off' image... So when playing starts, I setCurrent(...) on the switcher and then again when it stops... Well, in my situation, I have the waveform in another FX...Frame above the status frame where the LEDs are. When I switch the switcher, it recalculates the layout of the switcher which causes everything in the window to have to refresh, hence, the entire waveform view redraws... I noticed this when I was printing everytime I draw part of the waveform in order to figure out if I'm unnecessarily drawing many times at startup (which I was, but I've supressed all the redraws during initial layout adjustments until I know I'm ready)... Anyway, I understand that it may be necessary to re-layout stuff upon using the switcher, but the two things in the switcher are the same size, so it shouldn't be necessary to do the layout... I guess this would just be a special case to check in the FXSwitcher implementation, but it's one of those optimizations you can do after most everything else is working. (Anyway for now.. I'm going to put 2 labels on top if each other and use raise() to bring to the top which ever I want to show... I only hope this doesn't have the same side effect) -- Davy |