github.com/ckxng/wakeup@v0.0.0-20190105202853-90356a5f5a15/src/gtk/export.go (about)

     1  // Copyright (c) 2014 The cef2go authors. All rights reserved.
     2  // License: BSD 3-clause.
     3  // Website: https://github.com/CzarekTomczak/cef2go
     4  
     5  package gtk
     6  
     7  //#include "gtk/gtk.h"
     8  import "C"
     9  import "unsafe"
    10  
    11  //export _GoDestroySignal
    12  func _GoDestroySignal(widget *C.GtkWidget, data C.gpointer) {
    13      Logger.Println("_GoDestroySignal")
    14      ptr := uintptr(unsafe.Pointer(widget))
    15      if callback,ok := destroySignalCallbacks[ptr]; ok {
    16          delete(destroySignalCallbacks, ptr)
    17          callback()
    18      } else {
    19          Logger.Println("WARNING: _GoDestroySignal failed, callback not found")
    20      }
    21  }