Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # the next line restarts using wish\
- exec wish "$0" "$@"
- if {![info exists vTcl(sourcing)]} {
- # Provoke name search
- catch {package require bogus-package-name}
- set packageNames [package names]
- package require Tk
- switch $tcl_platform(platform) {
- windows {
- option add *Button.padY 0
- }
- default {
- option add *Scrollbar.width 10
- option add *Scrollbar.highlightThickness 0
- option add *Scrollbar.elementBorderWidth 2
- option add *Scrollbar.borderWidth 2
- }
- }
- }
- #############################################################################
- # Visual Tcl v1.60 Project
- #
- #################################
- # VTCL LIBRARY PROCEDURES
- #
- if {![info exists vTcl(sourcing)]} {
- #############################################################################
- ## Library Procedure: Window
- proc ::Window {args} {
- ## This procedure may be used free of restrictions.
- ## Exception added by Christian Gavin on 08/08/02.
- ## Other packages and widget toolkits have different licensing requirements.
- ## Please read their license agreements for details.
- global vTcl
- foreach {cmd name newname} [lrange $args 0 2] {}
- set rest [lrange $args 3 end]
- if {$name == "" || $cmd == ""} { return }
- if {$newname == ""} { set newname $name }
- if {$name == "."} { wm withdraw $name; return }
- set exists [winfo exists $newname]
- switch $cmd {
- show {
- if {$exists} {
- wm deiconify $newname
- } elseif {[info procs vTclWindow$name] != ""} {
- eval "vTclWindow$name $newname $rest"
- }
- if {[winfo exists $newname] && [wm state $newname] == "normal"} {
- vTcl:FireEvent $newname <<Show>>
- }
- }
- hide {
- if {$exists} {
- wm withdraw $newname
- vTcl:FireEvent $newname <<Hide>>
- return}
- }
- iconify { if $exists {wm iconify $newname; return} }
- destroy { if $exists {destroy $newname; return} }
- }
- }
- #############################################################################
- ## Library Procedure: vTcl:DefineAlias
- proc ::vTcl:DefineAlias {target alias widgetProc top_or_alias cmdalias} {
- ## This procedure may be used free of restrictions.
- ## Exception added by Christian Gavin on 08/08/02.
- ## Other packages and widget toolkits have different licensing requirements.
- ## Please read their license agreements for details.
- global widget
- set widget($alias) $target
- set widget(rev,$target) $alias
- if {$cmdalias} {
- interp alias {} $alias {} $widgetProc $target
- }
- if {$top_or_alias != ""} {
- set widget($top_or_alias,$alias) $target
- if {$cmdalias} {
- interp alias {} $top_or_alias.$alias {} $widgetProc $target
- }
- }
- }
- #############################################################################
- ## Library Procedure: vTcl:DoCmdOption
- proc ::vTcl:DoCmdOption {target cmd} {
- ## This procedure may be used free of restrictions.
- ## Exception added by Christian Gavin on 08/08/02.
- ## Other packages and widget toolkits have different licensing requirements.
- ## Please read their license agreements for details.
- ## menus are considered toplevel windows
- set parent $target
- while {[winfo class $parent] == "Menu"} {
- set parent [winfo parent $parent]
- }
- regsub -all {\%widget} $cmd $target cmd
- regsub -all {\%top} $cmd [winfo toplevel $parent] cmd
- uplevel #0 [list eval $cmd]
- }
- #############################################################################
- ## Library Procedure: vTcl:FireEvent
- proc ::vTcl:FireEvent {target event {params {}}} {
- ## This procedure may be used free of restrictions.
- ## Exception added by Christian Gavin on 08/08/02.
- ## Other packages and widget toolkits have different licensing requirements.
- ## Please read their license agreements for details.
- ## The window may have disappeared
- if {![winfo exists $target]} return
- ## Process each binding tag, looking for the event
- foreach bindtag [bindtags $target] {
- set tag_events [bind $bindtag]
- set stop_processing 0
- foreach tag_event $tag_events {
- if {$tag_event == $event} {
- set bind_code [bind $bindtag $tag_event]
- foreach rep "\{%W $target\} $params" {
- regsub -all [lindex $rep 0] $bind_code [lindex $rep 1] bind_code
- }
- set result [catch {uplevel #0 $bind_code} errortext]
- if {$result == 3} {
- ## break exception, stop processing
- set stop_processing 1
- } elseif {$result != 0} {
- bgerror $errortext
- }
- break
- }
- }
- if {$stop_processing} {break}
- }
- }
- #############################################################################
- ## Library Procedure: vTcl:Toplevel:WidgetProc
- proc ::vTcl:Toplevel:WidgetProc {w args} {
- ## This procedure may be used free of restrictions.
- ## Exception added by Christian Gavin on 08/08/02.
- ## Other packages and widget toolkits have different licensing requirements.
- ## Please read their license agreements for details.
- if {[llength $args] == 0} {
- ## If no arguments, returns the path the alias points to
- return $w
- }
- set command [lindex $args 0]
- set args [lrange $args 1 end]
- switch -- [string tolower $command] {
- "setvar" {
- foreach {varname value} $args {}
- if {$value == ""} {
- return [set ::${w}::${varname}]
- } else {
- return [set ::${w}::${varname} $value]
- }
- }
- "hide" - "show" {
- Window [string tolower $command] $w
- }
- "showmodal" {
- ## modal dialog ends when window is destroyed
- Window show $w; raise $w
- grab $w; tkwait window $w; grab release $w
- }
- "startmodal" {
- ## ends when endmodal called
- Window show $w; raise $w
- set ::${w}::_modal 1
- grab $w; tkwait variable ::${w}::_modal; grab release $w
- }
- "endmodal" {
- ## ends modal dialog started with startmodal, argument is var name
- set ::${w}::_modal 0
- Window hide $w
- }
- default {
- uplevel $w $command $args
- }
- }
- }
- #############################################################################
- ## Library Procedure: vTcl:WidgetProc
- proc ::vTcl:WidgetProc {w args} {
- ## This procedure may be used free of restrictions.
- ## Exception added by Christian Gavin on 08/08/02.
- ## Other packages and widget toolkits have different licensing requirements.
- ## Please read their license agreements for details.
- if {[llength $args] == 0} {
- ## If no arguments, returns the path the alias points to
- return $w
- }
- set command [lindex $args 0]
- set args [lrange $args 1 end]
- uplevel $w $command $args
- }
- #############################################################################
- ## Library Procedure: vTcl:toplevel
- proc ::vTcl:toplevel {args} {
- ## This procedure may be used free of restrictions.
- ## Exception added by Christian Gavin on 08/08/02.
- ## Other packages and widget toolkits have different licensing requirements.
- ## Please read their license agreements for details.
- uplevel #0 eval toplevel $args
- set target [lindex $args 0]
- namespace eval ::$target {set _modal 0}
- }
- }
- if {[info exists vTcl(sourcing)]} {
- proc vTcl:project:info {} {
- set base .top32
- namespace eval ::widgets::$base {
- set set,origin 1
- set set,size 1
- set runvisible 1
- }
- set site_3_0 $base.fra33
- set site_3_0 $base.fra35
- set site_3_0 $base.fra45
- set site_4_0 $site_3_0.scr46
- #Updating ttreeview attributes
- .top32.fra45.scr46.01 configure\
- -columns Col1\
- -height 4\
- -xscrollcommand ".top32.fra45.scr46.02 set"\
- -yscrollcommand ".top32.fra45.scr46.03 set"\
- -takefocus ttk::takefocus
- #heading options.
- .top32.fra45.scr46.01 heading Col1 \
- -text Col1 \
- -anchor center
- #heading options.
- .top32.fra45.scr46.01 heading #0 \
- -text Tree \
- -anchor center
- # column options.
- .top32.fra45.scr46.01 column Col1 \
- -width 267 \
- -minwidth 20 \
- -stretch 1 \
- -anchor w
- # column options.
- .top32.fra45.scr46.01 column #0 \
- -width 266 \
- -minwidth 20 \
- -stretch 1 \
- -anchor w
- namespace eval ::widgets_bindings {
- set tagslist _TopLevel
- }
- namespace eval ::vTcl::modules::main {
- set procs {
- py:btnExitClick()
- py:btnGoClick()
- py:btnSearchPathClick()
- }
- set compounds {
- }
- set projectType single
- }
- }
- }
- #################################
- # USER DEFINED PROCEDURES
- #
- #############################################################################
- ## Procedure: py:btnExitClick()
- proc ::py:btnExitClick() {p1} {
- def btnExitClick(p1) :
- sys.exit()
- }
- #############################################################################
- ## Procedure: py:btnGoClick()
- proc ::py:btnGoClick() {p1} {
- def btnGoClick(p1) :
- pass
- }
- #############################################################################
- ## Procedure: py:btnSearchPathClick()
- proc ::py:btnSearchPathClick() {p1} {
- def btnSearchPathClick(p1) :
- pass
- }
- #################################
- # VTCL GENERATED GUI PROCEDURES
- #
- proc vTclWindow. {base} {
- if {$base == ""} {
- set base .
- }
- ###################
- # CREATING WIDGETS
- ###################
- wm focusmodel $top passive
- wm geometry $top 1x1+0+0; update
- wm maxsize $top 1665 1020
- wm minsize $top 1 1
- wm overrideredirect $top 0
- wm resizable $top 1 1
- wm withdraw $top
- wm title $top "page.tcl"
- bindtags $top "$top Page.tcl all"
- vTcl:FireEvent $top <<Create>>
- wm protocol $top WM_DELETE_WINDOW "vTcl:FireEvent $top <<DeleteWindow>>"
- ###################
- # SETTING GEOMETRY
- ###################
- vTcl:FireEvent $base <<Ready>>
- }
- proc vTclWindow.top32 {base} {
- if {$base == ""} {
- set base .top32
- }
- if {[winfo exists $base]} {
- wm deiconify $base; return
- }
- set top $base
- ###################
- # CREATING WIDGETS
- ###################
- vTcl:toplevel $top -class Toplevel
- wm focusmodel $top passive
- wm geometry $top 600x525+511+216; update
- wm maxsize $top 1665 1020
- wm minsize $top 1 1
- wm overrideredirect $top 0
- wm resizable $top 1 1
- wm deiconify $top
- wm title $top "Searcher"
- vTcl:DefineAlias "$top" "Searcher" vTcl:Toplevel:WidgetProc "" 1
- bindtags $top "$top Toplevel all _TopLevel"
- vTcl:FireEvent $top <<Create>>
- wm protocol $top WM_DELETE_WINDOW "vTcl:FireEvent $top <<DeleteWindow>>"
- frame $top.fra33 \
- -borderwidth 2 -relief groove -height 75 -highlightcolor black \
- -width 125
- vTcl:DefineAlias "$top.fra33" "Frame1" vTcl:WidgetProc "Searcher" 1
- set site_3_0 $top.fra33
- button $site_3_0.but34 \
- -text Exit
- vTcl:DefineAlias "$site_3_0.but34" "btnExit" vTcl:WidgetProc "Searcher" 1
- bind $site_3_0.but34 <Button-1> {
- btnExitClick
- }
- place $site_3_0.but34 \
- -in $site_3_0 -x 510 -y 20 -anchor nw -bordermode ignore
- frame $top.fra35 \
- -borderwidth 2 -relief groove -height 75 -highlightcolor black \
- -width 125
- vTcl:DefineAlias "$top.fra35" "Frame2" vTcl:WidgetProc "Searcher" 1
- set site_3_0 $top.fra35
- label $site_3_0.lab36 \
- -text Path:
- vTcl:DefineAlias "$site_3_0.lab36" "Label1" vTcl:WidgetProc "Searcher" 1
- entry $site_3_0.ent37 \
- -background white -insertbackground black -textvariable FilePath
- vTcl:DefineAlias "$site_3_0.ent37" "txtPath" vTcl:WidgetProc "Searcher" 1
- button $site_3_0.but38 \
- -text ...
- vTcl:DefineAlias "$site_3_0.but38" "btnSearchPath" vTcl:WidgetProc "Searcher" 1
- bind $site_3_0.but38 <Button-1> {
- btnSearchPathClick
- }
- checkbutton $site_3_0.che39 \
- -text .avi -variable VchkAVI
- vTcl:DefineAlias "$site_3_0.che39" "chkAVI" vTcl:WidgetProc "Searcher" 1
- checkbutton $site_3_0.che40 \
- -text .mkv -variable VchkMKV
- vTcl:DefineAlias "$site_3_0.che40" "chkMKV" vTcl:WidgetProc "Searcher" 1
- checkbutton $site_3_0.che41 \
- -text .mv4 -variable VchkMV4
- vTcl:DefineAlias "$site_3_0.che41" "chkMV4" vTcl:WidgetProc "Searcher" 1
- checkbutton $site_3_0.che42 \
- -text .mp3 -variable VchkMP3
- vTcl:DefineAlias "$site_3_0.che42" "chkMP3" vTcl:WidgetProc "Searcher" 1
- checkbutton $site_3_0.che43 \
- -text .ogg -variable VchkOGG
- vTcl:DefineAlias "$site_3_0.che43" "chkOGG" vTcl:WidgetProc "Searcher" 1
- button $site_3_0.but44 \
- -text GO!
- vTcl:DefineAlias "$site_3_0.but44" "btnGO" vTcl:WidgetProc "Searcher" 1
- bind $site_3_0.but44 <Button-1> {
- btnGoClick
- }
- place $site_3_0.lab36 \
- -in $site_3_0 -x 10 -y 10 -anchor nw -bordermode ignore
- place $site_3_0.ent37 \
- -in $site_3_0 -x 10 -y 30 -width 226 -height 21 -anchor nw \
- -bordermode ignore
- place $site_3_0.but38 \
- -in $site_3_0 -x 240 -y 30 -anchor nw -bordermode ignore
- place $site_3_0.che39 \
- -in $site_3_0 -x 50 -y 80 -anchor nw -bordermode ignore
- place $site_3_0.che40 \
- -in $site_3_0 -x 50 -y 100 -anchor nw -bordermode ignore
- place $site_3_0.che41 \
- -in $site_3_0 -x 50 -y 120 -anchor nw -bordermode ignore
- place $site_3_0.che42 \
- -in $site_3_0 -x 190 -y 100 -anchor nw -bordermode ignore
- place $site_3_0.che43 \
- -in $site_3_0 -x 190 -y 120 -anchor nw -bordermode ignore
- place $site_3_0.but44 \
- -in $site_3_0 -x 130 -y 150 -anchor nw -bordermode ignore
- frame $top.fra45 \
- -borderwidth 2 -relief groove -height 75 -highlightcolor black \
- -width 125
- vTcl:DefineAlias "$top.fra45" "Frame3" vTcl:WidgetProc "Searcher" 1
- set site_3_0 $top.fra45
- vTcl::widgets::ttk::scrolledtreeview::CreateCmd $site_3_0.scr46 \
- -width 125 -height 75
- vTcl:DefineAlias "$site_3_0.scr46" "Scrolledtreeview1" vTcl:WidgetProc "Searcher" 1
- place $site_3_0.scr46 \
- -in $site_3_0 -x 10 -y 10 -width 550 -height 254 -anchor nw \
- -bordermode ignore
- grid columnconf $site_3_0.scr46 0 -weight 1
- grid rowconf $site_3_0.scr46 0 -weight 1
- ###################
- # SETTING GEOMETRY
- ###################
- place $top.fra33 \
- -in $top -x 0 -y 0 -width 595 -height 55 -anchor nw \
- -bordermode ignore
- place $top.fra35 \
- -in $top -x 0 -y 60 -width 325 -height 185 -anchor nw \
- -bordermode ignore
- place $top.fra45 \
- -in $top -x 0 -y 250 -width 565 -height 265 -anchor nw \
- -bordermode ignore
- vTcl:FireEvent $base <<Ready>>
- }
- #############################################################################
- ## Binding tag: _TopLevel
- bind "_TopLevel" <<Create>> {
- if {![info exists _topcount]} {set _topcount 0}; incr _topcount
- }
- bind "_TopLevel" <<DeleteWindow>> {
- if {[set ::%W::_modal]} {
- vTcl:Toplevel:WidgetProc %W endmodal
- } else {
- destroy %W; if {$_topcount == 0} {exit}
- }
- }
- bind "_TopLevel" <Destroy> {
- if {[winfo toplevel %W] == "%W"} {incr _topcount -1}
- }
- Window show .
- Window show .top32
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement