gtkmm过滤Entry的输入

过滤Entry的输入
string input = text;
int len = input.length();
string pre_str = ety_avg_speed->get_text();
pre_str = pre_str.substr(0, pre_str.length() - len);
bool rt = boost::all(input, boost::is_digit());

if (!rt) {
ety_avg_speed->set_text(pre_str);
}

posted @ 2016-10-27 01:51  kangtonghongwai  阅读(137)  评论(0编辑  收藏  举报