<commit_before>local guitk   = require("hs._asm.guitk")
local image   = require("hs.image")
local inspect = require("hs.inspect")

local finspect = function(...) return (inspect({...}):gsub("%s+", " ")) end

local module = {}

local display = guitk.new{ x = 100, y = 100, h = 100, w = 100 }:show()
local manager = guitk.manager.new():passthroughCallback(function(...) print(finspect(...)) end)
display:contentManager(manager)

local types = {
    "momentaryLight",
    "toggle",
    "switch",
    "radio",
    "momentaryChange",
    "multiLevelAccelerator",
    "onOff",
    "pushOnPushOff",
    "accelerator",
    "momentaryPushIn"
}

for i, v in ipairs(types) do
    manager:add(guitk.element.button.buttonType(v):title(v), true)
end

local elements = manager:elements()
local location = manager:elementLocation(elements[#elements])

manager:add(guitk.element.button.buttonWithImage(image.imageFromName(image.systemImageNames.ApplicationIcon)), { x = 0, y = location.y + 2 * location.h })
manager:add(guitk.element.button.buttonWithTitle("buttonWithTitle"))
manager:add(guitk.element.button.buttonWithTitleAndImage("buttonWithTitleAndImage", image.imageFromName(image.systemImageNames.ApplicationIcon)))
manager:add(guitk.element.button.checkbox("checkbox"))
manager:add(guitk.element.button.radioButton("radioButton"))

manager:shrinkToFit(20, 10)

module.manager = manager

return module<commit_msg>tests<commit_after>local guitk   = require("hs._asm.guitk")
local image   = require("hs.image")
local inspect = require("hs.inspect")

local finspect = function(...) return (inspect({...}):gsub("%s+", " ")) end

local module = {}

local display = guitk.new{ x = 100, y = 100, h = 100, w = 100 }:show():passthroughCallback(function(...) print(finspect(...)) end)
local manager = guitk.manager.new()
display:contentManager(manager)

local types = {
    "momentaryLight",
    "toggle",
    "switch",
    "radio",
    "momentaryChange",
    "multiLevelAccelerator",
    "onOff",
    "pushOnPushOff",
    "accelerator",
    "momentaryPushIn"
}

for i, v in ipairs(types) do
    manager:add(guitk.element.button.buttonType(v):title(v):alternateTitle("not " .. v), true)
end

local elements = manager:elements()
local location = manager:elementLocation(elements[#elements])

manager:add(guitk.element.button.buttonWithImage(image.imageFromName(image.systemImageNames.ApplicationIcon)), { x = 0, y = location.y + 2 * location.h })
manager:add(guitk.element.button.buttonWithTitle("buttonWithTitle"))
manager:add(guitk.element.button.buttonWithTitleAndImage("buttonWithTitleAndImage", image.imageFromName(image.systemImageNames.ApplicationIcon)))
manager:add(guitk.element.button.checkbox("checkbox"))
manager:add(guitk.element.button.radioButton("radioButton"))

local manager2 = guitk.manager.new()
manager2:add(guitk.element.button.radioButton("A"))
manager2:add(guitk.element.button.radioButton("B"))
manager2:add(guitk.element.button.radioButton("C"))
manager:add(manager2, true):elementLocation(manager2, { x = 200, y = 200 })

manager:sizeToFit(20, 10)

module.manager  = manager
module.manager2 = manager2

return module
{'fraction_non_alphanumeric': 0.1591928251121076, 'fraction_numerical': 0.016015374759769378, 'mean_word_length': 5.818777292576419, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '329814', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1027, 'n_words': 174}