diff options
| author | Pietro Gagliardi <[email protected]> | 2014-06-25 11:39:06 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-06-25 11:39:06 -0400 |
| commit | e00eebf5803bfdc1b41600e4ceb181d074ec63c5 (patch) | |
| tree | b8772f518605e61828b30ef193d32fdb0f28beb9 /gtkcalls_unix.go | |
| parent | 3711953626dbc13ffb8631f9a3410a2e74423d14 (diff) | |
Split Label into a non-aligned standalone label and an aligned regular label. Implemented on GTK+. Now to write the test.
Diffstat (limited to 'gtkcalls_unix.go')
| -rw-r--r-- | gtkcalls_unix.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gtkcalls_unix.go b/gtkcalls_unix.go index 8f202b3..fdd3d61 100644 --- a/gtkcalls_unix.go +++ b/gtkcalls_unix.go @@ -247,8 +247,16 @@ func gtk_label_new() *C.GtkWidget { // there's a function gtk_label_set_justify() that indicates GTK_JUSTIFY_LEFT is the default // but this actually is NOT the control justification, just the multi-line justification // so we need to do THIS instead + // this will valign to the center, which is what the HIG says (https://developer.gnome.org/hig-book/3.4/design-text-labels.html.en) for all controls that label to the side; thankfully this means we don't need to do any extra positioning magic // this will also valign to the top // thanks to mclasen in irc.gimp.net/#gtk+ + C.gtk_misc_set_alignment((*C.GtkMisc)(unsafe.Pointer(label)), 0, 0.5) + return label +} + +func gtk_label_new_standalone() *C.GtkWidget { + label := gtk_label_new() + // this will valign to the top C.gtk_misc_set_alignment((*C.GtkMisc)(unsafe.Pointer(label)), 0, 0) return label } |
