|
Davy Mitchell's Meandering Weblog Home - Angus - Christian - Energy - Fun - General - Internet - IronPython - MoodNews - NintendoDS - Personal - Photos - Podcast - Politics - Python - Scotland - Software Blog Statistics Tag Cloud RSS More Feeds Archives2007-07-142007-07-07 2007-06-30 2007-06-09 2007-05-26 2007-04-28 2007-04-21 2007-04-07 2007-03-24 2007-03-17 |
IronPython - Transparent Label 2 Permalink A little while ago I blogged a little bit of code to create a transparent label control for IronPython. I reused it recently and realised that it did not work too well if the text was changed. Here is the updated version, possibly a bit wasteful but works fine for the current application. Update : I've seen a few funnies with this version. Use with care! class TransLabel(Control):
def __init__(self): self.Font = Font("Microsoft Sans Serif", 32) def CreateParams(self): cp = Label().CreateParams cp.ExStyle = cp.ExStyle | 0x20 return cp CreateParams = property(fget=CreateParams) def OnPaintBackground(self,e): pass def OnPaint(self,e): grfx = e.Graphics grfx.DrawString(self.Text, self.Font, Brushes.Black, 0, 0) def SetText(self,Text): self.Parent.Invalidate() self.Parent.Update() self.Text = Text self.Invalidate() self.Update()
Posted by Davy Mitchell on
2007-08-10 13:26:12. Films Permalink Perhaps watching films with children changes the way you look at them or my suspended disbelief is getting harder to maintain. Today I was really annoyed about the bunch of adventurers who visited the forest moon in camouflaged uniforms on a critical mission to get the bad guys... BUT yes let's take the shiny gold robot without a spot of mud on him to dampen the shine. I am glad I got that off my chest. Thank you.
Posted by Davy Mitchell on
2007-08-06 22:42:53. |
|