I'm the maintainer of xnec2c and we found that this code was causing xnec2c to beep through the PC speaker (excessively and annoyingly) while resizing a window or rotating an object:
snprintf( txt, sizeof(txt), "%7.2f", Viewer_Gain(proj_params, calc_data.freq_step) );
gtk_entry_set_text( GTK_ENTRY(Builder_Get_Object(builder, widget)), txt );
Why would gtk_entry_set_text beep?
After much troubleshooting, the
"%7.2f"was creating text that was too long for the text field defined bywidget(NB,widgetis agchar[]string naming the widget, not a widget object).The length of
txtexceeded the text field'smax-lengthas defined by the Glade XML, sogtk_entry_set_textwould trigger a beep event every time the widget text was updated.In case it helps someone else, this was the fix:
and this is the commit that solved our issue if you wish to review the entire thing.