On Sat, 15 May 1999, Alejandro Aguilar Sierra wrote:
> Hi,
>
> It would be useful to have in the line style widget an option to
> select the length of the dash. Adding a spin button and making the
> widget a subclass of vbox, like the arrow selector, is not a problem.
>
> The problem is the function dia_line_style_selector_get_linestyle, which
> currently returns LineStyle. There's two possible solutions:
>
> - Return a struct { LineStyle; real dashlength; }
>
> - Allow two reference parameters in the function:
> (DiaLineStyleSelector *fs, LineStyle *ls, real *dashlength)
I prefer the later one. The first version gives troubles in the general
case (but maybe not in this particular case). Either you get a large
memory copy if you return the whole struct, or you get an ownership
problem if you return a pointer (how was it allocated? Who's responisble
for freeing it? And potential to return pointers to automatic (stack)
variables).
/ Alex