示例#1
0
文件: message.c 项目: mpuels/dia
static void
gtk_message_toggle_show_again(GtkWidget *button, gpointer *userdata) 
{
  DiaMessageInfo *msginfo = (DiaMessageInfo*)userdata;
  persistence_set_boolean(msginfo->title, 
			  gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)));
}
示例#2
0
void
prefs_save(void)
{
  int i;
  gpointer ptr;
  for (i=0;i<NUM_PREFS_DATA;i++) {
    if ((prefs_data[i].type == PREF_NONE) || (prefs_data[i].type == PREF_END_GROUP))
      continue;
    
    ptr = (char *)&prefs + prefs_data[i].offset;

    switch (prefs_data[i].type) {
    case PREF_BOOLEAN:
      persistence_set_boolean(prefs_data[i].name, *(gint *)ptr);
      break;
    case PREF_INT:
    case PREF_UINT:
      persistence_set_integer(prefs_data[i].name, *(gint *)ptr);
      break;
    case PREF_REAL:
    case PREF_UREAL:
      
      persistence_set_real(prefs_data[i].name, *(real *)ptr);
      break;
    case PREF_COLOUR:
      persistence_set_color(prefs_data[i].name, (Color *)ptr);
      break;
    case PREF_CHOICE:
    case PREF_STRING:
      persistence_set_string(prefs_data[i].name, *(gchar **)ptr);
      break;
    case PREF_NONE:
    case PREF_END_GROUP:
      break;
    }
  }
}