From: Kapell, J. <jk...@ti...> - 2004-09-02 09:53:01
|
Thanks a lot, sometime life could be so easy... I also had a second mistake, I used EVT_TOOL_ENTER instead of EVT_MENU. Best regards=20 Jens -----Original Message----- From: wxp...@li... [mailto:wxp...@li...] On Behalf Of John Ralls Sent: September 01, 2004 18:01 To: wxperl-users Subject: Re: [wxperl-users] Load toolbar via XMLResource / How to get a reference to a toolbar item them? You do it just like any other event: EVT_MENU($self, Wx::XmlResource::GetXRCID("MenuName"), \&OnMenuItem); Regards, John Ralls On Sep 1, 2004, at 5:22 AM, Kapell, Jens wrote: > Hello, > > We'd like to use for our forms wxWidget with the layout loaded via an > xrc file created by wxDesigner. Now my question, if we load a toolbar > from a xrc file, how we get a handle to a toolbar item to be able to =20 > bind a function on a click event? At wxWindows there is a function =20 > FindControl at wxToolBar, but this isn't available at wxPerl - is =20 > there any other way to bind an event or couldn't we use xrc for =20 > toolbars at wxPerl and to have it implemented directly at the script =20 > at all? > > E.g. > > $this->{'MainToolBar'} =3D $main::xmlResource->LoadToolBar($this, =20 > 'ToolBarFunc'); > > $this->{'MainToolBar'}->FindControl(Wx::XmlResource::=20 > GetXRCID("ToolbarTest")); > > Doesn't work, as there isn't a FindControl function. Also > > $this->{'MainToolBar'} =3D $main::xmlResource->LoadToolBar($this, =20 > 'ToolBarFunc'); > > $this->FindWindow(Wx::XmlResource::GetXRCID("ToolbarTest")); > > (this is a wxFrame object) doesn't work, as it couldn't an element =20 > with this name... > > Best regards > Jens > ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_idP47&alloc_id=10808&op=3Dick _______________________________________________ wxperl-users mailing list wxp...@li... https://lists.sourceforge.net/lists/listinfo/wxperl-users |