构建轻量级跨平台文本编辑器的方法
我计划构建一个简单、轻量级的文本编辑器,将美观的外观与以键盘为中心的输入相结合。
我希望对抗锯齿和所有图形等内容有很多控制,但我不关心拥有整个小部件库。 几乎整个用户界面将基于文本并位于应用程序的主画布/窗口中。
- 像 GTK 和 Qt 这样的工具包似乎有些过分了——大量我不需要的小部件和复杂的代码库。
- Titanium、AIR 和 XULRunner 在某些方面甚至更大 - 开发速度会很快,但这并不完全是轻量级方法。
- 鞋子看起来几乎完美合身,但它有点太小并且不支持足够的事件(例如,无法调整窗口大小)。
您认为我应该在 Cairo/Pango 或其他图形库上构建它并自己滚动特定于平台的东西吗? 我宁愿使用某种框架。
基本上我想要的是:
- 良好的事件处理
- 窗口
- 菜单
- 绘制与真正伟大的类型渲染选择
我希望从一开始就构建这个跨平台。
I'm planning to build a simple, lightweight text editor that combines a great look with keyboard focused input.
I want to have a lot of control over things like antialiasing and all the graphics in general, but I don't care about having a whole library of widgets. Almost the entire UI will be text-based and in the main canvas/window of the app.
- Toolkits like GTK and Qt seem like overkill - tons of widgets I don't need and a complex codebase.
- Titanium, AIR, and XULRunner are even bigger in some ways - dev would be quick, but that's not exactly the lightweight approach.
- Shoes seemed like a nearly perfect fit, but it's a little too small and doesn't support enough events (e.g. no window resize).
What do you think, should I just build it on Cairo/Pango or another graphics library and roll the platform specific stuff myself? I'd rather use a framework of some kind.
Basically all I want is:
- good event handling
- windowing
- menus
- drawing with really great type rendering choices
I would love to build this cross-platform from the start.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
即使您只使用 Cairo/Pango,您仍然需要屏幕上的窗口。
最简单的组合是 cairo + pango + GDK(GTK+ 的窗口部分)
但即使在这种情况下,你也没有菜单,并且用纯开罗构建菜单
这将是一项艰巨的(但并非不可能)的成就。
如果您坚持轻量级和跨平台,请检查以下
Even if you use just Cairo/Pango you still need windows on the screen.
The simplest combination would be cairo + pango + GDK (the windowing part of GTK+)
however even in that case you have no menus, and constructing menus with pure Cairo
would be a tough (but not impossible) accomplishment.
If you insist on lightweight and crossplatform then check the following
Scintilla 是一个跨平台的源代码编辑组件(基于 GTK+),对语法高亮、代码折叠、文本缩放,当然还有所有常用的文本编辑功能; 它应该是文本编辑器的良好基础。
Scintilla is a cross-platfrom source code editing component (based on GTK+) with excellent support for syntax highlighting, code folding, text zooming, and of course all the usual text editing functions; it should be an excellent foundation for a text editor.