summaryrefslogtreecommitdiff
path: root/implementation.md
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-14 20:03:02 -0400
committerPietro Gagliardi <[email protected]>2014-03-14 20:03:02 -0400
commita7f7ea1b8da51a19aaca7d5d989a28f0c9ecbf94 (patch)
treea054a7abea61eb6d9eb8bd16f807de99494d0d0e /implementation.md
parentaf7a218b473e8602ad818dbf9688efa5d3594648 (diff)
Major overhaul of the way GTK+ events are handled. Closures that perform events are no longer generated; instead all events are given to fixed, compile-time, cgo-exported callback functions that take the sysData as user data. This saves memory (we no longer need to generate closures and we no longer have to save them elsewhere to keep them from being garbage collected) and makes the top of sysdata_unix.go slightly cleaner, but it moves the code for handling UI events into callbacks_unix.go. This is needed for Area, in which we need to feed the sysData to an event connected to a subwidget instead of the main widget returned.
Diffstat (limited to 'implementation.md')
-rw-r--r--implementation.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/implementation.md b/implementation.md
index 895fa19..9fa1341 100644
--- a/implementation.md
+++ b/implementation.md
@@ -49,6 +49,8 @@ As the GTK+ main loop system does not quite run in a sane way (it allows recursi
GTK+ layout managers are not used since the UI library's layout managers are coded in a portable way. (`GtkFixed` is used instead.) This isn't ideal, but it works for now.
+All event handlers take the `sysData` as their user data parameter; this means all the event-handling code is stored in static functions in callbacks_unix.go. (Early versions of the package generated signal handlers for each control on the fly, but this needed to be changed to accommodoate Area, which not only needs the `sysData` but also needs to connect to a subwidget of a subwidget (specifically the subwidget of the `GtkViewport` of a `GtkScrolledWindow`); the current setup also avoids creating closures for each and every Window and Button created, and also means we can stop having to shove those callbacks in an ever-growing slice to prevent them from being garbage collected.)
+
The only major snag with the GTK+ implementation is the implementation of `Listbox`; see `listbox_unix.go` for details.
## Mac OS X