首先导入pygtk:
import pygtk
pygtk.require('2.0')
try:
import gtk
import gobject
except:
print("error: import 'gtk' failed!")
sys.exit(1)
text加背景色:
color = gtk.gdk.Color(0xffff, 0, 0, 0)
entry.modify_base(gtk.STATE_NORMAL,color)
label字体加颜色:
label5.set_text(tipInfo)
gtk.Label.set_markup(self.label5,
'<span foreground="red">%s</span>'%tipInfo)