def render(self):
            self.config(height=40)
            seq_frame = Frame(self, **self.style.highlight)
            seq_frame.grid(row=0, column=0, sticky="nsew")
            seq_frame.pack_propagate(False)
            self.sequence = Entry(seq_frame, **self.style.input)
            self.sequence.place(x=0, y=0, relwidth=1, relheight=1, width=-40)
            self.sequence.set(self.value.sequence)
            self.sequence.configure(**self.style.no_highlight)
            self.sequence.focus_set()
            self.handler = Entry(self, **self.style.input)
            self.handler.grid(row=0, column=1, sticky="ew")
            self.handler.set(self.value.handler)
            self.handler.config(**self.style.highlight)
            self.add_arg = Checkbutton(self, **self.style.checkbutton)
            self.add_arg.grid(row=0, column=2, sticky="ew")
            self.add_arg.set(self.value.add)
            del_btn = Label(self,
                            **self.style.button,
                            image=get_icon_image("delete", 14, 14))
            del_btn.grid(row=0, column=3, sticky='nswe')
            del_btn.bind("<Button-1>", self._delete_entry)
            # set the first two columns to expand evenly
            for column in range(2):
                self.grid_columnconfigure(column, weight=1, uniform=1)

            for widget in (self.sequence, self.handler):
                widget.on_change(self._on_value_change)

            self.add_arg._var.trace("w", lambda *_: self._on_value_change())
Exemple #2
0
 def __init__(self, master, style_def=None):
     super().__init__(master, style_def)
     self.config(**self.style.dark_highlight_active)
     self._entry = Entry(self, **self.style.dark_input)
     self._entry.configure(**self.style.no_highlight)
     self._entry.pack(fill="x")
     self._entry.on_entry(self._change)
     self.set_def(style_def)
Exemple #3
0
 def __init__(self, master, style_def=None):
     super().__init__(master, style_def)
     if style_def is None:
         style_def = {}
     self.config(**self.style.dark_highlight_active)
     self._entry = Entry(self, **self.style.dark_input)
     self._entry.pack(fill="x")
     self._entry.on_entry(self._change)
     if style_def.get("readonly", False):
         self._entry.config(state='disabled')
Exemple #4
0
 def __init__(self, master, style_def=None):
     super().__init__(master, style_def)
     self.config(**self.style.dark_highlight_active)
     self._entry = Entry(self, **self.style.dark_input)
     self._color_button = Label(self, relief='groove', bd=1)
     self._color_button.bind('<ButtonRelease-1>', self._chooser)
     self._color_button.place(x=2, y=2, width=20, height=20)
     self._picker = ColorPicker(self, **self.style.dark_button)
     self._picker.place(relx=1, x=-22, y=0, width=20, height=20)
     self._picker.on_pick(self.set)
     self._entry.place(x=22, y=0, relheight=1, relwidth=1, width=-46)
     self._entry.on_change(self._change)
Exemple #5
0
 def __init__(self, master=None, **cnf):
     super().__init__(master, **cnf)
     self.config(**self.style.no_highlight, **self.style.dark)
     self._entry = Entry(self, **self.style.dark_input)
     self._clear_btn = Button(self,
                              image=get_icon_image("close", 15, 15),
                              **self.style.dark_button,
                              width=25,
                              height=25)
     self._clear_btn.pack(side="right", fill="y")
     self._clear_btn.on_click(self._clear)
     Label(self,
           **self.style.dark_text,
           image=get_icon_image("search", 15, 15)).pack(side="left")
     self._entry.pack(side="left", fill="both", expand=True, padx=2)
     self._entry.on_entry(self._change)
     self._on_change = None
     self._on_clear = None