gpt4 book ai didi

linux - Motif:如何在没有用户干预的情况下自动移动滚动条

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:18:46 27 4
gpt4 key购买 nike

我的应用程序中有一个滚动窗口,我在其中创建了一个绘图区域小部件。在绘图区,我放置了多张图片。当用户在搜索框中输入有关图像的信息时,相应的图像会突出显示。

我的问题是如何在用户不使用滚动条的情况下让应用程序自动滚动到突出显示的图像框。滚动窗口应自动移动 View 区域,以显示突出显示的图像所在的区域。

滚动窗口使用的滚动策略是XmAUTOMATIC。

如有任何指点,我们将不胜感激。在此先致谢。

最佳答案

尝试 XmScrollVisible() 如果这不起作用,那么您将需要:

1. Find out the size of the work area.
2. Find out the size and position of the clip window.
3. Find out the max/ min values for the horizontal scrollbar.
4. Use XmScrollBarGetValues() for the horizontal scrollbar to get its position within the max/min values.
5. Do some math magic to determine how much to move the horizontal scrollbar to get the work area to show through the clip window.
6. Call XmScrollBarSetValues() with Notify = True.
7. Repeat for the Vertical scrollbar.

HTH

关于linux - Motif:如何在没有用户干预的情况下自动移动滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25915628/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com