[wxpython-users] Change button border...?

raffaello barbarossa.platz at gmail.com
Tue May 27 11:54:39 PDT 2008


Just add, at the end of your two event handlers (MouseOver and MouseOut),
the instruction self.caller.Refresh(), and you'll get your border (I did).

BTW, the code repeats the same three instructions 198 times. Think of the
possibility of six =ABfor=BB loops, with the image names as parameters, a s=
imple
formula to calculate the positions, and 6 lists (reds[], blues[], green[],
yellows[], oranges[] and whites[]) for the button names. Apart from being
shorter, the program should faster to load.

2008/5/27 Trey K <trey.wxpython at gmail.com>:

> Okay, tried that. It didn't do anything, even after I took out the no
> border style.
> Check the new file:
> http://www.filecrunch.com/fileDownload.php?sub=3Dd4e6b136a9838eb3834222d5=
19fa25c5&fileId=3D151355
>
>
> On Tue, May 27, 2008 at 11:21 AM, raffaello <barbarossa.platz at gmail.com>
> wrote:
>
>> You could try using the controls in wx.lib.buttons instead of the current
>> button. Then, with GenBitmapButton, the method SetBezelWidth(pixels=3D3)
>> should yield the kind of border you need.
>> For further details look in Robin's book, or ask.
>>
>> 2008/5/27 Trey K <trey.wxpython at gmail.com>:
>>
>>>  Hey all,
>>>   I'm attempting to create a GUI for a rubik's cube solver, and I'm
>>> haaving a bit of trouble.
>>>
>>>   I need to change the border of a button once you hover over it (so th=
at
>>> you actually know that it's a button). I can't quite figure out the fun=
ction
>>> to set the style of the button.
>>>   Here's my current source code:
>>> http://www.filecrunch.com/fileDownload.php?sub=3D0fbb79811d7ba202a15bd1=
c77a00733c&fileId=3D151343
>>>
>>>   The "self.caller.SetStyle(style=3Dwx.NO_BORDER)" is the code causing =
an
>>> error, and I need to know what function to use to change the style.
>>>
>>> Thanks for any help.
>>>
>>> Note: I know that the border automatically pops up for the button when
>>> you hover over it in GNOME, but it won't in windows...
>>>
>>> _______________________________________________
>>> wxpython-users mailing list
>>> wxpython-users at lists.wxwidgets.org
>>> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
>>>
>>>
>>
>> _______________________________________________
>> wxpython-users mailing list
>> wxpython-users at lists.wxwidgets.org
>> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
>>
>>
>
> _______________________________________________
> wxpython-users mailing list
> wxpython-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200805=
27/0f7ee891/attachment.htm


More information about the wxpython-users mailing list