From: erg Date: Wed, 14 Apr 2010 17:44:15 +0000 (+0000) Subject: Use integer values for combo boxes X-Git-Tag: LAST_LIBGRAPH~32^2~1362 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e9365b69b6408c7d5482a8250e740471995c8001;p=graphviz Use integer values for combo boxes --- diff --git a/cmd/smyrna/gui/topviewsettings.c b/cmd/smyrna/gui/topviewsettings.c index 941b80979..3ad1e13cd 100644 --- a/cmd/smyrna/gui/topviewsettings.c +++ b/cmd/smyrna/gui/topviewsettings.c @@ -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;