New version of ProjMan
This commit is contained in:
38
lib/notebook.tcl
Normal file
38
lib/notebook.tcl
Normal file
@@ -0,0 +1,38 @@
|
||||
######################################################
|
||||
# ProjMan 2
|
||||
# Distributed under GNU Public License
|
||||
# Author: Sergey Kalinin svk@nuk-svk.ru
|
||||
# Copyright (c) "", 2022, https://nuk-svk.ru
|
||||
######################################################
|
||||
#
|
||||
# Operation with NoteBook widget module
|
||||
#
|
||||
######################################################
|
||||
|
||||
namespace eval NB {
|
||||
|
||||
proc InsertItem {nb item type} {
|
||||
switch $type {
|
||||
file {
|
||||
regsub -all {\.|/|\\|\s} $item "_" itemName
|
||||
if [winfo exists $nb.$itemName] {
|
||||
set fm $nb.$itemName
|
||||
} else {
|
||||
set fm [ttk::frame $nb.$itemName]
|
||||
pack $fm -side top -expand true -fill both
|
||||
$nb add $fm -text [file tail $item];# -image close_12x12 -compound right
|
||||
$nb select $fm
|
||||
}
|
||||
}
|
||||
}
|
||||
puts "NB item - $fm"
|
||||
return $fm
|
||||
}
|
||||
proc CloseTab {w x y} {
|
||||
if {[$w identify $x $y] == "close_button"} {
|
||||
puts "Hurrah! Close tab [$w index @$x,$y] plz."
|
||||
FileOper::Close
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user