PDA

View Full Version : Speaking of Tabs - What's the secret to refreshing tab pages?



sami
07-06-2011, 05:05 PM
I'm using tabs too (for the first time now) and I'm having redrawing issues.

I'm using a ctlpage() per tab but no cltgroup() since I don't need them.

So, say I have a list box and buttons on the first tab, and an image on the 2nd. What happens is that all looks fine if I start the script on tab 1, but when I switch to tab 2, the image appears fine and tab 1's stuff disappears as normal, but the "OK Cancel" section at the bottom of the requester gets covered in backcolor grey even if I switch to an empty tab.

Furthermore, if I switch to the tab 2 with the image and back to the original tab 1, all of tab 1's controls get redrawn over top of the image from tab 2. It's like the act of switching tabs doesn't set visibility of images drawn with ctlimage()?

Any ideas? What am I doing wrong? thanks... :)

Btw. my tabs are not at (0,0) does that matter?

evenflcw
07-06-2011, 05:39 PM
I have no clue.

Tried attaching a ctlrefresh udf to your ctltab?
Try using setvalue() or ctltab.value() to set the tab a second time?
Tried calling requpdate() with or without the tab or controls as arguments?
Disabling and enabling visibility of the controls?
Adding a reqredraw callback just for the hell of it?

If it switches to the correct pages, I dont see how you could have done anything wrong. Perhaps it's just ctlimage that is funky as you suspect.

sami
07-06-2011, 07:07 PM
I have no clue.

Tried attaching a ctlrefresh udf to your ctltab?
Try using setvalue() or ctltab.value() to set the tab a second time?
Tried calling requpdate() with or without the tab or controls as arguments?
Disabling and enabling visibility of the controls?
Adding a reqredraw callback just for the hell of it?

If it switches to the correct pages, I dont see how you could have done anything wrong. Perhaps it's just ctlimage that is funky as you suspect.

Thanks for the ideas. I'm trying them. I just added a refresher_udf to the tab and did a requpdate() in it and that fixes the weird background grey appearing over the system "OK Cancel" buttons on the panel, but it doesn't fix the ctlImage redraw - and it introduces another weird thing: switching tabs now causes a 2nd ctlimage() (not the one on the tab or pages) to contain part of the image content of the other image. Can you say buggy? sigh...

sami
07-07-2011, 12:43 AM
I've given up for this script. I decided not to use tabs in my current script because I can't get them to play nice with ctlimage()s. Maybe I try to make my interfaces too fancy for Lscript....?

If anyone ever has an Lscript (in Modeler) please let me know. I would love to see a stripped down example of an Lscript with images on other tabs not experiencing image redraw issues.

Blochi
07-07-2011, 06:02 PM
ctlimage is a pita. Has always been.
I use it only for the stationary header, that is not assigned to any tab and therefore stays visible at all times.

Whenever I display an image on a tab, I use a ctlinfo instead and draw the image on as Glyph. This gives much more flexibility anyway, because you can swap or animate that glyph at runtime.

sami
07-07-2011, 10:31 PM
I didn't know you could do that. Thanks - I will try drawing a glyph of an image into a ctlinfo.

jameswillmott
07-07-2011, 10:34 PM
I didn't know you could do that. Thanks - I will try drawing a glyph of an image into a ctlinfo.

I used Glyphs for Quadpanels, they worked really well.

sami
07-10-2011, 05:12 PM
cool. good to know

Blochi
07-14-2011, 05:43 PM
Just to add to the praise of Glyphs:
The cool part about them is, that you can load images into Glyphs without them showing up in the Lightwave's image list. So it may save you a cleanup. Also, you can write pixel values inside the Glyph, creating your own complex sprites and move them around in the viewport. Really versatile little buggers, these Glyphs.