Reputation:
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
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