sbool conceptLanguageToolTips_enabled;
svoid conceptLanguageToolTips() swing {
if (conceptLanguageToolTips_enabled) ret;
conceptLanguageToolTips_enabled = true;
thread "conceptLanguageToolTips" {
bool firstTime = true; // hack fix for tool tip not appearing the first time
S initialMsg = "Move mouse over a concept word to reveal its meaning!";
//repeat with ms sleep 500 {
// Don't respond to "pause" button
while (licensed_noPing()) {
pcall {
Component c = (Component) componentAtMouse_gen();
if (c instanceof JComponent) {
S word = wordAtMouse(), msg = firstTime ? initialMsg : "";
if (possibleGlobalID(word)) {
Lisp l = getLispTruth(word);
S name = null;
if (l != null)
name = lispToEnglish_prettier(l);
if (name == null)
name = conceptToNameOpt(word); // This reloads AI concepts
if (name != null) {
msg = word + ": " + name;
firstTime = false;
}
}
setToolTipText((JComponent) c, msg);
}
}
Thread.sleep(500);
}
}
}Began life as a copy of #1007437
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1007440 |
| Snippet name: | conceptLanguageToolTips |
| Eternal ID of this version: | #1007440/12 |
| Text MD5: | 7d61117d2444ce6027ec8452aba950a4 |
| Author: | stefan |
| Category: | javax / gui / a.i. |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2017-04-30 00:39:54 |
| Source code size: | 1217 bytes / 37 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 1195 / 1200 |
| Version history: | 11 change(s) |
| Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |