pygui: updated validation to be wrapper classes around ttk.Entry for convenience and less code
This commit is contained in:
parent
150db07497
commit
22d813df63
8 changed files with 125 additions and 350 deletions
|
@ -6,7 +6,7 @@ from typing import TYPE_CHECKING
|
|||
|
||||
import netaddr
|
||||
|
||||
from core.gui import nodeutils
|
||||
from core.gui import nodeutils, validation
|
||||
from core.gui.appconfig import ICONS_PATH
|
||||
from core.gui.dialogs.dialog import Dialog
|
||||
from core.gui.dialogs.emaneconfig import EmaneModelDialog
|
||||
|
@ -143,16 +143,7 @@ class NodeConfigDialog(Dialog):
|
|||
# name field
|
||||
label = ttk.Label(frame, text="Name")
|
||||
label.grid(row=row, column=0, sticky="ew", padx=PADX, pady=PADY)
|
||||
entry = ttk.Entry(
|
||||
frame,
|
||||
textvariable=self.name,
|
||||
validate="key",
|
||||
validatecommand=(self.app.validation.name, "%P"),
|
||||
state=state,
|
||||
)
|
||||
entry.bind(
|
||||
"<FocusOut>", lambda event: self.app.validation.focus_out(event, "noname")
|
||||
)
|
||||
entry = validation.NodeNameEntry(frame, textvariable=self.name, state=state)
|
||||
entry.grid(row=row, column=1, sticky="ew")
|
||||
row += 1
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue