gtkDcoding Blog Post for 2019-03-29 - Grid

Ron Tarrant rontarrant at gmail.com
Tue Apr 2 15:48:44 UTC 2019


On Tuesday, 2 April 2019 at 14:13:09 UTC, number wrote:

> Thank you!
You're welcome. :)

> The function ignores its argument and always uses member 
> variable button2 instead. Changing the parameter type to 
> MyRadioButton and using 'button' instead of 'button2' in the 
> body works, so you could pass another default in 
> RadioBox.this().

Thanks for catching my typos. I gotta stop messing with the code 
once it's working. :) Fixes are uploaded.

Anyway, you can also declare it as a RadioButton and that works, 
too... as long as the variables inside the function are changed 
to 'button.'

> Can somebody explain why getRgba() (apparently inherited from 
> ColorChooser) does take an out parameter instead of returning 
> an Gdk.RGBA?

My understanding is this:

Returning an object (as opposed to a single value) means 
returning a pointer rather than the entire object. And the object 
will cease to exist once the function returns because the scope 
no longer exists. So, it follows that an out variable passed in 
will preserve the object itself once program control returns to 
the caller.



More information about the Digitalmars-d-learn mailing list