I would like to create a button that I can control the look of the button using pyGTK. How would I go about doing this?
I would like to be able to point to a new image for each ‘state’ the button is in (i.e. Pressed, mouse over, normal…etc.)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
As described in the API documentation for
gtk.Image, “If you want to receive events on the image, such as button clicks, place the image inside a gtk.EventBox, then connect to the event signals on the event box.”.You probably want to use a
gtk.Imagerather than agtk.Button, since buttons require more knowledge of how the theming engine works. If you really want to use a button, you’ll need to read up on gtk rc files and the APIs for manipulating them.