2007年01月12日 星期五 13:40
ÎҼ̳ÐÁËÒ»¸ö wx.TextCtrl
class PicaTextCtrl(wx.TextCtrl):
È»ºó °ó¶¨onpaint()
def OnPaint(self,evt):
dc = wx.PaintDC(self)
p = dc.GetPen()
p.SetColour(self.FrameColor)
dc.SetPen(p)
rc = self.GetClientRect()
dc.DrawRectangleRect(rc)
¿ÉÊÇÎÒ·¢ÏÖ Îı¾¿òÀïµÄ×Ö ÓÐʱºò²»»á±»Öػ棬¶øÊÇÒªÊó±êµã»÷Ò»ÏÂ²Å»á±»ÖØ»æ£¬ËÖª
µÀÕâÊÇÔõô»ØÊÂ
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070112/c8ce72fe/attachment.html
2007年01月13日 星期六 10:19
"Feng shihao" <fengsh在pica.com> writes: > 我继承了一个 wx.TextCtrl > > class PicaTextCtrl(wx.TextCtrl): > > 然后 绑定onpaint() > > def OnPaint(self,evt): > > dc = wx.PaintDC(self) > > p = dc.GetPen() > > p.SetColour(self.FrameColor) > > dc.SetPen(p) > > rc = self.GetClientRect() > > dc.DrawRectangleRect(rc) > > > > 可是我发现 文本框里的字 有时候不会被重绘,而是要鼠标点击一下才会被重绘,谁知 > 道这是怎么回事 > 请问怎么绑定OnPaint? 在TextCtrl里面绑定OnPaint有什么特别用处? -- \\\|/// | ( @ @ ) ☆ www.chinavib.com ☆ | -oOOo-(_)-oOOo-------------------------------|
2007年01月13日 星期六 11:18
×îºó¼ÓÒ»¾ä
self.Refresh()
¼´¿É
2007/1/13, zeroslug <zeroslug在163.com>:
>
> "Feng shihao" <fengsh在pica.com> writes:
>
> > ÎҼ̳ÐÁËÒ»¸ö wx.TextCtrl
> >
> > class PicaTextCtrl(wx.TextCtrl):
> >
> > È»ºó °ó¶¨onpaint()
> >
> > def OnPaint(self,evt):
> >
> > dc = wx.PaintDC(self)
> >
> > p = dc.GetPen()
> >
> > p.SetColour(self.FrameColor)
> >
> > dc.SetPen(p)
> >
> > rc = self.GetClientRect()
> >
> > dc.DrawRectangleRect(rc)
> >
> >
> >
> > ¿ÉÊÇÎÒ·¢ÏÖ Îı¾¿òÀïµÄ×Ö ÓÐʱºò²»»á±»Öػ棬¶øÊÇÒªÊó±êµã»÷Ò»ÏÂ²Å»á±»ÖØ»æ£¬ËÖª
> > µÀÕâÊÇÔõô»ØÊÂ
> >
>
> ÇëÎÊÔõô°ó¶¨OnPaint? ÔÚTextCtrlÀïÃæ°ó¶¨OnPaintÓÐÊ²Ã´ÌØ±ðÓô¦£¿
>
> --
> \\\|/// |
> ( @ @ ) ¡î www.chinavib.com ¡î |
> -oOOo-(_)-oOOo-------------------------------|
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070113/b123b5cd/attachment.html
Zeuux © 2025
京ICP备05028076号