简体   繁体   English

拦截wxListCtrl滚动事件

[英]Intercept wxListCtrl scroll events

I'm using wxWidgets 2.8 on a Linux box. 我在Linux机器上使用wxWidgets 2.8。

I'd like to get notifications of scroll events from wxListCtrl (or wxListView ). 我想从wxListCtrl (或wxListView )获取滚动事件的通知。 Basically I want to be notified when someone uses the scrollbars. 基本上,我想在有人使用滚动条时收到通知。

I tried with EVT_SCROLLWIN and EVT_SCROLL without success. 我尝试使用EVT_SCROLLWINEVT_SCROLL失败。

Can someone provide me some sample code? 有人可以给我一些示例代码吗?

Unfortunately I cannot find any documentation/sample about this topic. 不幸的是,我找不到有关此主题的任何文档/样本。 Any pointer? 有指针吗?

I need to intercept this event because I'm using a wxListView under MOTIF (sic) and when I scroll the list, the new items are not redrawn (basically I see the list empty until I click an item). 我需要拦截此事件,因为我在MOTIF(sic)下使用wxListView ,并且在滚动列表时,不会重新绘制新项(基本上,在单击某项之前,我看到列表为空)。 So, my hack would be to call wxWindow::Redraw() after a scroll. 因此,我的技巧是滚动后调用wxWindow::Redraw() Any alternative solution to my original problem? 有什么其他解决方案可以解决我原来的问题?

Thanks. 谢谢。

You won't get scroll events for what can be (even if it is not in wxGTK, actually) a native control, this is just not something that wxWidgets guarantees because it is very difficult (and maybe impossible) to implement in general. 您不会获得可能是本机控件的滚动事件(即使实际上不在wxGTK中),这也不是wxWidgets保证的,因为通常很难(甚至不可能)实现。

Sorry. 抱歉。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM