Vann
Vann

Reputation: 29

Scrolling with wxwidgets

good day,

I have made the scrollbar visible on my panel, but for the life of me I do not know how to capture the scroll events. How is this done? im using versio 2.8.

Even with wxScrolledWindow the scrollbar is visible but how does one get the event and then process it?

I have tried using connect() and no luck. Pleas point me to an example.

Thanks

Upvotes: 1

Views: 2728

Answers (1)

VZ.
VZ.

Reputation: 22688

Several points:

  1. Using wxScrolledWindow is different from using the individual, standalone, wxScrollBar controls. To capture events for the former, you use wxEVT_SCROLLWIN_XXX events and the corresponding event macros, while for the latter you use wxEVT_SCROLL_XXX.
  2. Typically you should be using wxScrolledWindow which takes care of scrolling automatically, i.e. you rarely need to catch any events, are you sure you really need to do this?
  3. Look at the scroll sample for many examples of using different scrolled windows if you hadn't already.
  4. Do yourself a favour and switch to a supported 3.0 version instead of a decade old 2.8, there is really no reason to start a new project using 2.8 nowadays.

Upvotes: 3

Related Questions