set_comment


Description:

public void set_comment (string? group_name, string? key, string comment) throws KeyFileError

Places a comment above key from group_name.

If key is `NULL` then comment will be written above group_name. If both key and group_name are `NULL`, then comment will be written above the first group in the file.

Passing a non-existent group_name or key to this function returns false and populates throws. (In contrast, passing a non-existent `group_name` or `key` to [method@GLib.KeyFile.set_string] creates the associated group name and key.)

Note that this function prepends a `#` comment marker to each line of comment.

Parameters:

this

a key file

group_name

a group name, or `NULL` to write a top-level comment

key

a key, or `NULL` to write a group comment

comment

a comment

Returns:

true if the comment was written, false otherwise