wxPython about event function

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

    wxPython about event function

    class container(wxPan el):
    self.compnt is a control

    the event func:

    EVT_LEFT_DOWN(s elf,self.OnLeft Down)

    when click container
    self.OnLeftDown will be called
    when click self.compnt
    self.OnLeftDown won't be called

    please tell me
    why?
    and how to call the func, both case?

    thanks


  • Hans Nowak

    #2
    Re: wxPython about event function

    RolleXu wrote:
    [color=blue]
    > class container(wxPan el):
    > self.compnt is a control
    >
    > the event func:
    >
    > EVT_LEFT_DOWN(s elf,self.OnLeft Down)
    >
    > when click container
    > self.OnLeftDown will be called
    > when click self.compnt
    > self.OnLeftDown won't be called
    >
    > please tell me
    > why?
    > and how to call the func, both case?[/color]

    Well, you attach the event to 'self', which is the container. You probably want:

    EVT_LEFT_DOWN(s elf.compnt, self.OnLeftDown )

    HTH,

    --
    Hans Nowak (hans@zephyrfal con.org)
    Memimpin Angin Perubahan Teknologi


    Comment

    Working...