From ea6ae568badbabb1441a4317e4f9e54ea98cc8b6 Mon Sep 17 00:00:00 2001 From: corvid Date: Sun, 25 Nov 2012 02:23:37 +0000 Subject: and now we can implement maxlength --- src/form.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/form.cc') diff --git a/src/form.cc b/src/form.cc index b495e7b4..b128c411 100644 --- a/src/form.cc +++ b/src/form.cc @@ -548,10 +548,11 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize) if (a_Html_get_attr(html, tag, tagsize, "readonly")) ((EntryResource *) resource)->setEditable(false); -// /* Maximum length of the text in the entry */ -// if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "maxlength"))) -// gtk_entry_set_max_length(GTK_ENTRY(widget), -// strtol(attrbuf, NULL, 10)); + /* Maximum length of the text in the entry */ + if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "maxlength"))) { + int maxlen = strtol(attrbuf, NULL, 10); + ((EntryResource *) resource)->setMaxLength(maxlen); + } } if (prefs.show_tooltip && (attrbuf = a_Html_get_attr(html, tag, tagsize, "title"))) { -- cgit v1.2.3