Index: trunk/src_plugins/hid_gtk/ghid-coord-entry.c =================================================================== --- trunk/src_plugins/hid_gtk/ghid-coord-entry.c (revision 3624) +++ trunk/src_plugins/hid_gtk/ghid-coord-entry.c (revision 3625) @@ -274,6 +274,14 @@ return ce->value; } +/*! \brief Gets a GHidCoordEntry's value as text */ +int ghid_coord_entry_get_value_str(GHidCoordEntry * ce, char *out, int out_len) +{ + GtkAdjustment *adj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(ce)); + double value = gtk_adjustment_get_value(adj); + return pcb_snprintf(out, out_len, "%.*f %s", ce->unit->default_prec, value, ce->unit->suffix); +} + /*! \brief Sets a GHidCoordEntry's value, in pcb coords */ void ghid_coord_entry_set_value(GHidCoordEntry * ce, Coord val) { Index: trunk/src_plugins/hid_gtk/ghid-coord-entry.h =================================================================== --- trunk/src_plugins/hid_gtk/ghid-coord-entry.h (revision 3624) +++ trunk/src_plugins/hid_gtk/ghid-coord-entry.h (revision 3625) @@ -26,6 +26,7 @@ void ghid_coord_entry_add_entry(GHidCoordEntry * ce, const gchar * name, const gchar * desc); gchar *ghid_coord_entry_get_last_command(GHidCoordEntry * ce); +int ghid_coord_entry_get_value_str(GHidCoordEntry * ce, char *out, int out_len); Coord ghid_coord_entry_get_value(GHidCoordEntry * ce); void ghid_coord_entry_set_value(GHidCoordEntry * ce, Coord val);