Hey Chris, Thanks for the input.
In short,
ClientDC is probably not the right approach.
As I feared.
screen). I need to outline each row with a box, and the outline color
changes based on data from the Row (if column 1 is “True”, the box will be
green, if “False”, the box will be red).
My question is 2 fold–
- Does this sound like the best solution? I’m a little worried that DC
will not be preserved, and I may have to redraw the boxes each time.
you will – you’d do that by capturing the paint event, and using a wx.PaintDC.
Okay, I was a bit unsure of the OnDraw event handling. If I use this solution of drawing the boxes I’ll play around more with the wx.PaintDC.
think of any other solution. StaticBox doesn’t allow you to change just the
box outline (correct?).
I think you’re right, and this is in no way a StaticBox anyway.
Have you looked into wx.Grid custom renderers? that’s probably the way to go.
Yes, I am using the custom renderers to do images and the like inside the grid. This was my first thought, but the only thing I could find with the renders was placing other objects INSIDE a cell, not outlining an entire row of multiple cells. I’ll dig a little more, maybe there is something that can be used.
- I cannot get my ClientDC to render the square in the attached file. Am I
missing a step? I have seen some code with dc.BeginDrawing and EndDrawing,
but that didn’t do the trick, either.
It is a bit tricky to draw on top of existing Windows – in general,
wx.Windows are nto designed to overlap, and draw themselves. Google
around for “wxpython drwwing on top” and see what you find.
Hmm, i see. I guess I misunderstood the inteded use of the DC’s.
I’ve enclosed a fixed version of your code – you need to use a
PaintDC and the paint event.
Search the wiki for “Drawing” and you’ll find a number of pages that
explain all this.
Thanks, I’ll take a look
I also cleaned up a bit of style Do take a moment to read:
http://wiki.wxpython.org/wxPython%20Style%20Guide
Ha, yes, I am familiar with the style guide. I guess when I am experimenting I don’t take too much time to conform completely, especially when copy and pasting from multiple sources on the interwebs/demo. Sorry about that-- I’ll be sure to pay more attention
···
On Monday, August 19, 2013 2:56:33 PM UTC-4, Chris Barker - NOAA Federal wrote:
On Mon, Aug 19, 2013 at 8:06 AM, Jake Larrimore > > jacobla...@gmail.com wrote:
HTH,
-Chris
–
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris....@noaa.gov