<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<!-- THIS FILE IS GENERATED DO NOT EDIT -->


<erlref>
<header>
  <copyright>
    <year>2020</year><year>2021</year>
    <holder>wxWidgets team.</holder></copyright>
  <legalnotice>Licensed under the wxWindows Free Documentation Licence, Version 3
  </legalnotice>
  <title>wxEvtHandler</title>
</header>
<module>wxEvtHandler</module>
<modulesummary>Functions for wxEvtHandler class</modulesummary>
<description><p>A class that can handle events from the windowing system. <seeerl marker="wxWindow"><c>wxWindow</c></seeerl> is (and therefore all window classes are) derived from this class.
      </p><p>To get events from wxwidgets objects you subscribe to them by calling <seemfa marker="#connect/3"><c>connect/3</c></seemfa>.
      </p><p>If the <c>callback</c> option is not supplied events are sent as messages.
      </p><p>These messages will be <c>#wx{}</c> where <c>EventRecord</c> is a record that depends on the <c>wxEventType</c>. The records are defined in: <c>wx/include/wx.hrl</c>.
      </p><p>If a callback was supplied to connect, the callback will be invoked (in another process) to handle the event. The callback should be of arity 2.
      </p><p><c>fun Callback (EventRecord::wx(), EventObject::wxObject()). </c>
      </p><p>Note: The callback will be in executed in new process each time.
      </p><p>See: <url href="https://docs.wxwidgets.org/3.1/overview_events.html#overview_events_processing">Overview events</url>
      </p>
  <p>wxWidgets docs: <url href="https://docs.wxwidgets.org/3.1/classwx_evt_handler.html">wxEvtHandler</url></p>
  </description>
<datatypes>
    <datatype><name name="wxEvtHandler"/></datatype>
    <datatype><name name="wxEventType"/></datatype>
    <datatype><name name="wx"/></datatype>
    <datatype><name name="event"/></datatype></datatypes>

<funcs>
  <func>
    <name name="connect" arity="2" clause_i="1" since=""/>
    <fsummary>See: <c>connect/3</c></fsummary>
  </func>
  
  <func>
    <name name="connect" arity="3" clause_i="1" since=""/>
    <fsummary>This function subscribes to events. </fsummary>
    <desc><p>This function subscribes to events. 
      </p><p>Subscribes to events of type <c>EventType</c>, in the range <c>id</c>, <c>lastId</c>.
      </p><p>The events will be received as messages if no callback is supplied.
      </p><p>Options
      </p><p>id:<c>{id, integer()} </c> The identifier (or first of the identifier range) to be associated with this event handler. Default is ?wxID_ANY
      </p><p>lastid:<c>{lastId,integer()} </c> The second part of the identifier range. If used 'id' must be set as the starting identifier range. Default is ?wxID_ANY
      </p><p>skip:<c>{skip,boolean()} </c> If skip is true further event_handlers will be called. This is not used if the 'callback' option is used. Default is <c>false</c>.
      </p><p>callback:<c>{callback,function()} </c> Use a callback<c>fun(EventRecord::wx(),EventObject::wxObject()) </c> to process the event. Default not specfied i.e. a message will be delivered to the process calling this function.
      </p><p>userData:<c>{userData,term()} </c> An erlang term that will be sent with the event. Default: []. 
      </p></desc>
  </func>
  
  <func>
    <name name="disconnect" arity="1" clause_i="1" since=""/>
    <fsummary/>
    <desc/>
  </func>
  
  <func>
    <name name="disconnect" arity="2" clause_i="1" since=""/>
    <fsummary/>
    <desc/>
  </func>
  
  <func>
    <name name="disconnect" arity="3" clause_i="1" since=""/>
    <fsummary>This function unsubscribes the process or callback fun from the event handler. </fsummary>
    <desc><p>This function unsubscribes the process or callback fun from the event handler. 
      </p><p>EventType may be the atom 'null' to match any eventtype. Notice that the options skip and userdata is not used to match the eventhandler. 
      </p></desc>
  </func>
  </funcs>
</erlref>
