user5313110
user5313110

Reputation:

GTK - make widget settings persistant

I have a simple GTK program in c that requires the user to set values using GTK Scale widgets. Is there a way to make the settings persistent so that they will still be there when the program is closed and run again?

Thanks!

Upvotes: 0

Views: 159

Answers (1)

ptomato
ptomato

Reputation: 57920

Use GSettings. Briefly, this involves writing a "settings schema" describing the pieces of data (each known as a "setting") that you want to save across program runs. Then, you can use g_settings_bind() to bind the setting to the value property of your GtkScale's GtkAdjustment, so the value will automatically be saved each time the slider is dragged.

Upvotes: 2

Related Questions