Why am I getting this error while using gedit?

Solution 1:

This is a harmless message that you will see popup when running most gtk applications on the command line. You can ignore it really. I'm not sure what causes it, but usually it's no problem, unless you are getting other problems with the application.