GtkEntry::set_max_length

void set_max_length(int max);

Sets the maximum allowed length of the contents of the widget. If the current contents are longer than the given length, then they will be truncated to fit. 0 means no maximum.

See also: get_max_length()