glade+pygtk学习

今天上午参照 A Beginner's Guide to Using pyGTK and Glade 这篇文章学习,感觉确实很好用。文章开始部分对比几种GUI开发库写得挺好,虽然是2003年写的。还有后面提到如何结合socket编程,正好要用到。

照着Demo实做了一遍,发现一些用法已经deprecated了:

  • gtk.TRUE - 用True就行了
  • gtk.mainquit - 换成gtk.main_quit
  • gtk.mainloop() - 换成gtk.main()

期间犯了个小错误,忘了在glade里为主窗口添加destroy信号,结果没法关闭窗口后没法退出程序。

显示含有中文的页面内容时会在下面这行代码报错,像是编码问题,先不深究了。

self.logwindow.insert_at_cursor(data, len(data))

自己用为Entry控件加了activate信号,响应回车事件。也准备试试如何显示对话框,还没有完成。

可以在这里下载Demo的源代码: http://guoyong.org/?dl=pygtk-demo.tgz

接下来计划按照这篇文章 [ http://www.learningpython.com/2006/05/30/building-an-application-with-pygtk-and-glade/ ]学习,然后准备自己动手写了。

Softwares installed on my 6600

Below is a list of softwares install on my Nokia 6600 phone.

PyS60 - http://wiki.opensource.nokia.com/projects/PyS60
OggPlay - http://sourceforge.net/project/showfiles.php?group_id=86146
掌上书院 - http://www.mbook.com.cn/upload/soft.jsp
QReader - http://www.qreader.com/
Forward - http://www.compsoc.man.ac.uk/~ashley/
Torch - http://www.compsoc.man.ac.uk/~ashley/
AutoLock - http://fuse.stc.cx/autolock/
Big Clock - http://newlc.com/Big-Clock-Series-60.html
Planet Finder - http://www.newlc.com/article.php3?id_article=799
Egg Clock - http://gallery.mobile9.com/f/22812/
PhoneInfo - http://my-symbian.com/s60/software/applications.php?fldAuto=216&faq=2
Switcher - http://gallery.mobile9.com/f/13839/
Best vCard - http://gallery.mobile9.com/f/29125/
PuTTY - http://sourceforge.net/project/showfiles.php?group_id=97245
S60Zip - http://fuse.stc.cx/s60zip/
Best Screen Snap - http://gallery.mobile9.com/f/28313/
TodayView - http://gallery.mobile9.com/f/28334/
NiceDial - http://gallery.mobile9.com/f/29603/
AgileMessenger - http://www.agilemobile.com/downloads.html
Y-Browser - http://www.pushl.com/y_browser/
SysExplorer - http://newlc.com/SysExplorer-the-universal-file.html
FExplorer - http://www.gosymbian.com/FE_download.html
XXL ScreenSaver - http://www.gosymbian.com/XXLSS_download.html
Opera - http://www.opera.com/products/mobile/products/
Also please visit my bookmarks on del.icio.us.

ADD Chinese Font in Nokia 770, 2006os

Below is a summary of the instructions on how to add Chinese fonts in Nokia 770, 2006OS. It's original hower's comment based on my previous post "How to add a new locale to Nokia 770". There are also two related threads on "internet tablet Talk" forum.

And a post on oafbot 's site, ノキア770:日本語表示可能

1. Find a copy of Truetype Chinese font. Fonts, simsun.ttf and simhei.ttf do not seem work in opera.
Font fireflysung.ttf (link: http://www.study-area.org/apt/firefly-font/ ) works.
2. Run x-terminal
3. Execute command sudo gainroot to enable root access privilege.
4. Copy fireflysung.ttf to /usr/share/fonts/fireflysung.ttf
5. Execute command fc-cache –f to rebuild system font cache information.
6. Exit from x-terminal.
7. Reboot the device
8. Now opera and all applications should be able to display Chinese font
correctly.

In order to have the theme display Chinese font on the title bar correctly additional steps as described below are needed
(http://guoyong.org/2006/08/11/248):

1. Run x-terminal
2. Execute command sudo gainroot to enable root access privilege.
3. Locate the theme type you selected. For example:

Deck-top
theme color file
Theme1 orange /usr/share/themes/default/matchbox/theme.xml
Theme2 light blue /usr/share/themes/theme1/matchbox/theme.xml
Theme3 dark blue /usr/share/themes/theme2/matchbox/theme.xml
Theme4 gray /usr/share/themes/theme3/matchbox/theme.xml

4. Change to directory where the theme you used is located. For example:

cd /usr/share/themes/default/matchbox/

5. Make a backup copy

cp –i theme.xml theme.xml.original

6. Copy theme.xml to mmc card

cp -i theme.xml /media/mmc1/theme.xml

7. Execute command fc-list to find the exact font name you installed for use later.

8. Open file theme.xml that is located in mmc card with Notes program
(comes with 2006os).
9. Find the line that defines the font as shown below:


10. Add the new font name and font size to it. Separate the fonts with |
The modified line is as shown below:


11. Save it.

12. Copy the modified theme.xml back to its original directory and overwrite it.

cp -i /media/mmc1/theme.xml \
/usr/share/themes/default/matchbox/theme.xml

13. Exit from x-terminal.

14. Reboot the device.

15. The device is good to go.