コード例 #1
0
ファイル: pui.py プロジェクト: VVVAlex/bso
 def off_vol(self, *arg):
     """Отключить включить звук"""
     if not self.off_volume:
         image = self.img_['kmix']
         ToolTip(self.b['btnvolume'], msg='Звук включен')
     else:
         image = self.img_['kmixmute']
         ToolTip(self.b['btnvolume'], msg='Звук выключен')
     self.b['btnvolume'].configure(image=image)
     self.off_volume = not self.off_volume
コード例 #2
0
 def off_vol(self, *arg):
     """Обработка кнопки вкл./выкл. звука"""
     if not self.master.off_volume:
         image=self.img_['soundon']
         ToolTip(self.b['btnvolume'], msg='Звук включен')
     else:
         image=self.img_['soundoff']
         ToolTip(self.b['btnvolume'], msg='Звук выключен')
     self.b['btnvolume'].configure(image=image)
     self.master.off_volume = not self.master.off_volume   
コード例 #3
0
    def showBagContents(self, bag, frame):
        bag_id = int(bag.get("id"))

        # if no bag is the active bag - this bag becomes the active bag ...
        if self.active_bag_id == -1:
            self.active_bag_id = bag_id

        bag_tag = bag.find("container")
        bag_frame = tk.LabelFrame(frame, text=bag_tag.get("name"))

        if self.active_bag_id == bag_id:
            bag_frame.config(font=config.Style.BAG_LF_FONT, )
            ToolTip(bag_frame, msg.ES_TT_ACTIVE_BAG)
        else:
            ToolTip(bag_frame, msg.ES_TT_INACTIVE_BAG)

        # retrieve bag content and display ...
        item_ids = bag.get("content")

        if item_ids is not None:
            entries = item_ids.split()
            for item_id in entries:
                item = self.char.getItemById(item_id)
                if item is not None:
                    item_line = tk.Frame(bag_frame)
                    quantity_label = tk.Label(item_line,
                                              text=item.get("quantity") +
                                              msg.MULTIPLY)
                    quantity_label.pack(side=tk.LEFT)
                    item_label = tk.Label(item_line, text=item.get("name"))
                    item_label.bind("<Button-1>",
                                    lambda event, id=item_id: self.
                                    displayItemEditor(event, id))
                    item_label.pack(side=tk.LEFT, fill=tk.X, expand=1)
                    unpack_icon = ImageTk.PhotoImage(file="img/unpack.png")
                    item_unpack = tk.Button(item_line, image=unpack_icon)
                    ToolTip(item_unpack, msg.ES_TT_UNPACK)
                    item_unpack.image = unpack_icon
                    item_unpack.bind(
                        "<Button-1>",
                        lambda event, id=item_id: self.unpackItem(event, id))
                    item_unpack.pack(side=tk.RIGHT, anchor=tk.E)
                    item_line.pack(fill=tk.X, expand=1)

        children = bag_frame.winfo_children()
        # for empty bag ...
        if not children:
            tk.Label(bag_frame, text=" ").pack()

        bag_frame.pack(fill=tk.BOTH, expand=1)
        bag_frame.bind(
            "<Button-1>",
            lambda event, bag_id=bag_id: self.setActiveBag(event, bag_id))
コード例 #4
0
 def hide_hline(self, arg=None):
     """Показать, скрыть гор. линии поля"""
     if self.hide_grid:
         self.board.move_grid(2700, 0)
         image = self.img_['grid2']
         ToolTip(self.b['btnhidevline'], msg='Линии видны')
     else:
         self.board.move_grid(-2700, 0)
         image = self.img_['lauernogrid']
         ToolTip(self.b['btnhidevline'], msg='Линии скрыты')
     self.b['btnhidevline'].configure(image=image)
     self.hide_grid = not self.hide_grid
コード例 #5
0
 def len_view(self):  #
     """Тригер показ длительности целей"""
     if self.visible_len:
         self.board.show_data_zip(on_eco=True)
         image = self.img_['candlestick']
         ToolTip(self.b['btnlen'], msg='Длительность видна')
     else:
         self.board.canv.delete('point')
         image = self.img_['linechart']
         ToolTip(self.b['btnlen'], msg='Длительность  скрыта')
     self.b['btnlen'].config(image=image)
     self.visible_len = not self.visible_len
     self.board.reconfig()
コード例 #6
0
 def clr(self):
     """Тригер показ всех точек или одна цель"""
     if self.visible:
         self.board.show_data_zip(on_eco=True)
         image = self.img_['sloion']
         ToolTip(self.b['btnall'], msg='Все эхо')
     else:
         self.board.canv.delete('point')
         image = self.img_['sloi3']
         ToolTip(self.b['btnall'], msg='Одно эхо')
         # self.board.canv.itemconfigure('point_g', fill='black')     # 'green3'
     self.b['btnall'].config(image=image)
     self.visible = not self.visible
     self.board.reconfig()
コード例 #7
0
 def hide_metki(self):
     """Показать, скрыть метки"""
     if self.hide_metka:
         self.board.move_metkai_hide(hide=False)
         image = self.img_['geoon']
         ToolTip(self.b['btnmetki'], msg='Метки видны')
         if self.flag_gals:
             self.ch_state((), ('bmman', 'btnmetka'))
     else:
         self.board.move_metkai_hide(hide=True)
         image = self.img_['geooff']
         ToolTip(self.b['btnmetki'], msg='Метки скрыты')
         self.ch_state(('bmman', 'btnmetka'), ())
     self.b['btnmetki'].configure(image=image)
     self.hide_metka = not self.hide_metka
コード例 #8
0
 def avto_on_off(self, arg=None):
     """Установиь сбросить автомасштаб"""
     if self.viewData:
         self.can_show._scal()
         if not self.avtoscale:
             self.m_avto.set(1)
             self.stbar_avto.set('Масштаб = Авто')
             self.tol_bar.btn['Автомасштаб'].config(image=self.img_['a'])
             ToolTip(self.tol_bar.btn['Автомасштаб'], msg='Автомасштаб')
         else:
             self.m_avto.set(0)
             self.stbar_avto.set('Масштаб = Ручной')
             self.tol_bar.btn['Автомасштаб'].config(image=self.img_['h1'])
             ToolTip(self.tol_bar.btn['Автомасштаб'], msg='Ручной масштаб')
         self.avtoscale = not self.avtoscale
コード例 #9
0
ファイル: settings.py プロジェクト: dmanusrex/swimcam
 def _bg_img(self) -> ttk.Widget:
     frame = ttk.Frame(self, padding=1)
     frame.rowconfigure(0, weight=1)
     frame.columnconfigure(1, weight=1)
     ttk.Label(frame, text="Background image:").grid(column=0, row=0, sticky="news")
     bgi_text = os.path.basename(self._config.get_str("image_bg"))
     if bgi_text == "":
         bgi_text = "-None-"
     self._set_btn = ttk.Button(frame, text=bgi_text[0:20], command=self._browse_bg_image)
     self._set_btn.grid(column=1, row=0, sticky="news")
     ToolTip(self._set_btn, "Set the scoreboard background image")
     clear_btn = ttk.Button(frame, text="Clear", command=self._clear_bg_image)
     clear_btn.grid(column=2, row=0, sticky="news")
     ToolTip(clear_btn, "Remove the scoreboard background image")
     return frame
コード例 #10
0
ファイル: widgets.py プロジェクト: EyeSeeTea/scipion-web
    def __init__(self, master, text, imagePath=None, tooltip=None, **opts):
        defaults = {}
        # Used to be {'font': gui.fontButton} but there is no such
        # definition in pyworkflow/gui.
        defaults.update(opts)

        if 'bg' in defaults and defaults['bg'] is None:
            del defaults['bg']

        if imagePath is not None:
            btnImage = gui.getImage(imagePath, Button._images)
        else:
            btnImage = None

        if btnImage is not None:
            if 'compound' not in defaults:
                defaults['compound'] = tk.LEFT
            tk.Button.__init__(self,
                               master,
                               text=text,
                               image=btnImage,
                               **defaults)
            self.image = btnImage
        else:
            tk.Button.__init__(self, master, text=text, **defaults)

        if tooltip:
            from tooltip import ToolTip
            ToolTip(self, tooltip, 500)
コード例 #11
0
 def showContent(self, frame):
     content_ids = self.item.get("content", "")
     content_ids = content_ids.split(" ")
     content_frame = tk.LabelFrame(frame, text=msg.IE_CONTENT)
     for content_id in content_ids:
         sub_item = self.char.getItemById(content_id)
         if sub_item is not None:
             sub_item_id = sub_item.get("id")
             line = tk.Frame(content_frame)
             label_text = sub_item.get("quantity") + "x - " + sub_item.get("name")
             label = tk.Label(line, text=label_text)
             label.bind(
                 "<Button-1>",
                 lambda event, load_item=sub_item:
                     self.close(load=load_item)
             )
             label.pack(side=tk.LEFT)
             unpack_icon = ImageTk.PhotoImage(file="img/unpack.png")
             unpack_button = tk.Button(line, image=unpack_icon)
             unpack_button.image = unpack_icon
             ToolTip(unpack_button, msg.IE_TT_UNPACK)
             unpack_button.bind(
                 "<Button-1>",
                 lambda event, sub=sub_item, line_widget=line:
                     self.unpackItem(event, sub, line_widget)
             )
             unpack_button.pack(side=tk.RIGHT, anchor=tk.E)
             line.pack(fill=tk.X, expand=1)
     content_frame.pack(fill=tk.X, expand=1)
コード例 #12
0
ファイル: settings.py プロジェクト: dmanusrex/swimcam
 def __init__(self, container: tkContainer, config: StarterConfig):
     super().__init__(container, padding=5, text="CTS Start list configuration")
     self._config = config
     self._scb_directory = StringVar(value=self._config.get_str("start_list_dir"))
     self._starter_status = StringVar(value="")
      # self is a vertical container
     self.columnconfigure(0, weight=1)
     # row 0: label
     lbl1 = ttk.Label(self, text="Directory for CTS Start List files:")
     lbl1.grid(column=0, row=0, sticky="ws")
     # row 1: browse button & current directory
     # fr1 is horizontal
     fr1 = ttk.Frame(self)
     fr1.grid(column=0, row=1, sticky="news")
     fr1.rowconfigure(0, weight=1)
     scb_dir_label = ttk.Label(fr1, textvariable=self._scb_directory)
     scb_dir_label.grid(column=1, row=0, sticky="ew")
     btn1 = ttk.Button(fr1, text="Browse", command=self._handle_scb_browse)
     btn1.grid(column=0, row=0)
     ToolTip(btn1, text="Select the directory containing start list files "
             "that have been exported from Meet Manager")   # pylint: disable=C0330
     # row 2: status line
     lbl2 = ttk.Label(self, textvariable=self._starter_status, borderwidth=2,
                      relief="sunken", padding=2)
     lbl2.grid(column=0, row=3, sticky="news")
コード例 #13
0
 def __init__(self, tooltip=None, **tkArgs):
     Toplevel.__init__(self, tkArgs)
     self.master.withdraw()
     #self.master.geometry("1x1-1-1")
     self.title("Window")
     self.protocol("WM_DELETE_WINDOW", self.destroy)
     self.bind("<Escape>", self.destroy)
     try:
         if sys.platform == "win32":
             iconFile = "icon_win.ico"
         elif sys.platform == "darwin":
             self.config(bg="#EDEDED")
             iconFile = "icon_mac.icns"
         else:  # probably linux
             iconFile = "icon_lin.png"
         iconDir = "%s/python/wikidust/src" % tc_homeDir()
         try:
             self.iconbitmap("%s/%s" % (iconDir, iconFile))
         except:
             pass
     except:  # probably running outside tinkercell
         pass
     if tooltip != None:
         ToolTip(self,
                 text=tooltip,
                 follow_mouse=False,
                 delay=TOOLTIP_DELAY)
     self.focus_force()
コード例 #14
0
ファイル: settings.py プロジェクト: JohnStrunk/wahoo-results
 def __init__(self, container: tkContainer, watchdir_cb: WatchdirFn,
              config: WahooConfig):
     super().__init__(container,
                      text="CTS Dolphin configuration",
                      padding=5)
     self._config = config
     self._watchdir_cb = watchdir_cb
     self._dolphin_directory = StringVar(
         value=self._config.get_str("dolphin_dir"))
     # self is a vertical container
     self.columnconfigure(0, weight=1)
     # row 0:
     lbl = ttk.Label(self, text="Directory for CTS Dolphin do4 files:")
     lbl.grid(column=0, row=0, sticky="ws")
     # row 1: browse button & current data dir
     # fr2 is horizontal
     fr2 = ttk.Frame(self)
     fr2.rowconfigure(0, weight=1)
     fr2.grid(column=0, row=1, sticky="news")
     btn2 = ttk.Button(fr2, text="Browse", command=self._handle_do4_browse)
     btn2.grid(column=0, row=0)
     ToolTip(
         btn2,
         text="Choose the directory where the Dolphin software "
         "will write race results. The Dolphin software must be configured to use the .do4 format."
     )
     dolphin_dir_label = ttk.Label(fr2,
                                   textvariable=self._dolphin_directory)
     dolphin_dir_label.grid(column=1, row=0, sticky="ew")
コード例 #15
0
ファイル: settings.py プロジェクト: JohnStrunk/wahoo-results
 def __init__(self, container: tkContainer):
     super().__init__(container, padding=5, text="Scoreboard preview")
     canvas = tk.Canvas(self, width=self.WIDTH, height=self.HEIGHT)
     canvas.grid(column=0, row=0, padx=3, pady=3)
     self._canvas = canvas
     self._pimage = None
     ToolTip(self, "Current contents of the scoreboard")
コード例 #16
0
ファイル: canvas_show.py プロジェクト: VVVAlex/bso
 def one_ceil(self, arg=None):
     """Cкрыть показать все цели или одна цель"""
     (im, tip) = (self.parent.img_['sloion'], 'Все цели') if self.flag_on_point \
                  else (self.parent.img_['sloi3'], 'Одна цель')
     self.parent.tol_bar.btn['Все цели'].config(image=im)
     ToolTip(self.parent.tol_bar.btn['Все цели'], msg=tip)
     self.flag_on_point = not self.flag_on_point
     self.update_data()
コード例 #17
0
ファイル: canvas_show.py プロジェクト: VVVAlex/bso
 def grid(self, arg=None):
     """Cкрыть показать сетку"""
     (im, tip) = (self.parent.img_['lauernogrid'], 'Сетка выкл.') if self.GRID \
                  else (self.parent.img_['grid2'], 'Сетка вкл.')
     self.parent.tol_bar.btn['Сетка вкл.'].config(image=im)
     ToolTip(self.parent.tol_bar.btn['Сетка вкл.'], msg=tip)
     self.clr_grid() if self.GRID else self.set_grid()
     self.parent.m_grid.set(1) if self.GRID else self.parent.m_grid.set(0)
コード例 #18
0
ファイル: mainwindow.py プロジェクト: zjfroot/c10t
def add_tooltip(text, widgets):
    """Adds a tooltip to multiple elements at once. Useful for setting the
    same tooltip for the label/checkbox and the associated entry/spinbox.
    
    The tooltip widget is also stored at the "tooltip" attribute."""

    for w in widgets:
        w.tooltip = ToolTip(w, text=text)
コード例 #19
0
ファイル: settings.py プロジェクト: dmanusrex/swimcam
 def __init__(self, container: tkContainer,
              scoreboard_run_cb: NoneFn, test_run_cb: NoneFn,
              config: StarterConfig):
     super().__init__(container, padding=5)
     self._config = config
     self._scoreboard_run_cb = scoreboard_run_cb
     self._test_run_cb = test_run_cb
     self.grid(column=0, row=0, sticky="news")
     self.columnconfigure(0, weight=1)
     # Odd rows are empty filler to distribute vertical whitespace
     for i in [1, 3, 5, 7]:
         self.rowconfigure(i, weight=1)
     # row 0: Start list settings
     startlist = _StartList(self, self._config)
     startlist.grid(column=0, row=0, sticky="news")
     # row 2: General settings
     general = _GeneralSettings(self, self._config)
     general.grid(column=0, row=2, sticky="news")
     # row 4: run button(s)
     fr6 = ttk.Frame(self)
     fr6.grid(column=0, row=4, sticky="news")
     fr6.rowconfigure(0, weight=1)
     fr6.columnconfigure(0, weight=0)
     fr6.columnconfigure(1, weight=1)
     test_btn = ttk.Button(fr6, text="Test", command=self._handle_test_btn)
     test_btn.grid(column=0, row=0, sticky="news")
     ToolTip(test_btn, text="Display a mockup to show the current scoreboard style")
     run_btn = ttk.Button(fr6, text="Run Starter", command=self._handle_run_scoreboard_btn)
     run_btn.grid(column=1, row=0, sticky="news")
     ToolTip(run_btn, text="Start the starter simulator")
     # row 6: info panel
     fr8 = ttk.Frame(self)
     fr8.grid(column=0, row=6, sticky="news")
     fr8.rowconfigure(0, weight=1)
     fr8.columnconfigure(0, weight=1)
     fr8.columnconfigure(1, weight=0)
     link_label = ttkwidgets.LinkLabel(fr8,
         text="Documentation: https://swimcam.readthedocs.io/",  # pylint: disable=C0330
         link="https://swimcam.readthedocs.io/?utm_source=swimcam&"  # pylint: disable=C0330
              "utm_medium=config_screen&utm_campaign=docs_link",  # pylint: disable=C0330
         relief="sunken",  # pylint: disable=C0330
         padding=[5, 2])  # pylint: disable=C0330
     link_label.grid(column=0, row=0, sticky="news")
     version_label = ttk.Label(fr8, text=SWIMCAM_VERSION, justify="right",
                               padding=2, relief="sunken")
     version_label.grid(column=1, row=0, sticky="nes")
コード例 #20
0
ファイル: settings.py プロジェクト: dmanusrex/swimcam
 def _color_swatch(self, label_text: str, config_item: str, tip_text: str = "") -> ttk.Widget:
     frame = ttk.Frame(self, padding=1)
     frame.rowconfigure(0, weight=1)
     frame.columnconfigure(0, weight=1)
     ttk.Label(frame, text=label_text).grid(column=0, row=0, sticky="news")
     ColorButton(frame, self._config, config_item).grid(column=1, row=0, sticky="news")
     if tip_text != "":
         ToolTip(frame, tip_text)
     return frame
コード例 #21
0
ファイル: canvas_show.py プロジェクト: VVVAlex/bso
 def metka(self, arg=None):
     """Cкрыть показать все метки"""
     (im, tip) = (self.parent.img_['geooff'], 'Показать метки') if self.hide_ \
                  else (self.parent.img_['geoon'], 'Скрыть метки')
     self.parent.tol_bar.btn['Скрыть метки'].config(image=im)
     ToolTip(self.parent.tol_bar.btn['Скрыть метки'], msg=tip)
     self.hide_ = not self.hide_
     self.update_data()
     self.parent.m_hide.set(1) if self.hide_ else self.parent.m_hide.set(0)
コード例 #22
0
ファイル: settings.py プロジェクト: JohnStrunk/wahoo-results
 def __init__(self, container: tkContainer, selection_cb: SelectionFn):
     super().__init__(container, padding=5, text="Chromecast devices")
     cc_chooser = ttk.Treeview(self, selectmode="extended", show="tree")
     cc_chooser.grid(column=0, row=0, sticky="news")
     self._chooser = cc_chooser
     self._selection_cb = selection_cb
     ToolTip(
         self, "Select which Chromecast devices should display the "
         "scoreboard. Use <ctrl> or <shift> to select multiple devices.")
コード例 #23
0
    def _create_tooltip(widget, text):
        tooltip = ToolTip(widget)

        def enter(event):
            tooltip.showtip(text)

        def leave(event):
            tooltip.hidetip()
        widget.bind('<Enter>', enter)
        widget.bind('<Leave>', leave)
コード例 #24
0
ファイル: canvas_show.py プロジェクト: VVVAlex/bso
 def len_view(self, arg=None):
     """Cкрыть показать протяженность цели"""
     (im, tip) = (self.parent.img_['linechart'], 'Длительность  скрыта') if self.flag_on_lentht \
                  else (self.parent.img_['candlestick'], 'Длительность видна')
     self.parent.tol_bar.btn['Длительность видна'].config(image=im)
     ToolTip(self.parent.tol_bar.btn['Длительность видна'], msg=tip)
     self.flag_on_lentht = not self.flag_on_lentht
     self.update_data()
     self.parent.view_len.set(
         1) if self.flag_on_lentht else self.parent.view_len.set(0)
コード例 #25
0
ファイル: settings.py プロジェクト: dmanusrex/swimcam
 def _lane10is0(self) -> ttk.Widget:
     frame = ttk.Frame(self, padding=1)
     frame.rowconfigure(0, weight=1)
     frame.columnconfigure(0, weight=1)
     ttk.Label(frame, text="Lane 10 is 0:").grid(column=0, row=0, sticky="nes")
     self._inhibit_var = BooleanVar(frame, value=self._config.get_bool("lane10iszero"))
     ttk.Checkbutton(frame, variable=self._inhibit_var,
         command=self._handle_inhibit).grid(column=1, row=0, sticky="news") # pylint: disable=C0330
     ToolTip(frame, "Lane 10 is Lane 0 in the pool (Lane #s 0-9)")
     return frame
コード例 #26
0
ファイル: settings.py プロジェクト: dmanusrex/swimcam
 def _fullscreen(self) -> ttk.Widget:
     frame = ttk.Frame(self, padding=1)
     frame.rowconfigure(0, weight=1)
     frame.columnconfigure(0, weight=1)
     ttk.Label(frame, text="Fullscreen:").grid(column=0, row=0, sticky="nes")
     self._fullscreen_var = BooleanVar(frame, value=self._config.get_bool("fullscreen"))
     ttk.Checkbutton(frame, variable=self._fullscreen_var,
         command=self._handle_fullscreen).grid(column=1, row=0, sticky="news") # pylint: disable=C0330
     ToolTip(frame, "Select to run scoreboard in fullscreen mode; deselect for windowed")
     return frame
コード例 #27
0
ファイル: settings.py プロジェクト: JohnStrunk/wahoo-results
 def __init__(self, container: tkContainer, csv_cb: CSVGenFn,
              config: WahooConfig):
     super().__init__(container,
                      padding=5,
                      text="CTS Start list configuration")
     self._config = config
     self._scb_directory = StringVar(
         value=self._config.get_str("start_list_dir"))
     self._csv_status = StringVar(value="")
     self._csv_cb = csv_cb
     # self is a vertical container
     self.columnconfigure(0, weight=1)
     # row 0: label
     lbl1 = ttk.Label(self, text="Directory for CTS Start List files:")
     lbl1.grid(column=0, row=0, sticky="ws")
     # row 1: browse button & current directory
     # fr1 is horizontal
     fr1 = ttk.Frame(self)
     fr1.grid(column=0, row=1, sticky="news")
     fr1.rowconfigure(0, weight=1)
     scb_dir_label = ttk.Label(fr1, textvariable=self._scb_directory)
     scb_dir_label.grid(column=1, row=0, sticky="ew")
     btn1 = ttk.Button(fr1, text="Browse", command=self._handle_scb_browse)
     btn1.grid(column=0, row=0)
     ToolTip(btn1,
             text="Select the directory containing start list files "
             "that have been exported from Meet Manager")
     # row 2: write csv button
     btn2 = ttk.Button(self,
                       text="Write dolphin_events.csv",
                       command=self._handle_write_csv)
     btn2.grid(column=0, row=2, sticky="ew")
     ToolTip(btn2,
             text="Write a csv file with event information that can "
             "be imported into the Dolphin software")
     # row 3: status line
     lbl2 = ttk.Label(self,
                      textvariable=self._csv_status,
                      borderwidth=2,
                      relief="sunken",
                      padding=2)
     lbl2.grid(column=0, row=3, sticky="news")
コード例 #28
0
ファイル: settings.py プロジェクト: dmanusrex/swimcam
 def _gpio(self) -> ttk.Widget:
     frame = ttk.Frame(self, padding=1)
     frame.rowconfigure(0, weight=1)
     frame.columnconfigure(0, weight=1)
     ttk.Label(frame, text="GPIO Pin:").grid(column=0, row=0, sticky="news")
     self._gpio_spin_var = StringVar(frame, value=str(self._config.get_int("GPIO_pin")))
     self._gpio_spin_var.trace_add("write", self._handle_gpio_spin)
     ttk.Spinbox(frame, from_=1, to=39, increment=1, width=3,
                 textvariable=self._gpio_spin_var).grid(column=1, row=0, sticky="news")
     ToolTip(frame, "Starter GPIO (RPI Only)")
     return frame
コード例 #29
0
ファイル: settings.py プロジェクト: dmanusrex/swimcam
 def _font_scale(self) -> ttk.Widget:
     frame = ttk.Frame(self, padding=1)
     frame.rowconfigure(0, weight=1)
     frame.columnconfigure(0, weight=1)
     ttk.Label(frame, text="Font scale:").grid(column=0, row=0, sticky="nes")
     self._font_spin_var = StringVar(frame, value=str(self._config.get_float("font_scale")))
     self._font_spin_var.trace_add("write", self._handle_font_spin)
     ttk.Spinbox(frame, from_=0, to=1, increment=0.01, width=5,
                 textvariable=self._font_spin_var).grid(column=1, row=0, sticky="news")
     ToolTip(frame, "Scale of font relative to line height [0.0, 1.0]")
     return frame
コード例 #30
0
ファイル: manual.py プロジェクト: JohnStrunk/wahoo-results
 def __init__(self, container: tkContainer, dismiss_fn: Callable[[], None],
              publish_fn: Callable[[],None]):
     super().__init__(container, padding=5)
     self.columnconfigure(0, weight=1)
     self.columnconfigure(1, weight=0)
     self.columnconfigure(2, weight=0)
     publishbtn = ttk.Button(self, text="Publish", command=publish_fn)
     publishbtn.grid(column=1, row=0, sticky="news")
     ToolTip(publishbtn, text="Publish current preview to scoreboard")
     closebtn = ttk.Button(self, text="Close", command=dismiss_fn)
     closebtn.grid(column=2, row=0, sticky="news")