From 2cda6048bb6ff4ea52310308d6a7d4586a8ba4d1 Mon Sep 17 00:00:00 2001 From: Tim G L Lyons Date: Thu, 2 Feb 2012 12:50:56 +0000 Subject: [PATCH] Add option for monospaced font in InfoDialog svn: r18811 --- src/QuestionDialog.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/QuestionDialog.py b/src/QuestionDialog.py index 9bc7e34d6..9023d02b3 100644 --- a/src/QuestionDialog.py +++ b/src/QuestionDialog.py @@ -242,7 +242,7 @@ class InfoDialog(object): """ Non modal dialog to show selectable info in a scrolled window """ - def __init__(self, msg1, infotext, parent=None): + def __init__(self, msg1, infotext, parent=None, monospaced=False): self.xml = Glade(toplevel='infodialog') self.top = self.xml.toplevel @@ -256,6 +256,10 @@ class InfoDialog(object): infoview = self.xml.get_object('infoview') infobuffer = gtk.TextBuffer() infobuffer.set_text(infotext) + if monospaced: + startiter, enditer = infobuffer.get_bounds() + tag = infobuffer.create_tag(family="Monospace") + infobuffer.apply_tag(tag, startiter, enditer) infoview.set_buffer(infobuffer) if parent: