Window Color (B+)..?

Blitz3D Forums/Blitz3D Beginners Area/Window Color (B+)..?

BachFire(Posted 2003) [#1]
Hey,

This may seem stupid.. But how do you set the color of a windows background, instead of the default grey color?

I took a long-shot, and tried the ClsColor->Cls method, but it does not work. Guess that's only for Graphics then, right?

I really can't spot anything about this, in the command reference.. Can someone help?


Mark Tiffany(Posted 2003) [#2]
You can't directly modify the window contents. However, it sounds like what you need is a canvas. If you create a canvas inside the window, covering the entire window area, you can then draw to after using SetBuffer(CanvasBuffer(canvas)).


skidracer(Posted 2003) [#3]
See the blitplus codearchives for my PanelWindow example.


BachFire(Posted 2003) [#4]
All right, thank you both of you. Looks like it takes a little more work to do Windows App stuff, than straight 2D stuff. Not that it scares me, though.. ;) Thanks!


BachFire(Posted 2003) [#5]
Uhm.. A weird thing here.. This is nothing final, just messing around. This code..:

window=CreateWindow ("My Window",GraphicsWidth()/2,GraphicsHeight()/2,500,300,0,1)
panel=CreatePanel (200,100,200,150,"My Window")
 
Repeat 
If WaitEvent()=$803 Then Exit 
Forever 

End


..crashes blitz (blitzcc.exe). Why? Does this crash yours? It's B+..


assari(Posted 2003) [#6]
Brian,
Your CreatePanel syntax is wrong.
should be:
panel=CreatePanel (200,100,200,150,window)


BachFire(Posted 2003) [#7]
Of course!! Thanks!

;)


BachFire(Posted 2003) [#8]
Another problem. Can this area be colored?

window=CreateWindow ("Basic window with colored background",GraphicsWidth()/2,GraphicsHeight()/2,500,300,0,1)
panel=CreatePanel (0,0,ClientWidth(window),ClientHeight(window),window)
SetGadgetLayout panel,True,True,True,True
SetPanelColor panel,100,100,255

button=CreateButton ("I'm grey! I wish I was blue...",20,20,150,40,window,3)
 
Repeat 
 If WaitEvent()=$803 Then Exit 
Forever

End


Should I conclude, that it's not possible to do "color-magic" in Win32 apps..? Could be nice with some more easy color-control here.. ;)


Mark Tiffany(Posted 2003) [#9]
I'm afraid you can't do that Brian. Yet.

(well, you probably can by looking up WinAPI calls, and setting up the appropriate .decl files to call them, but that's not the answer you (or I) want).