Window Color (B+)..?
Blitz3D Forums/Blitz3D Beginners Area/Window Color (B+)..?
| ||
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? |
| ||
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)). |
| ||
See the blitplus codearchives for my PanelWindow example. |
| ||
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! |
| ||
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+.. |
| ||
Brian, Your CreatePanel syntax is wrong. should be: panel=CreatePanel (200,100,200,150,window) |
| ||
Of course!! Thanks! ;) |
| ||
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.. ;) |
| ||
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). |