Python论坛  - 讨论区

标题:[python-chinese] 想做一个简单的类似QQ的自动隐藏,隐藏想显示出来搞不定,高手帮忙看看。

2006年02月11日 星期六 17:47

HoLin holin.he at gmail.com
Sat Feb 11 17:47:20 HKT 2006

加粗部分*EVT_MOUSE_EVENTS(self, self.OnEnter)好像没用。*

# -*- coding: utf-8 -*-
import wx
from wxPython.wx import *
import wx.lib.iewin as iewin
class exFrame (wxFrame):
   def __init__(self, parent, ID, title):

wxFrame.__init__(self,parent,ID,title,wxDefaultPosition,wxSize(300,400)
                       ,style= wx.DEFAULT_FRAME_STYLE | wx.STAY_ON_TOP
                       )
      self.timer = wxPyTimer(self.winHide)
      self.timer.Start(1000)
      self.screen = (wxSystemSettings.GetMetric(wxSYS_SCREEN_X),
wxSystemSettings.GetMetric(wxSYS_SCREEN_X))
      self.SetPosition((self.screen[0]-6,100))
      *EVT_MOUSE_EVENTS(self, self.OnEnter)*


   def winHide(self):
      p = self.GetPosition()
      s = self.GetClientSize()
      #print self.GetPosition()
      rightD = self.screen[0] - p[0] - s[0]
      if rightD in range(0,20):
          self.SetPosition((self.screen[0]-6,p[1]))
   *def OnEnter (self, event):
      p = self.GetPosition()
      s = self.GetClientSize()
      print self.GetPosition()
      if p == (self.screen[0]-6,p[1]):
          self.SetPosition((self.screen[0]-21-s[0],p[1]))*
   def winShow(self, event):
      p = self.GetPosition()
      s = self.GetClientSize()
      print self.GetPosition()
      if p == (self.screen[0]-6,p[1]):
          self.SetPosition((self.screen[0]-21-s[0],p[1]))

class MyApp(wx.App):
   def OnInit(self):
       self.frame = exFrame(NULL, -1, "HoLin Widgets!")
       self.htmlctrl = iewin.IEHtmlWindow(self.frame)
       self.htmlctrl.LoadUrl("http://hwl:11/list.asp")

       self.SetTopWindow(self.frame)
       self.frame.Show()
       return True

app = MyApp(0)
app.MainLoop()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060211/f0aeb8dd/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年02月12日 星期日 00:00

HoLin holin.he at gmail.com
Sun Feb 12 00:00:11 HKT 2006

每人了解吗?

On 2/11/06, HoLin <holin.he at gmail.com> wrote:
>
> 加粗部分*EVT_MOUSE_EVENTS(self, self.OnEnter)好像没用。*
>
> # -*- coding: utf-8 -*-
> import wx
> from wxPython.wx import *
> import wx.lib.iewin as iewin
> class exFrame (wxFrame):
>    def __init__(self, parent, ID, title):
>
> wxFrame.__init__(self,parent,ID,title,wxDefaultPosition,wxSize(300,400)
>                        ,style= wx.DEFAULT_FRAME_STYLE | wx.STAY_ON_TOP
>                        )
>       self.timer = wxPyTimer(self.winHide)
>       self.timer.Start(1000)
>       self.screen = (wxSystemSettings.GetMetric (wxSYS_SCREEN_X),
> wxSystemSettings.GetMetric(wxSYS_SCREEN_X))
>       self.SetPosition((self.screen[0]-6,100))
>       *EVT_MOUSE_EVENTS(self, self.OnEnter)*
>
>
>    def winHide(self):
>       p = self.GetPosition()
>       s = self.GetClientSize()
>       #print self.GetPosition()
>       rightD = self.screen[0] - p[0] - s[0]
>       if rightD in range(0,20):
>           self.SetPosition((self.screen[0]-6,p[1]))
>    *def OnEnter (self, event):
>       p = self.GetPosition()
>       s = self.GetClientSize()
>       print self.GetPosition()
>       if p == (self.screen[0]-6,p[1]):
>           self.SetPosition((self.screen [0]-21-s[0],p[1]))*
>    def winShow(self, event):
>       p = self.GetPosition()
>       s = self.GetClientSize()
>       print self.GetPosition()
>       if p == (self.screen[0]-6,p[1]):
>           self.SetPosition ((self.screen[0]-21-s[0],p[1]))
>
> class MyApp(wx.App):
>    def OnInit(self):
>        self.frame = exFrame(NULL, -1, "HoLin Widgets!")
>        self.htmlctrl = iewin.IEHtmlWindow(self.frame)
>        self.htmlctrl.LoadUrl("http://hwl:11/list.asp")
>
>        self.SetTopWindow(self.frame)
>        self.frame.Show()
>        return True
>
> app = MyApp(0)
> app.MainLoop()
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060212/97e7a695/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年02月12日 星期日 17:28

Yin Desheng dsyin.cool at gmail.com
Sun Feb 12 17:28:14 HKT 2006

没用的是这里,因为条件不成立
*****if p == (self.screen[0]-6,p[1]):
          self.SetPosition((self.screen [0]-21-s[0],p[1]))*



在06-2-11,HoLin <holin.he at gmail.com> 写道:
>
> 每人了解吗?
>
> On 2/11/06, HoLin <holin.he at gmail.com> wrote:
> >
> > 加粗部分*EVT_MOUSE_EVENTS(self, self.OnEnter)好像没用。*
> >
> > # -*- coding: utf-8 -*-
> > import wx
> > from wxPython.wx import *
> > import wx.lib.iewin as iewin
> > class exFrame (wxFrame):
> >    def __init__(self, parent, ID, title):
> >
> > wxFrame.__init__(self,parent,ID,title,wxDefaultPosition,wxSize(300,400)
> >                        ,style= wx.DEFAULT_FRAME_STYLE | wx.STAY_ON_TOP
> >                        )
> >       self.timer = wxPyTimer(self.winHide)
> >       self.timer.Start(1000)
> >       self.screen = (wxSystemSettings.GetMetric (wxSYS_SCREEN_X),
> > wxSystemSettings.GetMetric(wxSYS_SCREEN_X))
> >       self.SetPosition((self.screen[0]-6,100))
> >       *EVT_MOUSE_EVENTS(self, self.OnEnter)*
> >
> >
> >    def winHide(self):
> >       p = self.GetPosition()
> >       s = self.GetClientSize()
> >       #print self.GetPosition()
> >       rightD = self.screen[0] - p[0] - s[0]
> >       if rightD in range(0,20):
> >           self.SetPosition((self.screen[0]-6,p[1]))
> >    *def OnEnter (self, event):
> >       p = self.GetPosition()
> >       s = self.GetClientSize()
> >       print self.GetPosition()
> >       if p == (self.screen[0]-6,p[1]):
> >           self.SetPosition((self.screen [0]-21-s[0],p[1]))*
> >    def winShow(self, event):
> >       p = self.GetPosition()
> >       s = self.GetClientSize()
> >       print self.GetPosition()
> >       if p == (self.screen[0]-6,p[1]):
> >           self.SetPosition ((self.screen[0]-21-s[0],p[1]))
> >
> > class MyApp(wx.App):
> >    def OnInit(self):
> >        self.frame = exFrame(NULL, -1, "HoLin Widgets!")
> >        self.htmlctrl = iewin.IEHtmlWindow(self.frame)
> >        self.htmlctrl.LoadUrl("http://hwl:11/list.asp")
> >
> >        self.SetTopWindow(self.frame)
> >        self.frame.Show()
> >        return True
> >
> > app = MyApp(0)
> > app.MainLoop()
> >
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060212/8283ac91/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年02月12日 星期日 17:39

HoLin holin.he at gmail.com
Sun Feb 12 17:39:46 HKT 2006

这个条件会成立的。
就是事件没有触发,我那里有两个print语句,根本没有执行。:(


On 2/12/06, Yin Desheng <dsyin.cool at gmail.com> wrote:
>
> 没用的是这里,因为条件不成立
> *****if p == (self.screen[0]-6,p[1]):
>           self.SetPosition((self.screen [0]-21-s[0],p[1]))*
>
>
>
> 在06-2-11,HoLin <holin.he at gmail.com> 写道:
> >
> > 每人了解吗?
> >
> > On 2/11/06, HoLin <holin.he at gmail.com> wrote:
> > >
> > > 加粗部分*EVT_MOUSE_EVENTS(self, self.OnEnter)好像没用。*
> > >
> > > # -*- coding: utf-8 -*-
> > > import wx
> > > from wxPython.wx import *
> > > import wx.lib.iewin as iewin
> > > class exFrame (wxFrame):
> > >    def __init__(self, parent, ID, title):
> > >
> > > wxFrame.__init__(self,parent,ID,title,wxDefaultPosition,wxSize(300,400)
> > >                        ,style= wx.DEFAULT_FRAME_STYLE | wx.STAY_ON_TOP
> > >                        )
> > >       self.timer = wxPyTimer(self.winHide)
> > >       self.timer.Start(1000)
> > >       self.screen = (wxSystemSettings.GetMetric (wxSYS_SCREEN_X),
> > > wxSystemSettings.GetMetric(wxSYS_SCREEN_X))
> > >       self.SetPosition((self.screen[0]-6,100))
> > >       *EVT_MOUSE_EVENTS(self, self.OnEnter)*
> > >
> > >
> > >    def winHide(self):
> > >       p = self.GetPosition()
> > >       s = self.GetClientSize()
> > >       #print self.GetPosition()
> > >       rightD = self.screen[0] - p[0] - s[0]
> > >       if rightD in range(0,20):
> > >           self.SetPosition((self.screen[0]-6,p[1]))
> > >    *def OnEnter (self, event):
> > >       p = self.GetPosition()
> > >       s = self.GetClientSize()
> > >       print self.GetPosition()
> > >       if p == (self.screen[0]-6,p[1]):
> > >           self.SetPosition((self.screen [0]-21-s[0],p[1]))*
> > >    def winShow(self, event):
> > >       p = self.GetPosition()
> > >       s = self.GetClientSize()
> > >       print self.GetPosition()
> > >       if p == (self.screen[0]-6,p[1]):
> > >           self.SetPosition ((self.screen[0]-21-s[0],p[1]))
> > >
> > > class MyApp(wx.App):
> > >    def OnInit(self):
> > >        self.frame = exFrame(NULL, -1, "HoLin Widgets!")
> > >        self.htmlctrl = iewin.IEHtmlWindow(self.frame)
> > >        self.htmlctrl.LoadUrl("http://hwl:11/list.asp")
> > >
> > >        self.SetTopWindow(self.frame)
> > >        self.frame.Show()
> > >        return True
> > >
> > > app = MyApp(0)
> > > app.MainLoop()
> > >
> >
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to
> > python-chinese-request at lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
> >
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060212/ad9e7422/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号