g_object_{new,set,get} vs. class-specific function

Gabriel Schulhof nix at go-nix.ca
Sun May 20 13:38:07 EDT 2007


On Sun, 2007-05-20 at 12:04 -0500, Mark Doliner wrote:
> What happens if you accidentally pass in "justlfy"
> instead of "justify" when creating a label?
Then chances are that you're about to compile and try out your brand new
code. This means you're likely to run Pidgin from a terminal and watch
the output for segfaults, warnings, errors, etc. In this case, you will
receive a warning, something to the effect of

GObject-warning: Class "GtkLabel" has no property named "justlfy"

You can turn on G_DEBUG=fatal_warnings, and it will abort.

Even if you miss the warning in the terminal, chances are that you'll
wanna check out your changes right away, and so you'll click your way to
the GtkLabel you have just modified in the code and notice that it's not
properly justified.

Either way, there is some adjustment to be made when switching to this
notation. I have made that adjustment, but, for the sake of Pidgin, I
can change my code back to the old notation. NP.


More information about the Devel mailing list