def __init__(self, logger, app, ev_quit): self.logger = logger self.app = app self.ev_quit = ev_quit self.histlimit = 5000 self._plot_w = None self.zv = ZView.ZView(logger, self) from ginga.gw import Widgets, GwHelp self.top = self.app.make_window('GView') self.top.add_callback('close', lambda w: self.quit()) vbox = Widgets.VBox() vbox.set_border_width(2) vbox.set_spacing(1) self.top.set_widget(vbox) self.top.resize(800, 600) mbar = Widgets.Menubar() vbox.add_widget(mbar, stretch=0) filemenu = mbar.add_name("File") filemenu.add_separator() item = filemenu.add_name("Quit") item.add_callback('activated', lambda *args: self.quit()) nb = Widgets.TabWidget() vbox.add_widget(nb, stretch=1) sbar = Widgets.StatusBar() vbox.add_widget(sbar, stretch=0) vbox = Widgets.VBox() vbox.set_border_width(2) vbox.set_spacing(1) vbox.add_widget(Widgets.Label("Type command here:")) self.cmd_w = Widgets.TextEntry() # TODO: this is not fetching a fixed font font = GwHelp.get_font("fixed", 12) self.cmd_w.set_font(font) vbox.add_widget(self.cmd_w, stretch=0) self.cmd_w.add_callback('activated', self.exec_cmd_cb) vbox.add_widget(Widgets.Label("Output:")) self.hist_w = Widgets.TextArea(wrap=True, editable=True) self.hist_w.set_font(font) self.hist_w.set_limit(self.histlimit) vbox.add_widget(self.hist_w, stretch=1) nb.add_widget(vbox, "Command") self.top.show()
def getFont(self, fontType, pointSize): font_family = self.settings.get(fontType) return GwHelp.get_font(font_family, pointSize)
def get_font(self, font_family, point_size): #font_family = self.settings.get(font_type, 'sans') font = GwHelp.get_font(font_family, point_size) return font
def get_font(self, font_family, point_size): return GwHelp.get_font(font_family, point_size)