本文整理匯總了Golang中github.com/google/gxui.Driver.CreateWindowedViewport方法的典型用法代碼示例。如果您正苦於以下問題:Golang Driver.CreateWindowedViewport方法的具體用法?Golang Driver.CreateWindowedViewport怎麽用?Golang Driver.CreateWindowedViewport使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/google/gxui.Driver
的用法示例。
在下文中一共展示了Driver.CreateWindowedViewport方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Init
func (w *Window) Init(outer WindowOuter, driver gxui.Driver, width, height int, title string) {
w.Attachable.Init(outer)
w.BackgroundBorderPainter.Init(outer)
w.Container.Init(outer)
w.Paddable.Init(outer)
w.PaintChildren.Init(outer)
w.outer = outer
w.driver = driver
w.onClose = gxui.CreateEvent(func() {})
w.onResize = gxui.CreateEvent(func() {})
w.onMouseMove = gxui.CreateEvent(func(gxui.MouseEvent) {})
w.onMouseEnter = gxui.CreateEvent(func(gxui.MouseEvent) {})
w.onMouseExit = gxui.CreateEvent(func(gxui.MouseEvent) {})
w.onMouseDown = gxui.CreateEvent(func(gxui.MouseEvent) {})
w.onMouseUp = gxui.CreateEvent(func(gxui.MouseEvent) {})
w.onMouseScroll = gxui.CreateEvent(func(gxui.MouseEvent) {})
w.onKeyDown = gxui.CreateEvent(func(gxui.KeyboardEvent) {})
w.onKeyUp = gxui.CreateEvent(func(gxui.KeyboardEvent) {})
w.onKeyRepeat = gxui.CreateEvent(func(gxui.KeyboardEvent) {})
w.onKeyStroke = gxui.CreateEvent(func(gxui.KeyStrokeEvent) {})
w.onClick = gxui.CreateEvent(func(gxui.MouseEvent) {})
w.onDoubleClick = gxui.CreateEvent(func(gxui.MouseEvent) {})
w.focusController = gxui.CreateFocusController(outer)
w.mouseController = gxui.CreateMouseController(outer, w.focusController)
w.keyboardController = gxui.CreateKeyboardController(outer)
w.onResize.Listen(func() {
w.outer.LayoutChildren()
w.Draw()
})
w.SetBorderPen(gxui.TransparentPen)
w.setViewport(driver.CreateWindowedViewport(width, height, title))
// Window starts shown
w.Attach()
// Interface compliance test
_ = gxui.Window(w)
}