cryfish / welly

Automatically exported from code.google.com/p/welly
GNU General Public License v2.0
0 stars 0 forks source link

Tooltip Dictionary Support or Addition #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
OS X's standard dictionary popup (pressing command-ctrl-d) does not work with 
Nelly's text.

I suggest that we either develop a new feature, which is a dictionary tooltip, 
or we make it so that 
we can support OS X's standard dictionary.  

This could be Chinese-English and English-Chinese, and other languages too.  It 
would be useful 
for native and non-native speakers of either language when using BBS's where 
both languages are 
spoken.  

Original issue reported on code.google.com by diver...@gmail.com on 27 Oct 2008 at 7:14

GoogleCodeExporter commented 9 years ago
Type should be Enhancement.

Original comment by diver...@gmail.com on 27 Oct 2008 at 7:15

GoogleCodeExporter commented 9 years ago
Could you provide us with some examples, say, third party application that 
support
this feature? I have seen that this feature is supported by Apple Softwares. It 
is
really cool, but I'm not sure if we could find some example codes about how to
implement it.

Original comment by talent...@gmail.com on 27 Oct 2008 at 7:38

GoogleCodeExporter commented 9 years ago
OS X's standard dictionary is supposed to work with any application that uses 
Cocoa text rendering, but I 
think something is different with the way Welly renders and possibly 
idiosyncrasies of telnet (multi-byte 
chinese characters) that prevents it from working.

This makes me think that making a feature (or plugin) directly for Welly might 
be a better approach. Basically, 
with a keyboard shortcut, the word that is currently selected with the cursor 
(mouse or maybe text cursor) 
would show a small popup (or maybe a line in the status bar) that queried that 
word in a free Chinese or 
English dictionary.

I can't find example code now, but here is a firefox tool that has the kind of 
functionality I think would work 
best:
https://addons.mozilla.org/en-US/firefox/addon/3349

I'll keep looking to see if I can find some open source projects that have this 
kind of feature.

Can you please clarify your question, though. What is the confusing part: which 
dictionaries to use and how to 
query them, or how to get the text from the currently selected word?

Original comment by diver...@gmail.com on 27 Oct 2008 at 11:12

GoogleCodeExporter commented 9 years ago
Upon some further research, I think working with OS X's standard dictionary is 
the best way. I'm trying to find 
some help for this.

Original comment by diver...@gmail.com on 27 Oct 2008 at 11:40

GoogleCodeExporter commented 9 years ago
So with a few modifications Dictionary.app's tooltip function is very usable 
for looking up english and chinese 
words. 

Dictionary.app's popup function (command-ctrl-D with the mouse over a word) 
works for all apps that use 
Cocoa text rendering.  In fact, if I type an English or Chinese word into 
Welly's address bar, it will give a 
definition. I have attached a screenshot showing this functionality (I have 
typed 最近, then pressed command-
ctrl-D).

It doesn't work on the BBS window, though. I suspect it is because of the way 
Welly renders telnet text. Does 
anyone know if modifying Welly so that the built in dictionary popup is 
possible?

Original comment by diver...@gmail.com on 27 Oct 2008 at 11:53

Attachments:

GoogleCodeExporter commented 9 years ago
it is not clear how to support the shortcut, because welly is not using 
standard widgets for text rendering...

maybe one can try to find some dictionary api or clone the text in some 
standard widget.

Original comment by xi.w...@gmail.com on 6 Nov 2008 at 4:18

GoogleCodeExporter commented 9 years ago
I guess we shall implement some interface function so that the Dictionary.app 
can 
fetch the text it need. However, what's the interface?

Original comment by talent...@gmail.com on 28 Nov 2008 at 5:08

GoogleCodeExporter commented 9 years ago
Guys, this may help: 
http://www.mail-archive.com/cocoa-dev@lists.apple.com/msg11727.html

Original comment by talent...@gmail.com on 11 Feb 2009 at 1:44

GoogleCodeExporter commented 9 years ago
implemented in r790

Original comment by talent...@gmail.com on 14 May 2010 at 3:46