GUI 构建器如何工作?

发布于 2024-07-23 15:27:54 字数 100 浏览 2 评论 0原文

我很好奇,GUI 构建器/设计器是如何工作的? 我的猜测(对于 Java),它实际上创建了一个 JFrame 并以某种方式覆盖了事件。 然而,这只是一个猜测。 您能提供一些见解吗?

I'm curious, how does a GUI builder/designer work? My guess ( for Java ), is that it actually creates a JFrame and overrides the events in some way. However, this is only a guess.
Can you offer some insight?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

隐诗 2024-07-30 15:27:54

你太棒了......

Glade 中,允许你拖放组件的假窗口处理你的鼠标/键盘事件并进​​行后端调用以将 GUI 元素放置到位。 然后,这些元素被附加到处理程序,例如“单击按钮,转到源元素”。

当您仔细考虑时,这一切都非常微不足道。

查看林间空地来源可能会让您深入了解这是如何完成的。

IIRC,Glade 编写 XML,然后使用 libglade 将其呈现给设计者,而不是您实际创建元素。 您的事件构建包含 UI 元素和内部设计器处理程序的 XML 文件。

祝你好运

You are pretty much bang on ...

In Glade the fake-window that allows you to drag-and-drop components handles your mouse/keyboard events and makes the backend calls to put the GUI elements in place. These elements are then attached to handlers such as 'on click of button, goto the source element'

It is all pretty trivial when you think about it.

Looking at the glade source might give some insight into how that is done.

IIRC, Glade writes the XML and then renders that to the designer using libglade, rather than your d'n'ds actually creating the elements. Your events build XML files which contain the UI elements and internal designer handlers.

Good Luck

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