vanilla icon indicating copy to clipboard operation
vanilla copied to clipboard

add support for titlebar accessory views

Open typemytype opened this issue 3 years ago • 1 comments

example:

import vanilla
import AppKit

def callback(sender):
    print("hit")

button = vanilla.Button((0, 0, 100, 22), "A Button!", callback=callback, sizeStyle="small")
button.getNSButton().setFrame_(((0, 0), (150, 22)))


w = vanilla.Window((400, 400))

titlebarController = AppKit.NSTitlebarAccessoryViewController.alloc().init()
titlebarController.setView_(button.getNSButton())
titlebarController.setLayoutAttribute_(AppKit.NSLayoutAttributeRight)

w.getNSWindow().addTitlebarAccessoryViewController_(titlebarController)

w.open()

typemytype avatar Nov 22 '22 13:11 typemytype