构建轻量级跨平台文本编辑器的方法

发布于 2024-07-16 14:27:35 字数 508 浏览 6 评论 0原文

我计划构建一个简单、轻量级的文本编辑器,将美观的外观与以键盘为中心的输入相结合。

我希望对抗锯齿和所有图形等内容有很多控制,但我不关心拥有整个小部件库。 几乎整个用户界面将基于文本并位于应用程序的主画布/窗口中。

  • 像 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梅窗月明清似水 2024-07-23 14:27:35

即使您只使用 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

谷夏 2024-07-23 14:27:35

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文