github.com/secoba/wails/v2@v2.6.4/internal/frontend/desktop/windows/winc/label.go (about)

     1  //go:build windows
     2  
     3  /*
     4   * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
     5   */
     6  
     7  package winc
     8  
     9  import (
    10  	"github.com/secoba/wails/v2/internal/frontend/desktop/windows/winc/w32"
    11  )
    12  
    13  type Label struct {
    14  	ControlBase
    15  }
    16  
    17  func NewLabel(parent Controller) *Label {
    18  	lb := new(Label)
    19  
    20  	lb.InitControl("STATIC", parent, 0, w32.WS_CHILD|w32.WS_VISIBLE|w32.SS_LEFTNOWORDWRAP)
    21  	RegMsgHandler(lb)
    22  
    23  	lb.SetFont(DefaultFont)
    24  	lb.SetText("Label")
    25  	lb.SetSize(100, 25)
    26  	return lb
    27  }
    28  
    29  func (lb *Label) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
    30  	return w32.DefWindowProc(lb.hwnd, msg, wparam, lparam)
    31  }