From: msevior_at_physics.unimelb.edu.au
Date: Fri Apr 09 2004 - 06:50:25 EDT
>
> I'm currently re-polishing the UNIX preferences dialog and stumbled
> across the following problem:
> I need a getter/setter for each setting although I don't have a widget
> associated with it, e.g. the toolbar show/hiding is controlled via the
> view menu, so I don't need any prefs UI for that. I don't want to
> implement dummy getters/setters that return the prefs from the
> cross-platform backend, because I consider it hacky to return something
> to the cross-platform code I received from the cross-platform code
> inside platform-specific code. I don't know much about CPP encapsulation
> but wouldn't it be possible to have cross-platform getters/setters that
> can be overridden by platform-specific code, but don't have to. This
> would simplify my task a lot.
>
Yes. Just declare the getter/setters virtual in the xp code then the
virtual getter/setters in the platform code will overide them in Unix
while leaving them OK for the other platforms.
You'll only need to change the getter/setters in xp and unix this way too.
Cheers
Martin
PS. It took me ages to work out how these virtual methods work in C++ but
it really is a cool feature.
> regs,
> Chris
>
>
This archive was generated by hypermail 2.1.4 : Fri Apr 09 2004 - 06:52:47 EDT