summaryrefslogtreecommitdiff
path: root/lib/wx/doc/src/wxEvtHandler.xml
blob: c38da3e127cb84276da083d393d73edbb9459c3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?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>