Beispiel #1
0
    def __init__(self, parent, model, parent_model):
        self._model = model
        self._parent_model = parent_model
        super().__init__(parent)

        subframe = ttk.Frame(self)
        subframe.grid(row=0, column=0, sticky=tk.W)
        label = ttk.Label(subframe, text=_text["spbw"])
        label.grid(row=0, column=0, padx=2, pady=2)
        tooltips.ToolTipYellow(label, _text["spbw_tt"])
        self._space_bandwidth = tk.StringVar()
        entry = ttk.Entry(subframe, textvariable=self._space_bandwidth, width=5)
        entry.grid(row=0, column=1, padx=2)
        util.IntValidator(entry, self._space_bandwidth, callback=self._space_bw_changed)
        ttk.Label(subframe, text=_text["spbw1"]).grid(row=0, column=2, padx=2)

        subframe = ttk.Frame(self)
        subframe.grid(row=1, column=0, sticky=tk.W)
        label = ttk.Label(subframe, text=_text["tbw"])
        label.grid(row=0, column=0, padx=2, pady=2)
        tooltips.ToolTipYellow(label, _text["tbw_tt"])
        self._time_bandwidth = tk.StringVar()
        entry = ttk.Entry(subframe, textvariable=self._time_bandwidth, width=5)
        entry.grid(row=0, column=1, padx=2)
        util.IntValidator(entry, self._time_bandwidth, callback=self._time_bw_changed)

        self._plot = mtp.CanvasFigure(self)
        self._plot.grid(padx=2, pady=2, sticky=tk.NSEW, row=2, column=0)
        util.stretchy_rows_cols(self, [2], [0])

        self._update()
Beispiel #2
0
 def __init__(self, parent, width=None, height=None, scroll=""):
     super().__init__(parent)
     util.stretchy_rows_cols(self, [0], [0])
     self._text = tk.Text(self,
                          relief=tk.FLAT,
                          borderwidth=0,
                          highlightthickness=0,
                          wrap=tk.WORD)
     if width is not None:
         self._text["width"] = width
     if height is not None:
         self._text["height"] = height
     self._text.grid(sticky=tk.NSEW, row=0, column=0)
     # Todo: set styles etc.
     self._text["state"] = tk.DISABLED
     font = tkfont.nametofont("TkTextFont")
     self._text.tag_config("t", font=font)
     self._xs_del, self._ys_del = None, None
     if "v" in scroll:
         self._yscroll = ttk.Scrollbar(self,
                                       orient="vertical",
                                       command=self._text.yview)
         self._yscroll.grid(row=0, column=1, sticky=tk.NS)
         self._ys_del = self._yscroll.set
     if "h" in scroll:
         self._xscroll = ttk.Scrollbar(self,
                                       orient="horizontal",
                                       command=self._text.xview)
         self._xscroll.grid(row=1, column=0, sticky=tk.EW)
         self._xs_del = self._xscroll.set
     self._text["xscrollcommand"] = self._xscrollcommand
     self._text["yscrollcommand"] = self._yscrollcommand
 def __init__(self, parent, model):
     self._model = model
     super().__init__(parent)
     self._plot = mtp.CanvasFigure(self)
     self._plot.grid(padx=2, pady=2, sticky=tk.NSEW, row=0, column=0)
     self._plot.set_figure_task(self._plot_task)
     util.stretchy_rows_cols(self, [0], [0])
Beispiel #4
0
    def __init__(self, parent, model):
        super().__init__(parent)
        self._model = model
        util.stretchy_rows_cols(self, [0], [0])
        self._text = richtext.RichText(self, height=12, scroll="v")
        self._text.grid(sticky=tk.NSEW, row=0, column=0)
        self._text.add_text(_text["main"])

        frame = ttk.Frame(parent)
        frame.grid(row=1, column=0, sticky=tk.NSEW)
        ttk.Label(frame, text=_text["every"]).grid(row=0, column=0, sticky=tk.E, pady=2)
        self._every_var = tk.StringVar()
        self._every = ttk.Entry(frame, width=5, textvariable=self._every_var)
        self._every.grid(row=0, column=1, sticky=tk.W, pady=2)
        util.IntValidator(self._every, self._every_var, self.change)
        tooltips.ToolTipYellow(self._every, _text["everytt"])

        ttk.Label(frame, text=_text["score"]).grid(row=1, column=0, sticky=tk.E, pady=2)
        self._score_var = tk.StringVar()
        self._score = ttk.Entry(frame, width=5, textvariable=self._score_var)
        self._score.grid(row=1, column=1, sticky=tk.W, pady=2)
        util.IntValidator(self._score, self._score_var, self.change)
        tooltips.ToolTipYellow(self._score, _text["scorett"])
        
        self._preview_frame = ttk.LabelFrame(frame, text=_text["pp"])
        self._preview_frame.grid(row=2, column=0, columnspan=2, sticky=tk.NSEW, padx=5, pady=5)
        self._preview_label = ttk.Label(self._preview_frame)
        self._preview_label.grid(sticky=tk.NSEW)
        
        self.update()
Beispiel #5
0
    def update_prediction(self, level=-1, adjust_task=None):
        """Change the plotted prediction.

        :param level: The % of "coverage" to display, or -1 to mean plot all the
          relative risk.
        """
        def make_fig():
            fig = mtp.new_figure((20, 20))
            ax = fig.add_subplot(1, 1, 1)
            prediction = self.model.current_prediction
            if level == -1:
                plot_risk(prediction, ax, adjust_task)
            else:
                plot_coverage(prediction, level, ax, adjust_task)
            ax.set_aspect(1)
            fig.set_tight_layout(True)
            return fig

        if not hasattr(self, "_plot") or self._plot is None:
            frame = ttk.LabelFrame(self, text=_text["graph_name"])
            frame.grid(row=10,
                       column=0,
                       columnspan=2,
                       padx=2,
                       pady=2,
                       sticky=tk.NSEW)
            util.stretchy_rows_cols(frame, [0], [0])
            util.stretchy_rows(self, [10])
            util.stretchy_columns(self, [0, 1])
            self._plot = mtp.CanvasFigure(frame)
            self._plot.grid(padx=2, pady=2, sticky=tk.NSEW)
        self._plot.set_figure_task(make_fig, dpi=50)
Beispiel #6
0
    def _add_controls(self, frame):
        subframe = tk.Frame(frame)
        subframe.grid(row=0, column=0, sticky=tk.W)
        label = ttk.Label(subframe, text=_text["win"])
        label.grid(row=0, column=0, padx=5, pady=2)
        tooltips.ToolTipYellow(label, _text["wintt"])
        self._window_var = tk.StringVar()
        entry = ttk.Entry(subframe, textvariable=self._window_var, width=5)
        entry.grid(row=0, column=1)
        util.IntValidator(entry,
                          self._window_var,
                          callback=self._window_changed)
        ttk.Label(subframe, text=_text["win2"]).grid(row=0, column=2, padx=2)

        subframe = ttk.LabelFrame(frame, text=_text["kernelframe"])
        subframe.grid(row=1, column=0, sticky=tk.NSEW)
        self._cbox = ttk.Combobox(subframe, height=5, state="readonly")
        self._cbox["values"] = _text["kernel_choices"]
        self._cbox.bind("<<ComboboxSelected>>", self._kernel_selected)
        self._cbox.current(0)
        self._cbox["width"] = 10
        self._cbox.grid(row=0, column=0, sticky=tk.W, padx=2, pady=2)
        self._kernel_options_frame = ttk.Frame(subframe)
        self._kernel_options_frame.grid(row=1, column=0, sticky=tk.NSEW)
        util.stretchy_rows_cols(subframe, [1], [0])

        util.stretchy_rows_cols(frame, [1], [0])
 def __init__(self, parent, controller):
     self.controller = controller
     title = _text["title"].format(
         self.model.result.run_time.strftime(_text["dtfmt"]))
     super().__init__(parent, title, resize="wh")
     self.set_size_percentage(50, 60)
     util.stretchy_rows_cols(self, [1], [0])
Beispiel #8
0
    def _plot_grid(self):
        coords = self._controller._projected_coords()
        if coords is None:
            return self._no_proj()
        if self._inline:
            return

        def make_fig():
            xmin, xmax = _np.min(coords[0]), _np.max(coords[0])
            xd = (xmax - xmin) / 100 * 3
            xmin, xmax = xmin - xd, xmax + xd
            ymin, ymax = _np.min(coords[1]), _np.max(coords[1])
            yd = (ymax - ymin) / 100 * 3
            ymin, ymax = ymin - yd, ymax + yd

            width = xmax - xmin
            height = ymax - ymin
            if width == 0 or height == 0:
                size = (10, 10)
            else:
                height = height / width * 10.0
                width = 10.0
                if height > 10.0:
                    width = 100.0 / height
                    height = 10.0
                size = (width, height)

            fig = mtp.new_figure(size)
            ax = fig.add_subplot(1, 1, 1)
            ax.scatter(coords[0],
                       coords[1],
                       marker="x",
                       color="black",
                       alpha=0.5)
            lc = open_cp.plot.lines_from_regular_grid(
                self._controller.get_grid())
            ax.add_collection(
                mtp.matplotlib.collections.LineCollection(lc,
                                                          color="black",
                                                          linewidth=0.5))
            ax.set(xlim=[xmin, xmax], ylim=[ymin, ymax])
            ax.set_aspect(1.0)
            fig.set_tight_layout(True)
            return fig

        if self._plot is None:
            frame = ttk.LabelFrame(self, text=_text["vp"])
            frame.grid(row=0,
                       column=2,
                       rowspan=4,
                       padx=2,
                       pady=2,
                       sticky=tk.NSEW)
            util.stretchy_rows_cols(frame, [0], [0])
            self._plot = mtp.CanvasFigure(frame)
            self._plot.grid(padx=2, pady=2, sticky=tk.NSEW)
        self._plot.set_figure_task(make_fig, dpi=150)
Beispiel #9
0
 def __init__(self, parent, model, controller):
     super().__init__(parent)
     self._parent = parent
     self.controller = controller
     self.model = model
     self.master.protocol("WM_DELETE_WINDOW", self._cancel)
     self.grid(sticky=util.NSEW)
     util.stretchy_rows_cols(self, [11], [0])
     self._add_widgets()
     self.resize()
Beispiel #10
0
 def __init__(self, parent, model):
     super().__init__(parent)
     self._model = model
     util.stretchy_rows_cols(self, [0], [0])
     self._text = richtext.RichText(self, height=14, scroll="v")
     self._text.grid(sticky=tk.NSEW)
     self._text.add_text(_text["main"])
     frame = ttk.LabelFrame(self, text=_text["settings"])
     frame.grid(row=1, column=0, sticky=tk.NSEW)
     self._add_widgets(frame)
     self._update()
Beispiel #11
0
 def __init__(self, parent, model):
     super().__init__(parent)
     self.model = model
     util.stretchy_rows_cols(self, [1], [0])
     self._text = richtext.RichText(self, height=12, scroll="v")
     self._text.grid(row=0, column=0, sticky=tk.NSEW)
     self._text.add_text(_text["main"])
     frame = ttk.Frame(self)
     self.add_widgets(frame)
     frame.grid(row=1, column=0, sticky=tk.NSEW)
     self.update()
Beispiel #12
0
 def __init__(self, parent, model):
     self._model = model
     super().__init__(parent)
     util.stretchy_rows_cols(self, [1], [0])
     self._text = richtext.RichText(self, height=12, scroll="v")
     self._text.grid(sticky=tk.NSEW, row=0, column=0)
     self._text.add_text(_text["main"])
     frame = tk.Frame(self)
     frame.grid(sticky=tk.NSEW, row=1, column=0)
     self._add_controls(frame)
     self._update()
Beispiel #13
0
 def add_adjust_widgets(self):
     self._adjust_frame = ttk.LabelFrame(self, text=_text["adj"])
     self._adjust_frame.grid(row=1, column=0, sticky=tk.EW)
     util.stretchy_rows_cols(self._adjust_frame, [0], [0])
     choices = [key for (key, _) in self.controller.model.adjust_tasks]
     self._adjust_choice = ttk.Combobox(self._adjust_frame,
                                        height=5,
                                        state="readonly",
                                        values=choices)  #, width=50)
     self._adjust_choice.bind("<<ComboboxSelected>>", self._adjust_changed)
     self._adjust_choice.current(0)
     self._adjust_choice.grid(padx=2, pady=2, sticky=tk.EW)
 def add_sheet(self):
     frame = ttk.Frame(self)
     frame.grid(row=1, column=0, sticky=tk.NSEW)
     util.stretchy_rows_cols(frame, [0], [0])
     self._sheet = simplesheet.SimpleSheet(frame)
     self._sheet.grid(row=0, column=0, sticky=tk.NSEW)
     self._sheet.set_columns([_text["row{}".format(i)] for i in [1, 2, 3]])
     self._sheet.xscrollbar(frame).grid(row=1, column=0, sticky=tk.EW)
     self._sheet.yscrollbar(frame).grid(row=0, column=1, sticky=tk.NS)
     for i in range(3):
         self._sheet.callback_to_column_heading(
             i, lambda ii=i: self.sort_column(ii))
Beispiel #15
0
 def __init__(self, parent, width=None, height=None):
     super().__init__(parent)
     util.stretchy_rows_cols(self, [0], [0])
     self._canvas = tk.Canvas(self, borderwidth=0, selectborderwidth=0, highlightthickness=0)
     if width is not None:
         self._canvas["width"] = width
     if height is not None:
         self._canvas["height"] = height
     self._canvas.grid(sticky=tk.NSEW, row=0, column=0)
     self._pool = _locator.get("pool")
     self._canvas_image = None
     self._image = None
     self._size = (1,1)
     self._rlock = _threading.RLock()
     self.bind("<Configure>", self._resize)
Beispiel #16
0
        def __init__(self, model, parent):
            super().__init__(parent)
            self.model = model
            util.stretchy_rows_cols(self, [2], [0])
            text = richtext.RichText(self, height=3, scroll="v")
            text.grid(row=0, column=0, sticky=tk.NSEW)
            text.add_text(_text["scipy_main"])

            self._plot = mtp.CanvasFigure(self)
            self._plot.grid(row=2, column=0, sticky=tk.NSEW)
            tooltips.ToolTipYellow(self._plot, _text["kdeplot"])
            coords = self.model.main_model.test_coords()
            if coords is None:
                return
            kernel_provider = self.model.make_kernel()
            task = self.make_plot_task(kernel_provider, coords)
            self._plot.set_figure_task(task)
Beispiel #17
0
 def __init__(self, model, parent):
     super().__init__(parent)
     self.model = model
     util.stretchy_rows_cols(self, [2], [0])
     text = richtext.RichText(self, height=3, scroll="v")
     text.grid(row=0, column=0, sticky=tk.NSEW)
     text.add_text(_text["nkde_main"])
     frame = ttk.Frame(self)
     frame.grid(row=1, column=0, sticky=tk.W)
     label = ttk.Label(frame, text=_text["nkde_k"])
     label.grid(row=0, column=0, padx=2, pady=2)
     tooltips.ToolTipYellow(label, _text["nkde_k_tt"])
     self._k_value = tk.StringVar()
     entry = ttk.Entry(frame, textvariable=self._k_value)
     entry.grid(row=0, column=1, padx=2, pady=2)
     util.IntValidator(entry, self._k_value, callback=self._k_changed)
     self._plot = mtp.CanvasFigure(self)
     self._plot.grid(row=2, column=0, sticky=tk.NSEW)
     tooltips.ToolTipYellow(self._plot, _text["kdeplot"])
     self.update()
Beispiel #18
0
    def add_widgets(self):
        self._text = richtext.RichText(self, height=12, scroll="v")
        util.stretchy_rows_cols(self, [0], [0])
        self._text.grid(sticky=tk.NSEW)
        self._queue = queue.Queue()
        predictors.set_queue_logging(self._queue)

        self._bottom_frame = ttk.Frame(self)
        self._bottom_frame.grid(row=1, column=0, sticky=tk.EW)
        util.stretchy_columns(self._bottom_frame, [2])
        self._okay_button = ttk.Button(self._bottom_frame,
                                       text=_text["okay"],
                                       command=self.cancel)
        self._okay_button.grid(row=0, column=0, padx=5, pady=3, ipadx=20)
        self._okay_button.state(["disabled"])
        self._cancel_button = ttk.Button(self._bottom_frame,
                                         text=_text["cancel"],
                                         command=self._cancel)
        self._cancel_button.grid(row=0, column=1, padx=5, pady=3, ipadx=20)
        self._done = False
        self._poll_task()
Beispiel #19
0
    def add_widgets(self, frame):
        util.stretchy_rows_cols(frame, [1], [0,1])

        subframe = ttk.Frame(frame)
        subframe.grid(row=0, column=0, sticky=tk.NSEW, padx=1, pady=1)
        label = ttk.Label(subframe, text=_text["sk"])
        label.grid(row=0, column=0, padx=2)
        tooltips.ToolTipYellow(label, _text["sktt"])
        self._space_cbox = ttk.Combobox(subframe, height=5, state="readonly", width=40,
            values=_text["skernals"])
        self._space_cbox.bind("<<ComboboxSelected>>", self._space_changed)
        self._space_cbox.grid(row=0, column=1, padx=2)
        self._space_frame = ttk.LabelFrame(frame, text=_text["sks"])
        self._space_frame.grid(row=1, column=0, sticky=tk.NSEW, padx=1, pady=1)
        util.stretchy_rows_cols(self._space_frame, [0], [0])

        subframe = ttk.Frame(frame)
        subframe.grid(row=0, column=1, sticky=tk.NSEW, padx=1, pady=1)
        label = ttk.Label(subframe, text=_text["tk"])
        label.grid(row=0, column=0, padx=2)
        tooltips.ToolTipYellow(label, _text["tktt"])
        self._time_cbox = ttk.Combobox(subframe, height=5, state="readonly", width=40,
            values=_text["tchoices"])
        self._time_cbox.bind("<<ComboboxSelected>>", self._time_changed)
        self._time_cbox.grid(row=0, column=1, padx=2)
        self._time_frame = ttk.LabelFrame(frame, text=_text["tks"])
        self._time_frame.grid(row=1, column=1, sticky=tk.NSEW, padx=1, pady=1)
        util.stretchy_rows_cols(self._time_frame, [0], [0])
Beispiel #20
0
 def _add_widgets(self):
     subframe = ttk.Frame(self)
     subframe.grid(row=0, column=0, sticky=tk.W)
     label = ttk.Label(subframe, text=_text["q_bandwidth"])
     label.grid(row=0, column=0, padx=2, pady=2)
     tooltips.ToolTipYellow(label, _text["q_bandwidth_tt"])
     self._quartic_bandwidth_var = tk.StringVar()
     entry = ttk.Entry(subframe,
                       textvariable=self._quartic_bandwidth_var,
                       width=7)
     entry.grid(row=0, column=1, padx=2)
     util.IntValidator(entry,
                       self._quartic_bandwidth_var,
                       callback=self._quartic_bandwidth_changed)
     ttk.Label(subframe, text=_text["q_bandwidth1"]).grid(row=0, column=2)
     self._quartic_plot = mtp.CanvasFigure(self)
     self._quartic_plot.grid(padx=2,
                             pady=2,
                             sticky=tk.NSEW,
                             row=1,
                             column=0)
     util.stretchy_rows_cols(self, [1], [0])
Beispiel #21
0
    def __init__(self, parent, model, style):
        super().__init__(parent)
        self._model = model
        util.stretchy_rows_cols(self, [3], [0])
        if style == "normal":
            self._text = richtext.RichText(self, height=12, scroll="v")
            self._text.grid(sticky=tk.NSEW, row=0, column=0)
            if gpd is None:
                self._error_case()
                return
            self._text.add_text(_text["main"])

        subframe = ttk.Frame(self)
        subframe.grid(row=1, column=0, padx=2, pady=3, sticky=tk.NW)
        ttk.Button(subframe, text=_text["load"],
                   command=self._load).grid(row=0, column=0, padx=2)
        self._filename_label = ttk.Label(subframe)
        self._filename_label.grid(row=0, column=1, padx=2)
        tooltips.ToolTipYellow(self._filename_label, _text["filett"])

        self._projectors_widget = projectors_view.GeoFrameProjectorWidget(
            self, self._model._projector, self._update)
        self._projectors_widget.grid(row=2,
                                     column=0,
                                     padx=2,
                                     pady=3,
                                     sticky=tk.NW)

        subframe = ttk.Frame(self)
        subframe.grid(row=3, column=0, padx=2, pady=3, sticky=tk.NSEW)
        util.stretchy_rows_cols(subframe, [0], [0, 1])
        self._preview_frame = ttk.LabelFrame(subframe, text=_text["preview"])
        self._preview_frame.grid(row=0, column=0, sticky=tk.NSEW, padx=2)
        util.stretchy_rows_cols(self._preview_frame, [0], [0])
        self._preview_canvas = mtp.CanvasFigure(self._preview_frame)
        self._preview_canvas.grid(sticky=tk.NSEW, padx=1, pady=1)
        self._preview_frame_tt = tooltips.ToolTipYellow(
            self._preview_frame, _text["previewnonett"])

        with_coords_frame = ttk.LabelFrame(subframe, text=_text["preview2"])
        with_coords_frame.grid(row=0, column=1, sticky=tk.NSEW, padx=2)
        util.stretchy_rows_cols(with_coords_frame, [0], [0])
        self._with_coords_canvas = mtp.CanvasFigure(with_coords_frame)
        self._with_coords_canvas.grid(sticky=tk.NSEW, padx=1, pady=1)
        self._with_coords_frame_tt = tooltips.ToolTipYellow(
            with_coords_frame, _text["previewnonett"])

        self._update()
Beispiel #22
0
    def _add_controls(self, frame):
        subframe = ttk.Frame(frame)
        subframe.grid(row=0, column=0, columnspan=2, sticky=tk.NW)
        label = ttk.Label(subframe, text=_text["time_bin"])
        label.grid(row=0, column=0, padx=2, pady=2)
        tooltips.ToolTipYellow(label, _text["time_bin_tt"])
        self._time_resolution = tk.StringVar()
        entry = ttk.Entry(subframe, textvariable=self._time_resolution)
        entry.grid(row=0, column=1, padx=2, pady=2)
        util.IntValidator(entry, self._time_resolution, callback=self._time_res_changed)
        self._time_res_cbox = ttk.Combobox(subframe, height=5, state="readonly", width=10)
        self._time_res_cbox["values"] = _text["time_bin_choices"]
        self._time_res_cbox.bind("<<ComboboxSelected>>", self._time_res_changed)
        self._time_res_cbox.current(0)
        self._time_res_cbox.grid(row=0, column=2, padx=2, pady=2)

        subframe = ttk.LabelFrame(frame, text=_text["kernel"])
        subframe.grid(row=1, column=0, sticky=tk.NSEW, padx=2, pady=2)
        self._kernel_cbox = ttk.Combobox(subframe, height=5, state="readonly", width=20)
        self._kernel_cbox["values"] = _text["kernels"]
        self._kernel_cbox.bind("<<ComboboxSelected>>", self._kernel_changed)
        self._kernel_cbox.current(0)
        self._kernel_cbox.grid(row=0, column=0, padx=2, pady=2, sticky=tk.W)
        self._kernel_frame = ttk.Frame(subframe)
        self._kernel_frame.grid(row=1, column=0, sticky=tk.NSEW)
        util.stretchy_rows_cols(subframe, [1], [0])

        subframe = ttk.LabelFrame(frame, text=_text["dist"])
        subframe.grid(row=1, column=1, sticky=tk.NSEW, padx=2, pady=2)
        self._dist_cbox = ttk.Combobox(subframe, height=5, state="readonly", width=30)
        self._dist_cbox["values"] = _text["dists"]
        self._dist_cbox.bind("<<ComboboxSelected>>", self._dist_changed)
        self._dist_cbox.current(0)
        self._dist_cbox.grid(row=0, column=0, padx=2, pady=2, sticky=tk.W)
        self._dist_frame = ttk.Frame(subframe)
        self._dist_frame.grid(row=1, column=0, sticky=tk.NSEW)
        tooltips.ToolTipYellow(self._dist_frame, _text["dist_tt"])
        util.stretchy_rows_cols(subframe, [1], [0])

        util.stretchy_rows_cols(frame, [1], [0,1])
Beispiel #23
0
print("Should run from the base directory")
import sys, os.path
sys.path.insert(0, os.path.abspath("."))

import open_cp.gui.tk.richtext as richtext
import open_cp.gui.tk.util as util

import tkinter as tk

root = tk.Tk()
util.stretchy_rows_cols(root, [0], [0])

rt = richtext.RichText(root, height=10)#, scroll="v")
rt.add_text("Hello, world!")
rt.add_text("  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris erat ipsum, faucibus eu mauris sit amet, pulvinar consequat turpis. Cras commodo enim lectus, quis egestas massa consequat nec. Cras fringilla commodo congue. Proin fringilla eros ac felis hendrerit, ac mollis ante consequat. Fusce commodo fermentum dapibus. Vivamus at dolor pulvinar, dignissim mauris a, tempus augue. Donec laoreet ut metus id lobortis. Maecenas eu metus in nunc efficitur dapibus nec congue leo. Nunc eget odio nisi. Curabitur scelerisque, elit a ultrices tempor, neque lectus pharetra sem, eget malesuada nisi est a massa. Aliquam hendrerit rhoncus viverra. Morbi aliquet eros leo, quis cursus orci dapibus mollis. Fusce varius lorem congue sem porta euismod. Sed quis tellus eu felis hendrerit tempor. Fusce tincidunt sapien vel massa ultrices, ornare facilisis arcu laoreet.")
rt.grid(sticky=tk.NSEW, padx=20, pady=20)

rt.set_height_to_view()


root.mainloop()
Beispiel #24
0
 def _kernel_options(self, kernel):
     for w in self._kernel_options_frame.winfo_children():
         w.destroy()
     _, view = self._model.kernel_model_view(self._kernel_options_frame)
     view.grid(sticky=tk.NSEW, row=0, column=0)
     util.stretchy_rows_cols(self._kernel_options_frame, [0], [0])
Beispiel #25
0
 def __init__(self, parent):
     super().__init__(parent)
     util.stretchy_rows_cols(self, [0], [0])
     self._text = richtext.RichText(self, height=14, scroll="v")
     self._text.grid(sticky=tk.NSEW)
     self._text.add_text(_text["main"])
Beispiel #26
0
 def __init__(self, parent, controller, inline=False):
     super().__init__(parent)
     self._controller = controller
     self._inline = inline
     util.stretchy_rows_cols(self, [3], [2])
     self._add_widgets()
Beispiel #27
0
 def _update_dist(self):
     self._dist_cbox.current(self._model.distance_type)
     for w in self._dist_frame.winfo_children():
         w.destroy()
     self._model.distance_model.view(self._dist_frame).grid(sticky=tk.NSEW)
     util.stretchy_rows_cols(self._dist_frame, [0], [0])
Beispiel #28
0
 def _update_weight(self):
     self._kernel_cbox.current(self._model.weight_type)
     for w in self._kernel_frame.winfo_children():
         w.destroy()
     self._model.weight_model.view(self._kernel_frame).grid(sticky=tk.NSEW)
     util.stretchy_rows_cols(self._kernel_frame, [0], [0])