python GTK 求解释

软件和网站开发以及相关技术探讨
头像
ouch_ouch
帖子: 217
注册时间: 2010-12-24 19:52

python GTK 求解释

#1

帖子 ouch_ouch » 2011-03-11 22:59

不知大家有没有遇到用pygtk中的文本框不能输入中文的问题呀?怎么回事儿阿?是不是输入法的问题啊?我用的是fcitx

额……谁给个GTKTextView的changed信号的例子阿~

另外,python写的脚本可用编译成可执行文件吗?

额,好像问的问题有点多,等解释~~~~~
顶人一帖,胜造七级浮屠。。。
头像
ouch_ouch
帖子: 217
注册时间: 2010-12-24 19:52

Re: python GTK 求解释

#2

帖子 ouch_ouch » 2011-03-11 23:06

大虾们不会这么早睡觉吧 :em03
顶人一帖,胜造七级浮屠。。。
头像
ouch_ouch
帖子: 217
注册时间: 2010-12-24 19:52

Re: python GTK 求解释

#3

帖子 ouch_ouch » 2011-03-12 10:10

:em01
顶人一帖,胜造七级浮屠。。。
头像
leeaman
帖子: 30702
注册时间: 2007-02-02 18:14
系统: debian sid

Re: python GTK 求解释

#4

帖子 leeaman » 2011-03-12 10:19

官方教程的例子我这里也是fcitx可以输入中文阿....
醉了星星,醉月亮●●●●●The Long Way To Go(*^_^*)
头像
ouch_ouch
帖子: 217
注册时间: 2010-12-24 19:52

Re: python GTK 求解释

#5

帖子 ouch_ouch » 2011-03-12 10:41

求解释的麻,大家不要做潜水党麻
顶人一帖,胜造七级浮屠。。。
头像
ouch_ouch
帖子: 217
注册时间: 2010-12-24 19:52

Re: python GTK 求解释

#6

帖子 ouch_ouch » 2011-03-12 10:42

leeaman 写了:官方教程的例子我这里也是fcitx可以输入中文阿....
额……有回复了呀 :em02
我是说,fcitx在我用python做的那个文本框里不能输入中文呀
顶人一帖,胜造七级浮屠。。。
头像
leeaman
帖子: 30702
注册时间: 2007-02-02 18:14
系统: debian sid

Re: python GTK 求解释

#7

帖子 leeaman » 2011-03-12 10:43

你不贴代码上来谁知道阿,反正我的可以阿....
醉了星星,醉月亮●●●●●The Long Way To Go(*^_^*)
头像
ouch_ouch
帖子: 217
注册时间: 2010-12-24 19:52

Re: python GTK 求解释

#8

帖子 ouch_ouch » 2011-03-12 10:50

leeaman 写了:你不贴代码上来谁知道阿,反正我的可以阿....
额,代码如下~~麻烦看看咯
#-*-coding:utf-8-*-
#/usr/bin/python
import pygtk
import gtk
class Edit:
def quit(self,widget,event,data=None):
gtk.main_quit()
return False
def changed(self,widget,entry):
entry_text=entry.get_text()
print entry_text

#callback for text entry
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_title("myWindow")
self.icon=gtk.gdk.pixbuf_new_from_file('icon.png')
self.window.set_icon(self.icon)
self.window.connect("delete_event",self.quit)
text=gtk.Entry()
text.set_text("input")
self.window.add(text)
text.show()
text.connect("changed",self.changed,text)


self.window.show()
gtk.main()
if __name__=="__main__":
win=Edit()
附件
screenshot1.png
screenshot1.png (6.09 KiB) 查看 2197 次
顶人一帖,胜造七级浮屠。。。
头像
ouch_ouch
帖子: 217
注册时间: 2010-12-24 19:52

Re: python GTK 求解释

#9

帖子 ouch_ouch » 2011-03-12 10:52

leeaman 写了:你不贴代码上来谁知道阿,反正我的可以阿....
缩进米有了,上图~
附件
screenshot2.png
顶人一帖,胜造七级浮屠。。。
头像
leeaman
帖子: 30702
注册时间: 2007-02-02 18:14
系统: debian sid

Re: python GTK 求解释

#10

帖子 leeaman » 2011-03-12 10:53

好的,我也不懂,坐等高手 :em02
醉了星星,醉月亮●●●●●The Long Way To Go(*^_^*)
头像
ouch_ouch
帖子: 217
注册时间: 2010-12-24 19:52

Re: python GTK 求解释

#11

帖子 ouch_ouch » 2011-03-12 10:55

leeaman 写了:好的,我也不懂,坐等高手 :em02
嗯……谢谢你的热心帮助哈, :em01
用过python吗?
顶人一帖,胜造七级浮屠。。。
头像
leeaman
帖子: 30702
注册时间: 2007-02-02 18:14
系统: debian sid

Re: python GTK 求解释

#12

帖子 leeaman » 2011-03-12 11:03

用过 :em04 打包和文件上来阿...我这里运行错误阿
醉了星星,醉月亮●●●●●The Long Way To Go(*^_^*)
头像
ouch_ouch
帖子: 217
注册时间: 2010-12-24 19:52

Re: python GTK 求解释

#13

帖子 ouch_ouch » 2011-03-12 11:24

leeaman 写了:用过 :em04 打包和文件上来阿...我这里运行错误阿
额……貌似不明白你的意思 :em06
顶人一帖,胜造七级浮屠。。。
头像
leeaman
帖子: 30702
注册时间: 2007-02-02 18:14
系统: debian sid

Re: python GTK 求解释

#14

帖子 leeaman » 2011-03-12 11:27

我的意思是放那个py文件上来
醉了星星,醉月亮●●●●●The Long Way To Go(*^_^*)
头像
ouch_ouch
帖子: 217
注册时间: 2010-12-24 19:52

Re: python GTK 求解释

#15

帖子 ouch_ouch » 2011-03-12 11:30

leeaman 写了:我的意思是放那个py文件上来
嗯,这个要先装GTK图形库 :em01
附件
Edit.py
(699 Bytes) 已下载 59 次
顶人一帖,胜造七级浮屠。。。
回复