I’m trying to change the color of a button when is pressed or when the mouse is over it, but i just don´t figure out how to do. Could you, kind people help me with this?. I’m so new in all of this an sometimes get pretty lost. PS, sorry for my english, i’m relatively new there too.
The possibility of doing this will depend on platform, as some native widgets will not allow their colors to be changed. If that’s an issue for you then you can use the generic button classes in the wx.lib.buttons module. In general, doing something like this can be accomplished by catching the appropriate mouse events (EVT_MOTION and possibly EVT_ENTERWINDOW/EVT_LEAVE_WINDOW for starters) for the widget, calling its SetBackroundColour in the event handler as needed.
···
On Tuesday, April 3, 2018 at 11:44:48 AM UTC-7, Manuel Pérez wrote:
I’m trying to change the color of a button when is pressed or when the mouse is over it, but i just don´t figure out how to do. Could you, kind people help me with this?. I’m so new in all of this an sometimes get pretty lost. PS, sorry for my english, i’m relatively new there too.
Oh Tank You, it was very useful. Really helped me, hope someday back the favor
···
Sent from Mail for Windows 10
From: Robin Dunn
Sent: Tuesday, April 3, 2018 4:00 PM
To: wxPython-users
Subject: [wxPython-users] Re: I can´t change the background colour in a widget when i pass the mouse over the button
The possibility of doing this will depend on platform, as some native widgets will not allow their colors to be changed. If that’s an issue for you then you can use the generic button classes in the wx.lib.buttons module. In general, doing something like this can be accomplished by catching the appropriate mouse events (EVT_MOTION and possibly EVT_ENTERWINDOW/EVT_LEAVE_WINDOW for starters) for the widget, calling its SetBackroundColour in the event handler as needed.
On Tuesday, April 3, 2018 at 11:44:48 AM UTC-7, Manuel Pérez wrote:
I’m trying to change the color of a button when is pressed or when the mouse is over it, but i just don´t figure out how to do. Could you, kind people help me with this?. I’m so new in all of this an sometimes get pretty lost. PS, sorry for my english, i’m relatively new there too.
–
You received this message because you are subscribed to the Google Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.