Monday, 13 March 2017

Color selection

#!/bin/sh
# color_m.tcl \
exec tclsh "$0" ${1+"$@"}
set color ""
button .but -text "color chooser" -command {

set color [tk_chooseColor]
if {$color== ""} return
.lab configure -text "the chosen color is $color"
.lab configure -background $color
}
label .lab -text "No color is chosen"
pack .lab
pack .but

Displaying some Message Box

#!/bin/sh
# mssg1.tcl \
exec tclsh "$0" ${1+"$@"}
set answer [tk_messageBox -title "Application question " -message "really quit?" -type yesno -icon question]

switch $answer {
yes exit
no {tk_messageBox -message "I know like this application!" -type ok}

}

GUI_ Menu bar, Menus and Menu Items.

#!/bin/sh
# simpel_mny.tcl \
exec tclsh "$0" ${1+"$@"}
proc menu_clicked { no opt } {
tk_messageBox -message "you have clicked $opt. \n This function is not implanted yet "
}
#Declare that there is a menu

menu .mbar
. config -menu .mbar
#the main buttons
# cascade, checkbutton, command, radiobutoon, or separator,

.mbar add cascade -label "File" -underline 0 \
-menu [menu .mbar.file -tearoff 0]
.mbar add cascade -label "Others" \
-underline 0 -menu [menu .mbar.oth -tearoff 1]
.mbar add cascade -label "Help" -underline 0 -menu [menu .mbar.help -tearoff 0]

##File Menu##
set m .mbar.file
$m add command -label "New" -underline 0 \
-command { .txt delete 1.0 end} ; #A new item called New is added
$m add checkbutton -label "Open" -underline 0 -command {menu_clicked 1 "Open"}
$m add command -label "Save" -underline 0 -command {menu_clicked 1 "Save"}
$m add separator
$m add command -label "Exit" -underline 1 -command exit

##other Menu ##
set m .mbar.oth
$m add cascade -label "Insert" -underline 0 -menu [menu $m.mnu -title "Insert"]

$m.mnu add command -label "Name" -command {.txt insert end "Name : Gurinder V A\n"}
$m.mnu add command -label "Website" \
-command {.txt insert end "Website: https://www.blogger.com/\n"}
$m.mnu add command -label "Email" \
-command {.txt insert end "Email : gurinderpalsingh900@gmail.com\n"}

$m add command -label "Insert All"  -underline 7 \
-command {.txt insert end {Name : Gurinder V A
Website: https://www.blogger.com/
Email : gurinderpalsingh900@gmail.com}
}  
#help
set m .mbar.help
$m add command -label "About" -command {
.txt delete 1.0 end
.txt insert end {
About
---------
this script created to make a menu for a tcl/tk class
made by Gurinder pal Singh
segveris.blogspot.in
}
}
#making a text area
text .txt -width 50
pack .txt

Simple Button development without writing procedure

#!/bin/sh
# simpl_brrn.tcl \
exec tclsh "$0" ${1+"$@"}

button .exit_button -text "QUIT" -command exit
puts "The exit button text is: [.exit_button cget -text]"
puts "The exit button color is: [.exit_button cget -background]"

set clickButton [button .b1 -text "Please Click Me" \
-command {.b1 configure -text "I’ve been Clicked!"}]
pack .b1
pack .exit_button

List Box in tcl/tk

#!/bin/sh
# chk_btnn.tcl \
exec tclsh "$0" ${1+"$@"}
# Graphical User Interface :ListBox

proc insert_to_list {} {

#take the input of the entry

set input [ .ent get ]

#if { $input =""} {return}

#put input on the end of all listbox items

.lst insert end "$input"
}
proc delete_from_list {} {

#to delete the current selection

set selected_index [ .lst curselection]
if { $selected_index ==""} { return }
.lst delete $selected_index
.lst activate 0
}


listbox .lst -selectmode single ; # select mode can be single browse multiple or extend; the default value is browse


.lst insert end "student " "Teacher" "clerk" "Business Man"  "Common Man" "Computer Expert" "Others"


.lst configure -activestyle underline

.lst activate 1
entry .ent -textvariable text_ent
button .but1 -text "insert to list" -command "insert_to_list"
button .but2 -text "delete from list" -command "delete_from_list"
pack .lst
pack .ent
pack .but1
pack .but2

Sunday, 12 March 2017

How to Delete KMSPico Created Files from Registry


  • Open Registry by Typing Regedit in the Windows Search Field and then press on Enter.
  • This will open the registry entries. Now users need to press CTRL + F together and type KMSPico to find the entries.
  • Once located, delete all KMSPico named entries. If you are unable to find it, you need to look up for it on the directories manually. Be careful and delete only KMSPico entries, else it can damage your Windows Computer severely.
HKEY_CURRENT_USER—-Software—–Random Directory. 
HKEY_CURRENT_USER—-Software—Microsoft—-Windows—CurrentVersion—Run– Random
HKEY_CURRENT_USER—-Software—Microsoft—Internet Explorer—-Main—- Random

Wednesday, 1 March 2017

CheckBox and Radio button development and controlling

#!/bin/sh
# bttn_chk_rado.tcl \
exec tclsh "$0" ${1+"$@"}
proc push_button {} {
global selection
tk_messageBox -message "$selection!" -type ok
}

proc push_button2 { } {
global selection2
set selection {}
foreach value [array name selection2] {
if {$selection2($value)!= 0} {
set selection "$selection and $selection2($value)"
}
}
tk_messageBox -message "you chose $selection!" -type ok

}
proc toggle { } {
.chk1 toggle
}
set selection 0
frame .textarea -background red -borderwidth 2 -relief flat
for {set i 1} {$i <= 10} {incr i} {
radiobutton .rad$i -text "choice #$i" -variable selection -value "choice is $i"
pack .rad$i -in .textarea
}

frame .frmchk -background green -borderwidth 5 -relief groove
for {set i 1} {$i <= 10} {incr i} {
checkbutton .chk$i -text "choice #$i" -variable selection2($i) -onvalue "$i" -offvalue 0
pack .chk$i -in .frmchk
}

button .but -text "show selection radio button" -command "push_button"
button .but2 -text "show selection checkbox" -command "push_button2"
button .but3 -text "toggle the selection of checkbox #1" -command "toggle"

pack .textarea
pack .frmchk

pack .but
pack .but2
pack .but3