Re: gparamspecs.c param_double_validate() doesn't support NaN/Inf?



On Sat, 10 Jan 2009 13:42:31 +0200
"Andrew W. Nosenko" <andrew w nosenko gmail com> wrote:

> First at all, could you provide any real-world example, where min/max
> restriction on GParamSpec could be usefull?  The reason is simple:
> when validation fails, the application has no way to know about it
> and, therefore, to do anything usefull.  There just no interface for
> such things, like "validation-fails-callback".  As consequence, any
> validation should be done at the application level, before bringing
> GObject/GParamSpec/GValue/etc machinery into game.  Hence, I hard to
> imagine any usefull example of using restrcted GParamSpecs...

Also GtkAlignment gives you some real world examples.

If you need to catch validation failures from application level
I suppose you can use g_param_value_validate() in your set_data()
method. I never used it but I surely don't want to check all
params at application level.

Ciao
-- 
Nicola


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]