diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-02 10:05:53 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-02 10:05:53 -0400 |
| commit | 982004d05052ef6aadd22dd5c4e7dbca85ab324a (patch) | |
| tree | 517a0f5a5397e6fb886b5e4741aff4fa18ba10d8 /button_windows.go | |
| parent | 09db0bffffded1a68c562b2d6451c2a2b29ac279 (diff) | |
go fmt. Precursor to bug report filing.
Diffstat (limited to 'button_windows.go')
| -rw-r--r-- | button_windows.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/button_windows.go b/button_windows.go index 2634935..38e43d5 100644 --- a/button_windows.go +++ b/button_windows.go @@ -10,20 +10,20 @@ import ( import "C" type button struct { - _hwnd C.HWND - _textlen C.LONG - clicked *event + _hwnd C.HWND + _textlen C.LONG + clicked *event } var buttonclass = toUTF16("BUTTON") func newButton(text string) *button { hwnd := C.newControl(buttonclass, - C.BS_PUSHBUTTON | C.WS_TABSTOP, + C.BS_PUSHBUTTON|C.WS_TABSTOP, 0) b := &button{ - _hwnd: hwnd, - clicked: newEvent(), + _hwnd: hwnd, + clicked: newEvent(), } b.SetText(text) C.controlSetControlFont(b._hwnd) @@ -78,13 +78,13 @@ func (b *button) preferredSize(d *sizing) (width, height int) { // comctl32.dll version 6 thankfully provides a method to grab this... var size C.SIZE - size.cx = 0 // explicitly ask for ideal size + size.cx = 0 // explicitly ask for ideal size size.cy = 0 if C.SendMessageW(b._hwnd, C.BCM_GETIDEALSIZE, 0, C.LPARAM(uintptr(unsafe.Pointer(&size)))) != C.FALSE { return int(size.cx), int(size.cy) } // that failed, fall back -println("message failed; falling back") + println("message failed; falling back") // don't worry about the error return from GetSystemMetrics(); there's no way to tell (explicitly documented as such) xmargins := 2 * int(C.GetSystemMetrics(C.SM_CXEDGE)) return xmargins + int(b._textlen), fromdlgunitsY(buttonHeight, d) |
