diff options
| author | Pietro Gagliardi <[email protected]> | 2014-03-15 14:27:18 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-03-15 14:27:18 -0400 |
| commit | e429b8d6b82f6caf9301e9917e96d7f823dd90bd (patch) | |
| tree | 6322c374460fe1b24debcd9ac61197de8141f0b6 /implementation.md | |
| parent | 05905e3addd522b7c7d41a4ac6cfefbef52ab546 (diff) | |
Allowed GTK+ windows to be resized smaller than the size request of the controls within.
Diffstat (limited to 'implementation.md')
| -rw-r--r-- | implementation.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/implementation.md b/implementation.md index 2bd4232..800ce3a 100644 --- a/implementation.md +++ b/implementation.md @@ -47,7 +47,7 @@ GTK+ is strange: there are constructor functions that return `GtkWidget *`, but As the GTK+ main loop system does not quite run in a sane way (it allows recursion, and the `gtk_main_loop_iteration_do` function only onperates on the innermost call), we cannot use the `for`/`select` template for `ui()`. Fortunately, GDK provides gdk_threads_add_idle(), which allows us to run, and optionally (and importantly) run only once, a function on the `gtk_main()` thread when not processing events. We use this, combined with a goroutine for dispatching, to handle `uitask` requests. See `our_idle_callback` in callbacks_unix.go for details. -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. +GTK+ layout managers are not used since the UI library's layout managers are coded in a portable way. (A `GtkLayout` in a `GtkScrolledWindow` is used instead. This is done instead of just a `GtkFixed` so that a window can be resized smaller than the size requests of its contents.) 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.) Should the widget actually be a child widget of a `GtkScrolledWindow`, the `child` function and `childsigs` signal list are used to assign signals as well. |
