创建可以超越窗口区域的弹出窗口 [英] Create popover that can overpass window area

查看:63
本文介绍了创建可以超越窗口区域的弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个小窗口应用程序(50x50px),其中只有一个图像.当您单击图像时,会出现一个popover(GtkPopover),但它不能越过窗口边界,只显示一部分.

There is a small window application (50x50px) with only one image inside of it. When you click the image, a popover(GtkPopover) appears, but it cannot overpass the window borders and only part of it is shown.

如何在不调整窗口大小的情况下解决此问题?

How could I solve this issue without resizing the window?

推荐答案

X11下GTK中的Popovers不能扩展到它们所属的顶级窗口之外,因为它们没有使用单独的窗口系统表面;如果它们确实像菜单一样,即使在其外部单击也将无法保持打开状态.

Popovers in GTK under X11 cannot extend outside of the top-level window they belong to, because they do not use a separate windowing system surface; if they did, like menus, they would not be able to remain open even when clicking outside of them.

无法在GTK3中解决此问题,请参阅:

This cannot be fixed in GTK3, see:

您必须使用Wayland,或者必须确保窗口​​足够大以显示弹出窗口.

You must use Wayland, or you must ensure that your window is big enough to display your popover.

您可能还想使用 gtk_popover_set_position()

You also probably want to use gtk_popover_set_position(), gtk_popover_set_pointing_to(), or gtk_popover_set_constrain_to() to ensure that your popover always opens within the window surface, instead of outside.

这篇关于创建可以超越窗口区域的弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆