Skip to content

Instantly share code, notes, and snippets.

//! Creates Zig API mappings from "accesskit.h"
//! These should be pasted at the end of AccessKit.zig
//! Build with `zig build-exe main.zig -I. -lc`
const std = @import("std");
const builtin = @import("builtin");
const c = @cImport({
@cDefine("__APPLE__", {});
@cDefine("__linux__", {});
if (builtin.os.tag == .windows)
@cDefine("_WIN32", {});
@phatchman
phatchman / DropDownWidget.zig
Created July 20, 2025 03:01
Uses of code between init and install
if (self.menuItem.activeRect()) |r| {
self.drop = FloatingMenuWidget.init(@src(), .{ .from = r, .avoid = .none }, .{ .min_size_content = .cast(r.size()) });
var drop = &self.drop.?;
self.drop_first_frame = dvui.firstFrame(drop.data().id);
const s = drop.scale_val;
// move drop up to align first item
drop.init_options.from.x -= drop.options.borderGet().x * s;
drop.init_options.from.x -= drop.options.paddingGet().x * s;