(maxgui) refresh canvas from another window

BlitzMax Forums/BlitzMax Beginners Area/(maxgui) refresh canvas from another window

hub(Posted 2006) [#1]
Hi !
i've the following problem. when i open the second window and move it on the first, the first canvas is not drawn correctly (see the picture).

How to resolve this ?

Thanks !







Dreamora(Posted 2006) [#2]
I think you will need to have the GL driver for now ... DX + multiple canvas does have some problems


Sören(Posted 2006) [#3]
When the second window is open, the first canvas doesn't get drawn as you move to another loop (in Draw_second_window()) where you only draw the second canvas.


hub(Posted 2006) [#4]
smattbac : I've already added the fellowing code to the
Draw_second_window()) into the 'case event_timertick' to redraw the canvas. but I've the similar problem.

			
				SetGraphics CanvasGraphics(Canvas1)
				Cls
				
				For Local i=0 To GadgetWidth (Canvas1) Step 32
					DrawLine i,0,i,GadgetHeight(Canvas1)
				Next
				
				SetColor 0,40,0
				For Local i=0 To GadgetHeight (Canvas1) Step 32
					DrawLine 0,i,GadgetWidth(Canvas1),i
				Next
 



assari(Posted 2006) [#5]
Have you tried using eventhooks?
see tutorial 15 here


hub(Posted 2006) [#6]
many thanks assari, eventhooks seems the best method.


ImaginaryHuman(Posted 2006) [#7]
You probably need to act on the GADGETPAINT event via a hook.


hub(Posted 2006) [#8]
I've now another problem. When the smallwindow is active i don't want that the user could access (an close) the first window. For example if the user open the second window he can clic into the first window close button... and close the second window ! i've tried to disable the first window (disablegadget MyWindow) into the Show_smallwindow() function... not work !

Thanks for your help !