Drawing gadgets infront of canvas?

BlitzMax Forums/MaxGUI Module/Drawing gadgets infront of canvas?

maverick69(Posted 2008) [#1]
Hey,

do you guys now if it's possible to draw a gadget like a textfield or a treeview infront of a canvas?


tonyg(Posted 2008) [#2]
Yes it is.
I am guessing you tried and got a problem. What happened and what code did you use?


SebHoll(Posted 2008) [#3]
if it's possible

Probably!

is it recommended or in any way supported?

No. Canvases are such that your Max2D drawing routine should look after all of their own drawing, and so placing controls in the same region may cause undesirable effects. MaxGUI doesn't officially support any type of ordering, and so placing gadgets on top of each other (unless they are children to a group gadget, obviously) isn't recommended as the z-order isn't guaranteed to be the same on all platforms.


skidracer(Posted 2008) [#4]
The trick is to make it a child of the canvas so the OS knows to draw it in front.


SebHoll(Posted 2008) [#5]
The trick is to make it a child of the canvas so the OS knows to draw it in front.

Are you sure that this would work with MaxGUI.CocoaMaxGUI or MaxGUI.FLTKMaxGUI? I think I remember there being a problem reported a while back which I dismissed as I thought this action shouldn't really be supported/encouraged. However, I stayed pretty much clear of the canvas code that you wrote, so I could be wrong...


maverick69(Posted 2008) [#6]
The trick is to make it a child of the canvas so the OS knows to draw it in front. 

Works. Thanks! :)


Brucey(Posted 2008) [#7]
Are you sure that this would work with MaxGUI.CocoaMaxGUI

Nope. The canvas will render over the gadgets.