0

I am trying to use css in a GTK c project. To load the file, I have

GFile *myCssFile = "mystyle.css"; 

The warning comes from compiling with Gtk+-3.0. I'm using

pkg-config --cflags gtk+-3.0

In addition I get warning

warning: passing argument 1 of 'g_file_new_for_path' from incompatible pointer type[-Wincompatible-pointer-types]

This warning comes from :

gtk_css_provider_load_from_file(provider, g_file_new_for_path(myCssFile), &error); where provider is defined: GtkCssProvider *provider;

I'm using Geany for my project.

None of my CSS statements have any effect.

Any thoughts? I'm not very fluent with CSS nor with Linux on Raspberry Pi. I feel fairly confident with programming in C though.

1 Answer 1

1

passing argument 1 of 'g_file_new_for_path' from incompatible pointer type

The warning is about the first argument of g_file_new_for_path, which is myCssFile, and that you defined this way:

GFile *myCssFile = "mystyle.css";

The problem is that is that a GFile is not a simple file path, it's an object representing a file/directory that can be manipulated. In other words, you first need to create a GFile object from a path using g_file_new_for_path.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.