Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8198293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:55:15+00:00 2026-06-07T05:55:15+00:00

I have a SpinCtrl on my window and want to process a spin event

  • 0

I have a SpinCtrl on my window and want to process a spin event only on mouse up or arrow key up (end of spinning). Because there is no event like this, I wanted to use a mouse event. But if I bind EVT_LEFT_DOWN and EVT_LEFT_UP, EVT_SPIN is not sent anymore and the control does nothing.

How can I perceive an end of spinning event with a SpinCtrl? Is it possible to call the default event handler on EVT_LEFT_DOWN and the other events?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:55:17+00:00Added an answer on June 7, 2026 at 5:55 am

    Who’s interested: I got a solution:

    class SpinEndEventManager(object):
        def __init__(self):
            self._controls = []
            self._event_handlers = []
            self._has_spinned = False
    
        def add(self, control, event_handler):
            self._controls.append(control)
            self._event_handlers.append(event_handler)
            control.Bind(wx.EVT_SPINCTRL, self._on_event)
            control.Bind(wx.EVT_LEFT_UP, self._on_event)
            control.Bind(wx.EVT_KEY_DOWN, self._on_event)
            control.Bind(wx.EVT_KEY_UP, self._on_event)
    
        def _on_event(self, event):
            is_spin_end_event = False
            event_type = event.GetEventType()
            control = event.GetEventObject()
            if event_type == wx.wxEVT_COMMAND_SPINCTRL_UPDATED:
                self._has_spinned = True
            elif event_type == wx.wxEVT_LEFT_UP:
                if self._has_spinned:
                    is_spin_end_event = True
                event.Skip()
            elif event_type == wx.wxEVT_KEY_DOWN:
                key = event.GetKeyCode()
                old_value = control.GetValue()
                if key == wx.WXK_UP:
                    value = old_value + 1
                elif key == wx.WXK_DOWN:
                    value = old_value - 1
                control.SetValue(value)
                value = control.GetValue()
                if value != old_value:
                    self._has_spinned = True
                if key == wx.WXK_DOWN:
                    value_string_length = len(str(value))
                    control.SetSelection(value_length, value_string_length)
            elif event_type == wx.wxEVT_KEY_UP:
                if self._has_spinned:
                    is_spin_end_event = True
            if is_spin_end_event:
                self._has_spinned = False
                index = self._controls.index(control)
                self._event_handlers[index](event)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have following listener for keyboard ArrowDown event(it's key code is 40 ): window.onload =
Have finally got a responsive site working (of a fashion). What I want to
have different files with same name, in different directories. In these files there are
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have a problem with agsXMPP. What I want to do, is connect to openfire
Have you seen library for flexible working with terminal(Unix like)? I want to implement
Have two UIBarButtonItems want to make it as one UIBarButtonItem and toggle between them
Have a table with 3 million rows and would like to partition it. There
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.