]> granicus.if.org Git - graphviz/commitdiff
Use integer values for combo boxes
authorerg <devnull@localhost>
Wed, 14 Apr 2010 17:44:15 +0000 (17:44 +0000)
committererg <devnull@localhost>
Wed, 14 Apr 2010 17:44:15 +0000 (17:44 +0000)
cmd/smyrna/gui/topviewsettings.c

index 941b809797543494f75d13595176850f2a24b933..3ad1e13cdb67d63a3c83bb0818d95185e9d06471 100644 (file)
@@ -244,7 +244,7 @@ static int set_combobox_widget(char *attribute, char *widget_name)
     if ((!buf) || (strcmp(buf, "") == 0))
        buf = agget(view->systemGraphs.def_attrs, attribute);
     if (buf) {
-       value = (int) atof(buf);
+       value = (int) atoi(buf);
        gtk_combo_box_set_active((GtkComboBox *)
                                 glade_xml_get_widget(xml, widget_name),
                                 (int) value);
@@ -260,14 +260,15 @@ static int get_combobox_widget_to_attribute(char *attribute,
                                            Agraph_t * g)
 {
     char buf[25];
-    float value;
-        attribute=attribute +9;
+    int value;
+
+    attribute=attribute +9;
 
-    value = (float)
+    value = (int)
        gtk_combo_box_get_active((GtkComboBox *)
                                 glade_xml_get_widget(xml, widget_name));
 
-    sprintf(buf, "%f", value);
+    sprintf(buf, "%d", value);
     agattr(g, AGRAPH, attribute, buf);
     /* printf ("%s %f \n",attribute,value); */
     return 1;