Cant set button name in wxBitmapButton()

Michael M. michael at mustun.ch
Fri Mar 23 15:27:42 PDT 2007



Thanks, I know this tricky things with image label and text label.

I will try the SetLabel(); later. Anyway I need an unique ID.



Vadim Zeitlin wrote:

> On Fri, 23 Mar 2007 22:35:00 +0100 "Michael M." <michael at mustun.ch> wrote:
> 
> MM> Cant set button name in wxBitmapButton()
> MM> 
> MM> xx = new wxBitmapButton( this /*panel*/,
> MM>                           wxID_HIGHEST + 1000 + n,
> MM>                           bitmap,
> MM>                           wxDefaultPosition,
> MM>                           wxDefaultSize,
> MM>                           wxBU_AUTODRAW | wxNO_BORDER,
> MM>                           wxDefaultValidator,
> MM>                           /*global_execName.Item(n)*/ "GUGU.2" );
> MM> 
> MM> cerr << "Name of Button: " << xx->GetLabel() << endl;
> MM> 
> MM> Strange: The name is not set. The name should be "GUGU.2" ?
> 
>  Name is not the same as label. Name is an internal property of the control
> and is currently hardly used at all. The label is what the control displays
> on screen. Except that wxBitmapButton doesn't actually display any label
> neither because it displays a bitmap. But to set label of e.g. a button you
> can use SetLabel().
> 
>  Regards,
> VZ
> 






More information about the wx-users mailing list