如何将我的应用程序窗口之一保持在同一应用程序的其他窗口之上?

发布于 2024-09-11 07:13:40 字数 292 浏览 4 评论 0原文

我有一个基于 Motif 的类似记事本的遗留应用程序。

我希望无模式“查找/替换”对话框(这是一个 Motif TopLevelShell)始终位于我的应用程序的其他窗口之上,但不在其他应用程序之上。

我没有看到任何特定于 Motif 的设置来执行此操作。
KDE 允许我设置特定于窗口的行为,但我只能使“查找/替换”窗口保留在所有窗口的顶部,这是不对的。

强制我的应用程序窗口之一位于同一应用程序的其他窗口之上的正确方法是什么?有可能吗?有没有办法在 Motif 中做到这一点? KDE?我必须参加 X 电话吗?

I have a Motif-based notepad-like legacy application.

I would like the modeless "Find/Replace" dialog (which is a Motif TopLevelShell) to always stay on top of the other windows of my application, but not on top of other applications.

I don't see any Motif-specific setting to do this.
KDE allows me to set window-specific behavior, but I can only make the "Find/Replace" window stay on top of all windows, which isn't right.

What is the correct way to force one of my application windows to stay on top of the other windows of the same application? Is it possible at all? Is there a way to do it in Motif? KDE? Do I have to drop down to an X call?

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

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

发布评论

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

评论(2

岁月如刀 2024-09-18 07:13:40

如果您使用 DialogShell 那么此行为会自动发生。默认情况下,DialogShell 不是模态的,并且可以很好地打开文件和查找/替换。以下是 Motif 书中的一句话:

DialogShell 始终放置在拥有 DialogShell 父级的 shell 小部件之上。

第 5 章对对话框进行了很好的描述。

抱歉迟到了12年!

If you use a DialogShell then this behavior happens automatically. DialogShells are not modal by default, and do work well for file open and find/replace. Here is a quote from the Motif book:

A DialogShell is always placed on top of the shell widget that owns the parent of the DialogShell.

Dialogs are described well in chapter 5.

Sorry for being 12 years late!

揽清风入怀 2024-09-18 07:13:40

您可以将 KDialog http://api 子类化。 kde.org/4.x-api/kdelibs-apidocs/kdeui/classKDialog.html#10744dda705aa265a43becab32a43ea4

带有 Qt::WA_ShowModal 属性 http://doc.qt.nokia.com/4.0/qt.html#WindowType-enum

KDialog dialog(parent, Qt::WA_ShowModal)
dialog.exec()

也许这不是你想要的,但是.. 。

You can subclass KDialog http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/classKDialog.html#10744dda705aa265a43becab32a43ea4

with Qt::WA_ShowModal attribute http://doc.qt.nokia.com/4.0/qt.html#WindowType-enum

KDialog dialog(parent, Qt::WA_ShowModal)
dialog.exec()

Maybe it's not what you want, but ...

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