DVUI

moveTo

Moves the mouse to the center of the widget

Parameters

#
tag:[]const u8
[]const u8

Source

Implementation

#
pub fn moveTo(tag: []const u8) !void {
    const tag_data = dvui.tagGet(tag) orelse {
        std.debug.print("tag \"{s}\" not found\n", .{tag});
        return error.TagNotFound;
    };
    if (!tag_data.visible) return error.WidgetNotVisible;
    const cw = dvui.currentWindow();
    _ = try cw.addEventMouseMotion(.{ .pt = tag_data.rect.center() });
}