Button Gadget Colour

BlitzPlus Forums/BlitzPlus Programming/Button Gadget Colour

Mental Image(Posted 2004) [#1]
Hi,

I want to have a number of button gadgets with no text but with a different colour for each (the idea being that the user click on button, which will then allow a palette request change the colour of something). I had thought that the way to do this was to draw a canvas on top of the button, but every time I use CreateCanvas, it draws it underneath the button, not on top.

Any ideas?


CS_TBL(Posted 2004) [#2]
canvas on a button = nocando

Make your own button using a canvas.. using $201/$203/$203 etc.

With a lil more attention, using banks, you can make your own button which can act just as any other gadget.. did it myself with images. You prolly only need a seperate routine in your mainloop to check on your own events but that's all then..


Mental Image(Posted 2004) [#3]
Thank you. That makes sense. Do you need to check for a $201 over each user defined canvas, or just look out for the $201 event and then check which canvas it was?


soja(Posted 2004) [#4]
Check for $201 events, then check for eventdata = 1, then check whether eventsource = your canvas handle.


CS_TBL(Posted 2004) [#5]
And with a lil more fantasy you can make more out of all this by creating way more advanced gadgets than the built-in ones..

atm I'm busy with a grid of buttons.. the only thing it should return when you press one of them is the button-number. Each button is based on an image.. imagine how simple it is to make a 'group of buttons' for a design-tool. I'll prolly post it one day, but atm it's buggy and non-functional.