help creating my own button

hi i try to know how make a button try to copy from the platebutton
the only that i need is know how make that change when the cursor is
over it and when is presssed if some one can help me here i leave the
source

http://www.megaupload.com/?d=342LIPGM

Hi,

hi i try to know how make a button try to copy from the platebutton
the only that i need is know how make that change when the cursor is
over it and when is presssed if some one can help me here i leave the
source

If you are just trying to create a simple button you may find the
GenButton classes in the buttons module easier to learn from.
PlateButton does alot of other stuff to try and ensure transparency
support between different platforms which complicates its code
somewhat.

Anyway, your control should Bind to EVT_LEFT_DOWN, EVT_LEFT_UP,
EVT_ENTER_WINDOW, EVT_LEAVE_WINDOW. Set the appropriate state
information, and call Refresh to redraw your control in the new state.

http://www.megaupload.com/?d=342LIPGM

^ Highly suggest against doing this, no one will want to click on such
a link. Instead create a minimal sample file and attach it to the
email you send to this mailing list.

Cody

···

On Wed, Jun 30, 2010 at 9:51 AM, iozk_Live <iozk117@gmail.com> wrote:

Anyway, your control should Bind to EVT_LEFT_DOWN, EVT_LEFT_UP,
EVT_ENTER_WINDOW, EVT_LEAVE_WINDOW. Set the appropriate state
information, and call Refresh to redraw your control in the new state.

but how know that in RB_BTNMENU_HIGHLIGHT is that have to be or how i
set the highlight code for that Variable?

Hi,

Anyway, your control should Bind to EVT_LEFT_DOWN, EVT_LEFT_UP,
EVT_ENTER_WINDOW, EVT_LEAVE_WINDOW. Set the appropriate state
information, and call Refresh to redraw your control in the new state.

but how know that in RB_BTNMENU_HIGHLIGHT is that have to be or how i
set the highlight code for that Variable?

The answer is above

When EVT_ENTER_WINDOW is fired when the mouse enters the control, so
set a flag or whatever to say that the mouse is hovering over it, then
Refresh.

When EVT_LEAVE_WINDOW is fired the mouse has left the window so you
can then unset the hover state, and again Refresh.

Cody

···

On Wed, Jun 30, 2010 at 12:05 PM, iozk_Live <iozk117@gmail.com> wrote:

but in the my case in the variable that i put in self._state thats
sopose that have to work(changng the draw state) sending with the
leavewindow event and setstate function.
or i forgot something? for example how set the current color of the
button state in the global variables example

BTN_HIGHLIGHT set color, get color assing for this

nope i not have idea