当前位置:网站首页>GtkD开发之路
GtkD开发之路
2022-08-10 05:29:00 【溴锑锑跃迁】
这些文章仅是记录我用GtkD做GUI的学习,当然,来访的各位可以借鉴看看(如果不嫌弃的话)。
1.配置开发环境
GtkD是基于D语言的GUI开发库,在我看来比较易用。
第一步,先配置好D语言的开发环境:
1.访问官网:https://dlang.org.下载并安装最新版的D语言安装程序。
/
安装完之后,在辗转去GtkD官网:https://gtkd.org/download.html。
下载Gtkd的压缩包和GTK+ Runtime安装包。
先安装Gtk+ Runtime。待安装之后,打开压缩包。
由于D语言2.077有一些小猫饼,所以,国外某大神改了一下Build.d的源代码。地址如下: https://github.com/gtkd-developers/GtkD/commit/9ac582dc0a7fa1ce958a15048b6bcc3ddbcad858 将代码直接替换Build.d中的代码就OK了。
我这里是Windows 7 32bit,如果也是用Windows的朋友可以参考官方的安装方法:https://github.com/gtkd-developers/GtkD/wiki/Installing-on-Windows。
在一切都配置好后,让我们来写段代码。
import gtk.MainWindow;
import gtk.Label;
import gtk.Main;
void main(string[] args)
{
Main.init(args);
MainWindow win = new MainWindow("Hello World");
win.setDefaultSize(200, 100);
win.add(new Label("Hello World"));
win.showAll();
Main.run();
}
将其保存在hello.d中,敲开命令行,输入:dmd hello.d -L+gtkd.lib
编译成功后,运行hello.exe
我们第一个用GtkD做的GUI程序已经成功运行了!
总体来说,如果去看看官方给的Win32开发会觉得还是老一套:注册、回调、消息循环……。希望有一种语言可以把这种GUI开发方式嵌入库中。寄希冀于Swift!!!
边栏推荐
- oracle cdc时,设置并行度2插槽数1,最终任务只有一个tm,是不是因为oracle不支持并发
- FPGA engineer interview questions collection 31~40
- CORS跨域资源共享漏洞的原理与挖掘方法
- OAuth2 usage scenarios, common misunderstandings, use cases
- flinkcdc 读取pgsql 的时间被放大了 有大佬知道咋回事吗 gmt_create':1
- Arduino框架下合宙ESP32C3 +1.8“tft 网络时钟
- Become a language that hackers have to learn. Do you think it's okay after reading it?
- 抽象问题方法论
- OAuth2的使用场景、常见误区、使用案例
- Mysql CDC (2.1.1) inital snapshot database set up five concurrent degree, se
猜你喜欢
How to use Apifox's Smart Mock function?
MongoDB 基础了解(一)
Stacks and Queues | Valid parentheses, delete all adjacent elements in a string, reverse Polish expression evaluation, maximum sliding window, top K high frequency elements | leecode brush questions
Conda creates a virtual environment method and pqi uses a domestic mirror source to install a third-party library method tutorial
Qiskit学习笔记(三)
Talk about API Management - Open Source Edition to SaaS Edition
SSM框架整合实例
Depth of carding: prevent model fitting method
Jenkins 如何玩转接口自动化测试?
一篇文章掌握整个JVM,JVM超详细解析!!!
随机推荐
scikit-learn机器学习 读书笔记(二)
如何取得某月的最后一天
SQLSERVER 2008 parses data in Json format
MySQL simple tutorial
Practical skills 19: Several postures of List to Map List
二进制中负数为何要用补码形式来表示——二进制加减法
从GET切换为POST提交数据的方法
顺序表的删除,插入和查找操作
MySql之json_extract函数处理json字段
一文带你搞懂OAuth2.0
SQL database field to append to main table
每周推荐短视频:探索AI的应用边界
并发工具类——CountDownLatch、CyclicBarrier、Semaphore、Exchanger的介绍与使用
[Thesis Notes] Prototypical Contrast Adaptation for Domain Adaptive Semantic Segmentation
Shield Alt hotkey in vscode
请教一下各位大佬。CDC社区中FlinkCDC2.2.0版本有说明支持的sqlserver版本 ,请
How does flinksql write that the value of redis has only the last field?
FPGA engineer interview questions collection 1~10
Rpc接口压测
mysql常用命令有什么