wx Python event question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dudds

    #1

    wx Python event question

    Hi I really haven't used wxPython before and I was just wondering if
    there was some sort of timer event that can be used. For example if I
    have a database that I want to query at regular intervals and display
    the results in a window is that possibly to do under a wx Python
    program?

    So far I have come across certain event handlers, but they all seem to
    wait for something to happen, like moving the mouse, clicking on a
    button etc. I just want to display the results of a query every so
    often automatically without having to press a button to do so.

    I'm not looking for a complete solution as I'm doing this so I can
    teach myself Python, but a bit of a hint or a nudge in the right
    direction would be great.

  • Steve

    #2
    Re: wx Python event question

    use wx.Timer - you bind a method to a timer event and define the
    timer's interval when you start it

    timer = wx.Timer(self, -1)
    self.Bind(wx.EV T_TIMER, self.timerMetho d, timer)
    timer.Start(500 )


    On Jan 27, 5:56 pm, "dudds" <d...@netspace. net.auwrote:
    Hi I really haven't used wxPython before and I was just wondering if
    there was some sort of timer event that can be used. For example if I
    have a database that I want to query at regular intervals and display
    the results in a window is that possibly to do under a wx Python
    program?
    >
    So far I have come across certain event handlers, but they all seem to
    wait for something to happen, like moving the mouse, clicking on a
    button etc. I just want to display the results of a query every so
    often automatically without having to press a button to do so.
    >
    I'm not looking for a complete solution as I'm doing this so I can
    teach myself Python, but a bit of a hint or a nudge in the right
    direction would be great.

    Comment

    • dudds

      #3
      Re: wx Python event question

      Thanks Steve.

      On Jan 27, 8:01 pm, "Steve" <stephen...@gma il.comwrote:
      use wx.Timer - you bind a method to a timer event and define the
      timer's interval when you start it
      >
      timer = wx.Timer(self, -1)
      self.Bind(wx.EV T_TIMER, self.timerMetho d, timer)
      timer.Start(500 )
      >
      On Jan 27, 5:56 pm, "dudds" <d...@netspace. net.auwrote:
      >
      Hi I really haven't used wxPython before and I was just wondering if
      there was some sort of timer event that can be used. For example if I
      have a database that I want to query at regular intervals and display
      the results in a window is that possibly to do under a wx Python
      program?
      >
      So far I have come across certain event handlers, but they all seem to
      wait for something to happen, like moving the mouse, clicking on a
      button etc. I just want to display the results of a query every so
      often automatically without having to press a button to do so.
      >
      I'm not looking for a complete solution as I'm doing this so I can
      teach myself Python, but a bit of a hint or a nudge in the right
      direction would be great.

      Comment

      Working...