Browse Source

Add monospace font support - issue #96

pull/97/head
chriskiehl 9 years ago
parent
commit
d67f7d0680
4 changed files with 13 additions and 4 deletions
  1. 2
      gooey/gui/windows/base_window.py
  2. 9
      gooey/gui/windows/runtime_display_panel.py
  3. 3
      gooey/python_bindings/config_generator.py
  4. 3
      gooey/python_bindings/gooey_decorator.py

2
gooey/gui/windows/base_window.py

@ -56,7 +56,7 @@ class BaseWindow(wx.Frame):
subheading=_desc or '',
parent=self)
self.runtime_display = RuntimeDisplay(self)
self.runtime_display = RuntimeDisplay(self, self.build_spec)
self.foot_panel = footer.Footer(self)
self.panels = [self.head_panel, self.config_panel, self.foot_panel]

9
gooey/gui/windows/runtime_display_panel.py

@ -23,9 +23,11 @@ class MessagePump(object):
class RuntimeDisplay(wx.Panel):
def __init__(self, parent, **kwargs):
def __init__(self, parent, build_spec, **kwargs):
wx.Panel.__init__(self, parent, **kwargs)
self.build_spec = build_spec
self._init_properties()
self._init_components()
self._do_layout()
@ -39,6 +41,11 @@ class RuntimeDisplay(wx.Panel):
self.cmd_textbox = wx.TextCtrl(
self, -1, "",
style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH)
if self.build_spec.get('monospace_display'):
pointsize = self.cmd_textbox.GetFont().GetPointSize()
font = wx.Font(pointsize, wx.FONTFAMILY_MODERN,
wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False)
self.cmd_textbox.SetFont(font)
def _do_layout(self):
sizer = wx.BoxSizer(wx.VERTICAL)

3
gooey/python_bindings/config_generator.py

@ -21,7 +21,8 @@ def create_from_parser(parser, source_path, **kwargs):
'num_required_cols': kwargs.get('required_cols', 1),
'num_optional_cols': kwargs.get('optional_cols', 3),
'manual_start': False,
'layout_type': 'column'
'layout_type': 'column',
'monospace_display': kwargs.get('monospace_display', False)
}
if show_config:

3
gooey/python_bindings/gooey_decorator.py

@ -31,7 +31,8 @@ def Gooey(f=None,
default_size=(610, 530),
required_cols=2,
optional_cols=2,
dump_build_config=False):
dump_build_config=False,
monospace_display=False):
'''
Decorator for client code's main function.
Serializes argparse data to JSON for use with the Gooey front end

Loading…
Cancel
Save