Colored Panel with Text?

BlitzMax Forums/BlitzMax Beginners Area/Colored Panel with Text?

Gabriel(Posted 2006) [#1]
I was trying to find a simple way to create a Colored panel with a text heading in it. I can create a colored panel by using SetPanelColor, but if I create a label, it sets the background color back to grey again. And SetGadgetColor doesn't seem to work with labels?

I guess it's not vital that it be colored, but it sure would make it stand out, which is kinda the point of a page title, which is what I'm trying to create here.


tonyg(Posted 2006) [#2]
From the doc it looks like a bug. Createlabel suggests you can use setgadgetcolor and setgadgettextcolor.


Gabriel(Posted 2006) [#3]
Whoops, I hadn't spotted that, but they are indeed linked to in the "See Also" section of the docs for CreateLabel.

Global Win:tGadget=CreateWindow("Test",0,0,ClientWidth(Desktop())/2-320,ClientHeight(Desktop())/2-160,Null,15)
Global Label:tGadget=CreateLabel("Black Background, White Text",10,10,400,20,Win)
SetGadgetColor(Label,0,0,0)
SetGadgetTextColor(Label,255,255,255)
Global Finished:Int=False

Repeat
	
	If PollEvent()
		
		Local E:TEvent=CurrentEvent
		
		Select E.ID
			Case EVENT_WINDOWCLOSE
				Finished=True
		End Select
		
	End If
	
Until Finished


Would a mod kindly move this to the bug forum now that I've supplied a little (non)working example or just delete it if there's already a bug report for this.


tonyg(Posted 2006) [#4]
Very similar... but not quite. .