On Fri, Jun 14, 2002 at 02:26:56PM +0100, Angus Leeming wrote: > > Yes! This compiles. > > > > But does it do what it should? The idea is that somewhere you call > > InsetSection::insetShortTitle with an argument ins containing the text > > you want to be in the short title (sub-) inset. And then it should > > create such an inset. > > It creates an instance of InsetShortTitle. > > InsetSection should have a member variable > InsetShortTitle ist_; > > Then, your method becomes: > void setShortTitle(InsetText const & inset) { > ist_ = inset; > } > > Now, you've stored it you can create other methods to draw it. > > Angus
No quite, though. What you need is void insetShortTitle(InsetText const & ins) { ist_(ins); } in public, and InsetShortTitle ist_(InsetText const &); in private. The parentheses are necessary in both places to get it to compile. So ist_ is a (function-like) method and should be called as one. Hmmm... but how do you use this thingy somewhere else? As I see it, nothing is leaving the insetShortTitle method, and ist_ only helps you generate an InsetShortTitle from a given text inset. It's not a data thing. Should insetShortTitle have a return value? Anyway, thanks! Learning all the time. Martin
msg39537/pgp00000.pgp
Description: PGP signature