Re: Any way of returning the actual individual control name

2009-08-17 Thread Johan Vromans
James McDonald  writes:

> My ownly reason now is: Just like Mount Everest - Because it's there.

I assume you write programs in Intercal and Brainfuck as well :)

> No real reason now I know how to identify my controls through GetId and
> GetLabel.

GetID is preferred since it is always fixed to the control.

The label may change, which can be considered a feature.
E.g., a Start/Stop button that changes the label from "Start" to
"Stop" and vice versa. However, this will become slightly more
complicated with stock buttons, and when you start writing
internationalized programs.

-- Johan


Re: Any way of returning the actual individual control name

2009-08-17 Thread Johan Vromans
James McDonald  writes:

> $self->{button_1} = Wx::Button->new($self, $KEY1, "1");
> 
> OK I have figured out how to:
>   get hold of the button object using $event->GetEventObject()
>   define a constant  and return it using $event->GetEventObject()->GetId
> 
> Is there any way of returning the "button_1" name programatically?

The "button_1" name is at a totally different level. If you really
must have it, you'd probably need to scan the parent hash and try
GetId on every key until you have the desired key.

Since you can assign your own IDs to the controls, why still the need
for the name?

-- Johan



Any way of returning the actual individual control name

2009-08-17 Thread James McDonald


$self->{button_1} = Wx::Button->new($self, $KEY1, "1");

OK I have figured out how to:
get hold of the button object using $event->GetEventObject()
define a constant  and return it using $event->GetEventObject()->GetId

Is there any way of returning the "button_1" name programatically?