本文整理汇总了C++中Selection::Enable方法的典型用法代码示例。如果您正苦于以下问题:C++ Selection::Enable方法的具体用法?C++ Selection::Enable怎么用?C++ Selection::Enable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Selection
的用法示例。
在下文中一共展示了Selection::Enable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TimeOutCallback
gint Selection::TimeOutCallback(gpointer data)
{
Selection *oSelection = (Selection *)data;
if (oSelection->Enable()) {
if (conf->get_bool("/apps/stardict/preferences/dictionary/only_scan_while_modifier_key")) {
bool do_scan = gpAppFrame->unlock_keys->is_pressed();
if (!do_scan)
return true;
}
if (oSelection->IsBusy) {
oSelection->IsBusy++;
if (oSelection->IsBusy*SELECTION_INTERVAL > 8000 ) {
//"selection_received" signal is not received for 8 seconds.
//there encounter some error,and i find that this often take a long time (serveral minutes) to get the signal at last,
//during this perioed,if you call gtk_selection_convert(),the "selection_received" signal will not be received also,
//and at last these signals are received at almost the same time...BAD.
//so here create a new selection_widget, then call gtk_selection_convert()...this should can throw that error selection.
//!!!:
//But this seems(i am not sure) will make the widgets in StarDict become unselectable! see BUGS.
g_warning("Error, selection data didn't received, retring!\n");
oSelection->create_selection_widget();
oSelection->IsBusy = 0;
}
} else {
oSelection->IsBusy = 1;
gtk_selection_convert (oSelection->selection_widget, GDK_SELECTION_PRIMARY, oSelection->UTF8_STRING_Atom, GDK_CURRENT_TIME);
}
}
return true;
}