forked from joejulian/gio
all: [API] deliver events one at a time to allow fine-grained event processing
Processing one event at a time allows a widget to execute commands after the event that triggered it, instead of after all matching events. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -109,7 +109,11 @@ func ExampleDraggable_Layout() {
|
||||
ds.Pop()
|
||||
|
||||
// Check for the received data.
|
||||
for _, ev := range gtx.Events(&drop, transfer.TargetFilter{Type: mime}) {
|
||||
for {
|
||||
ev, ok := gtx.Event(&drop, transfer.TargetFilter{Type: mime})
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
switch e := ev.(type) {
|
||||
case transfer.DataEvent:
|
||||
data := e.Open()
|
||||
|
||||
Reference in New Issue
Block a user