Changeset 362:f57c0009eddc
- Timestamp:
- 12/14/12 19:20:26 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/common.py
r345 r362 74 74 POLICY_AUTOMATIC = gtk.POLICY_AUTOMATIC 75 75 76 WEIGHT_NORMAL = pango.WEIGHT_NORMAL 76 77 WEIGHT_BOLD = pango.WEIGHT_BOLD 77 78 … … 138 139 POLICY_AUTOMATIC = gtk.PolicyType.AUTOMATIC 139 140 141 WEIGHT_NORMAL = pango.Weight.NORMAL 140 142 WEIGHT_BOLD = pango.Weight.BOLD 141 143 … … 294 296 def addFaultTag(buffer): 295 297 """Add a tag named 'fault' to the given buffer.""" 296 faultTag = gtk.TextTag(name = "fault") 297 faultTag.set_property("foreground", "red") 298 faultTag.set_property("weight", WEIGHT_BOLD) 299 buffer.get_tag_table().add(faultTag) 298 buffer.create_tag("fault", foreground="red", weight=WEIGHT_BOLD) 300 299 301 300 #------------------------------------------------------------------------------ … … 312 311 """Insert the given line into the given text buffer at the given iterator. 313 312 314 If isFault is set, use the tag named 'fault'.""" 313 If isFault is set, use the tag named 'fault' else use the tag named 314 'normal'.""" 315 line = iter.get_line() 316 317 buffer.insert(iter, text) 318 319 iter0 = buffer.get_iter_at_line(line) 320 iter1 = buffer.get_iter_at_line(line+1) 315 321 if isFault: 316 buffer. insert_with_tags_by_name(iter, text, "fault")322 buffer.apply_tag_by_name("fault", iter0, iter1) 317 323 else: 318 buffer. insert(iter, text)319 320 #------------------------------------------------------------------------------ 324 buffer.remove_all_tags(iter0, iter1) 325 326 #------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.