Hi Huub, Thanks for the clarification!
I'm sure I would have worked that out eventually, but it might have taken some time :) Regards Steve -----Original Message----- From: Huub Peters [mailto:i...@huubpeters.com] Sent: 25 September 2009 16:10 To: Steve Cookson Cc: wxperl-users@perl.org Subject: Re: wxConfig Huub Peters wrote: > Steve Cookson wrote: >> >> >> Hi People, >> >> Does anyone know where I can find some example wxConfig code? >> > > You need to set some values first. These are used to store the config > values under. > > $self->SetAppName('YourAppName'); > $self->SetVendorName('YourVendorName'); > > Eg: under windows it creates these keys in the Registry under: > \\HKEY_CURRENT_USER\Software\YourVendorName\YourAppName\ > > my $config = Wx::ConfigBase::Get; > > $config->Write('SomeName1', 'SomeValue1'); > $config->Write('SomeName2', 'SomeValue2'); > > And then somewhere else in your app: > > # In case you're in another namspace > my $config = Wx::ConfigBase::Get; > > $config->Read('SomeName1'); > $config->Read('SomeUnsetName', 'DefaultValue'); Ehm, more usefull like this: my $val1 = $config->Read('SomeName1'); my $val2 = $config->Read('SomeUnsetName', 'DefaultValue'); ;-) > > Hope it helps. > > Cheers, > Huub Peters >