上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: 如果全部使用C代码构建用户界面,当组件成百上千时,这将是一场灾难。因此Gtk使用xml进行配置用户界面。 示例如下: ```c #include #include static void print_hello (GtkWidget *widget, gpointer data) { g_print 阅读全文
posted @ 2023-09-04 23:18 NotReferenced 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 如果想要自定义绘制图案,可以使用`GtkDrawingArea`组件实现。 示例如下: ```c #include /* Surface to store current scribbles */ static cairo_surface_t *surface = NULL; static void 阅读全文
posted @ 2023-09-04 22:27 NotReferenced 阅读(87) 评论(0) 推荐(0) 编辑
摘要: GTK提供了许多不同的容器组件,用户可以通过搭配不同的容器组件来控制子组件的布局方式。 容器组件如下: + GtkBox + GtkGrid + GtkRevealer + GtkStack + GtkOverlay + GtkPaned + GtkExpander + GtkFixed # 1、G 阅读全文
posted @ 2023-08-15 23:08 NotReferenced 阅读(267) 评论(0) 推荐(0) 编辑
摘要: Application ID一般是使用倒置的域名,如org.gnome.gedit。 # 1、App id的使用场景 + 作为GtkApplication或者GApplication的入参,每个应用程序应该由唯一的App Id,这个App Id可以用来传递消息; + 在D-Bus中使用,App id 阅读全文
posted @ 2023-08-09 13:28 NotReferenced 阅读(77) 评论(0) 推荐(0) 编辑
摘要: # 1、下载MSYS2 从[MSYS2](https://www.msys2.org/ "MSYS2")中下载安装包,并安装MSYS2。 ![image](https://img2023.cnblogs.com/blog/2414603/202308/2414603-2023080723115002 阅读全文
posted @ 2023-08-08 13:39 NotReferenced 阅读(528) 评论(0) 推荐(0) 编辑
摘要: vscode报错如下: ![image](https://img2023.cnblogs.com/blog/2414603/202308/2414603-20230807224059479-103926527.png) 报错原因是因为vscode找不到头文件导致的。 **解决办法:** 在`sett 阅读全文
posted @ 2023-08-07 22:45 NotReferenced 阅读(98) 评论(0) 推荐(0) 编辑
摘要: # 1、安装 到[MinGW](https://github.com/niXman/mingw-builds-binaries/releases "MinGW")下载最新的安装包 ![image](https://img2023.cnblogs.com/blog/2414603/202308/241 阅读全文
posted @ 2023-08-07 22:30 NotReferenced 阅读(128) 评论(0) 推荐(0) 编辑
摘要: # 1、依赖 + 安装zlib库 ```shell ## 运行下述命令安装zlib $ yum install -y zlib $ cp /usr/local/lib64/libz.so /usr/lib64 ``` + 安装meson ```shell $ yum install -y meson 阅读全文
posted @ 2023-08-01 19:56 NotReferenced 阅读(165) 评论(0) 推荐(0) 编辑
摘要: # 1、可变参数函数定义 必需显式定义至少一个参数,不能直接定义`...`。 ```c LOCAL void reset_param(guint num, ...) {} ``` 一般来说,第一个参数传入可变参数的个数。 # 2、可变参数的使用 需要用到`stdarg.h`中的1个结构体和3个宏定义 阅读全文
posted @ 2023-07-31 23:09 NotReferenced 阅读(8) 评论(0) 推荐(0) 编辑
摘要: > 多个dir之间需要用`:`分隔 使用`-Wl,-rpath,path`添加运行时库路径,如果不加这个属性,那么可能会无法打开库文件: ```shell gcc -o main main.c -Wl,-rpath,/usr/test -L/usr/test -ltest ``` 阅读全文
posted @ 2023-07-30 18:33 NotReferenced 阅读(82) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 下一页