Capy 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
Capy 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
Capy 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 MIT
开发语言 HTML/CSS
操作系统 跨平台
软件类型 开源软件
所属分类 程序开发GUI开发框架
开源组织
地区 不详
投 递 者 白开水不加糖
适用人群 未知
收录时间 2022-08-02

软件简介

Capy 是一个用于在 Zig 中制作真正的原生 GUI 的跨平台库。目前,Capy 尚在积极开发中,还没有准备好应用于生产。

Capy 主要用于使用操作系统的本地控件来创建应用程序。它是一个声明式的 UI 库,旨在使其易于编写并具有多样性。目标是为独立的 UI 应用提供支持,在游戏或任何其他渲染过程中的集成是一个非目标。

const capy = @import("capy");
const std = @import("std");

pub fn main() !void {
    try capy.backend.init();

    var window = try capy.Window.init();
    try window.set(
        capy.Column(.{ .spacing = 10 }, .{ // have 10px spacing between each column's element
            capy.Row(.{ .spacing = 5 }, .{ // have 5px spacing between each row's element
                capy.Button(.{ .label = "Save", .onclick = buttonClicked }),
                capy.Button(.{ .label = "Run",  .onclick = buttonClicked })
            }),
            // Expanded means the widget will take all the space it can
            // in the parent container
            capy.Expanded(
                capy.TextArea(.{ .text = "Hello World!" })
            )
        })
    );

    window.resize(800, 600);
    window.show();
    capy.runEventLoop();
}

fn buttonClicked(button: *capy.Button_Impl) !void {
    std.log.info("You clicked button with text {s}", .{button.getLabel()});
}
展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击加入讨论🔥(1) 发布并加入讨论🔥
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
1 评论
4 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部