You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating system: Windows 10, 20H2 build 19042.928 wxPython version & source: 4.1.1 pypi Python version & source: 3.9.1 stock
Description of the problem:
Want to change button background color when mouse cursor is over the button to "yellow" and to "green" when mouse cursor is moved off of the button.
Using wx.EVT_ENTER_WINDOW to change button background color to "yellow" and wx.EVT_LEAVE_WINDOW to change background color to "green".
Below is simple code used to test behavior. Noticed that when mouse was over the button, background color didn't change to yellow but when mouse cursor was moved off of the button, background color changed to green as expected. Added SetLabel to display "INSIDE" when cursor was over the button to see if EVT_ENTER_WINDOW was getting fired. Running the code, found that INSIDE is displayed when cursor is over the button so EVT_ENTER_WINDOW is getting triggered but background color doesn't change. Moving cursor off of the button, OUTSIDE is displayed and button background color changes to green as expected. EVT_LEAVE_WINDOW event is working as expected. Since EVT_ENTER_WINDOW is fired, button background color should be yellow when cursor is over the button. Noticed that when cursor is over the button and left mouse button is down, button color changes to yellow and will remain yellow as long as left mouse button is held down. When lifted up, color changes to default color.
Operating system: Windows 10, 20H2 build 19042.928
wxPython version & source: 4.1.1 pypi
Python version & source: 3.9.1 stock
Description of the problem:
Want to change button background color when mouse cursor is over the button to "yellow" and to "green" when mouse cursor is moved off of the button.
Using wx.EVT_ENTER_WINDOW to change button background color to "yellow" and wx.EVT_LEAVE_WINDOW to change background color to "green".
Below is simple code used to test behavior. Noticed that when mouse was over the button, background color didn't change to yellow but when mouse cursor was moved off of the button, background color changed to green as expected. Added SetLabel to display "INSIDE" when cursor was over the button to see if EVT_ENTER_WINDOW was getting fired. Running the code, found that INSIDE is displayed when cursor is over the button so EVT_ENTER_WINDOW is getting triggered but background color doesn't change. Moving cursor off of the button, OUTSIDE is displayed and button background color changes to green as expected. EVT_LEAVE_WINDOW event is working as expected. Since EVT_ENTER_WINDOW is fired, button background color should be yellow when cursor is over the button. Noticed that when cursor is over the button and left mouse button is down, button color changes to yellow and will remain yellow as long as left mouse button is held down. When lifted up, color changes to default color.
Code Example (click to expand)
The text was updated successfully, but these errors were encountered: