IceBG

Publicado por Perfil removido 12/09/2006

[ Hits: 4.477 ]

Download icebg




IceBG utiliza a linguagem TCLl/TK e foi criado no visual-tcl (http://vtcl.sourceforge.net). Ele serve para alterar, modificar (expandir, centralizar, botar lado-a-lado) o seu fundo de tela no IceWM! Mais informações/screenshots em: http://www.geocities.com/ed2ef e download do último lançamento em: http://www.sourceforge.net/projects/icebg

  



Esconder código-fonte

#!/bin/sh
# the next line restarts using wish\
exec wish "$0" "$@" 

if {![info exists vTcl(sourcing)]} {

    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
    }
    ## The first argument is a switch, they must be doing a configure.
    if {[string index $args 0] == "-"} {
        set command configure
        ## There's only one argument, must be a cget.
        if {[llength $args] == 1} {
            set command cget
        }
    } else {
        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 .top59
    namespace eval ::widgets::$base {
        set set,origin 1
        set set,size 1
        set runvisible 1
    }
    namespace eval ::widgets::$base.fra61 {
        array set save {-borderwidth 1 -height 1 -relief 1 -width 1}
    }
    set site_3_0 $base.fra61
    namespace eval ::widgets::$site_3_0.cpd62 {
        array set save {-highlightcolor 1 -text 1 -width 1}
    }
    namespace eval ::widgets::$site_3_0.fra65 {
        array set save {-borderwidth 1 -height 1 -relief 1 -width 1}
    }
    set site_4_0 $site_3_0.fra65
    namespace eval ::widgets::$site_4_0.ent66 {
        array set save {-background 1 -insertbackground 1 -textvariable 1}
    }
    namespace eval ::widgets::$site_4_0.but67 {
        array set save {-command 1 -text 1}
    }
    namespace eval ::widgets::$site_3_0.lab60 {
        array set save {-foreground 1 -highlightcolor 1 -text 1}
    }
    set site_4_0 $site_3_0.lab60
    namespace eval ::widgets::$site_4_0.rad61 {
        array set save {-command 1 -text 1 -value 1 -variable 1}
    }
    namespace eval ::widgets::$site_4_0.rad62 {
        array set save {-command 1 -text 1 -value 1 -variable 1}
    }
    namespace eval ::widgets::$base.but63 {
        array set save {-command 1 -text 1}
    }
    namespace eval ::widgets::$base.but64 {
        array set save {-command 1 -text 1}
    }
    set base .top69
    namespace eval ::widgets::$base {
        set set,origin 1
        set set,size 1
        set runvisible 1
    }
    namespace eval ::widgets::$base.can70 {
        array set save {-borderwidth 1 -closeenough 1 -height 1 -insertbackground 1 -relief 1 -selectbackground 1 -selectforeground 1 -width 1}
    }
    namespace eval ::widgets::$base.m72 {
        array set save {-tearoff 1}
        namespace eval subOptions {
            array set save {-command 1 -label 1 -menu 1}
        }
    }
    set site_3_0 $base.m72
    namespace eval ::widgets::$site_3_0.men73 {
        array set save {-tearoff 1}
        namespace eval subOptions {
            array set save {-command 1 -label 1 -menu 1 -variable 1}
        }
    }
    set site_3_0 $base.m72
    namespace eval ::widgets::$site_3_0.men68 {
        array set save {-tearoff 1}
        namespace eval subOptions {
            array set save {-command 1 -label 1 -menu 1}
        }
    }
    set site_4_0 $site_3_0.men68
    namespace eval ::widgets::$site_4_0.men69 {
        array set save {-tearoff 1}
        namespace eval subOptions {
            array set save {-command 1 -label 1 -value 1 -variable 1}
        }
    }
    namespace eval ::widgets::$base.fra74 {
        array set save {-borderwidth 1 -height 1 -relief 1 -width 1}
    }
    set site_3_0 $base.fra74
    namespace eval ::widgets::$site_3_0.lis75 {
        array set save {-background 1 -listvariable 1 -xscrollcommand 1 -yscrollcommand 1}
    }
    namespace eval ::widgets::$site_3_0.scr76 {
        array set save {-command 1}
    }
    namespace eval ::widgets::$site_3_0.scr77 {
        array set save {-command 1 -orient 1}
    }
    set base .top70
    namespace eval ::widgets::$base {
        set set,origin 1
        set set,size 1
        set runvisible 0
    }
    namespace eval ::widgets::$base.lab71 {
        array set save {-foreground 1 -highlightcolor 1 -text 1}
    }
    set site_3_0 $base.lab71
    namespace eval ::widgets::$site_3_0.rad73 {
        array set save {-text 1 -value 1 -variable 1}
    }
    namespace eval ::widgets::$site_3_0.rad74 {
        array set save {-text 1 -value 1 -variable 1}
    }
    namespace eval ::widgets::$site_3_0.rad75 {
        array set save {-text 1 -value 1 -variable 1}
    }
    namespace eval ::widgets::$base.lab72 {
        array set save {-borderwidth 1 -foreground 1 -height 1 -highlightcolor 1 -relief 1 -text 1 -width 1}
    }
    set site_3_0 $base.lab72
    namespace eval ::widgets::$site_3_0.rad76 {
        array set save {-text 1 -value 1 -variable 1}
    }
    namespace eval ::widgets::$site_3_0.rad77 {
        array set save {-text 1 -value 1 -variable 1}
    }
    namespace eval ::widgets::$base.but78 {
        array set save {-command 1 -text 1}
    }
    namespace eval ::widgets::$base.but69 {
        array set save {-command 1 -text 1}
    }
    set base .top71
    namespace eval ::widgets::$base {
        set set,origin 1
        set set,size 1
        set runvisible 1
    }
    namespace eval ::widgets::$base.fra72 {
        array set save {-borderwidth 1 -height 1 -highlightcolor 1 -relief 1 -width 1}
    }
    set site_3_0 $base.fra72
    namespace eval ::widgets::$site_3_0.lab73 {
        array set save {-foreground 1 -highlightcolor 1 -text 1}
    }
    set site_4_0 $site_3_0.lab73
    namespace eval ::widgets::$site_4_0.lis74 {
        array set save {-background 1 -foreground 1 -highlightcolor 1 -listvariable 1 -selectbackground 1 -selectforeground 1 -xscrollcommand 1 -yscrollcommand 1}
    }
    namespace eval ::widgets::$site_4_0.scr75 {
        array set save {-activebackground 1 -command 1 -highlightcolor 1 -orient 1 -troughcolor 1 -width 1}
    }
    namespace eval ::widgets::$site_4_0.scr76 {
        array set save {-activebackground 1 -command 1 -highlightcolor 1 -troughcolor 1 -width 1}
    }
    namespace eval ::widgets::$site_3_0.but77 {
        array set save {-activebackground 1 -activeforeground 1 -command 1 -foreground 1 -highlightcolor 1 -text 1}
    }
    namespace eval ::widgets::$site_3_0.but78 {
        array set save {-activebackground 1 -activeforeground 1 -command 1 -foreground 1 -highlightcolor 1 -text 1}
    }
    namespace eval ::widgets::$base.but79 {
        array set save {-command 1 -text 1}
    }
    namespace eval ::widgets_bindings {
        set tagslist _TopLevel
    }
    namespace eval ::vTcl::modules::main {
        set procs {
            init
            main
        }
        set compounds {
        }
        set projectType single
    }
}
}

#################################
# USER DEFINED PROCEDURES
#
#############################################################################
## Procedure:  main

proc ::main {argc argv} {
#------------------------------------------------------------------------------------
# Procura Os Arquivos...
#------------------------------------------------------------------------------------
set HOME [exec env | sed -n "/HOME=/p" | sed "/.*.HOME/d" | sed "s/HOME=//"]
set config [file exist $HOME/.icebg/config]
set lingua [file exist $HOME/.icebg/lingua]
if { "$config" == "1"  && "$lingua" == "1" } {set pasta [exec cat $HOME/.icebg/config]
    set lingua [exec cat $HOME/.icebg/lingua]
    if { "$lingua" == "ptbr" } {.top69.m72.men68.men69 invoke 0} {.top69.m72.men68.men69 invoke 1}
    set bg []
    if { "$pasta" != "" } {foreach A $pasta {
    set bg2 [concat [exec find $A -name "*.jpg" -or -name "*.png" -or -name "*.bmp" -or -name "*.xpm" -or -name "*.gif" -or -name "*.jpeg" | sed s/^/"/ | sed s/$/"/]]
    set bg [concat "$bg\n$bg2"]}
#------------------------------------------------------------------------------------
# Variavel Da Caixa De Lista....
#------------------------------------------------------------------------------------
        Toplevel1 setvar bgs [concat $bg]
        Window show .top69}} {set idioma [exec echo [exec env | sed -n "/LANG=/p" | sed "s/LANG=//"] | sed "s/[subst -nocommands {[^pt]}].*.//"]
        if { "$idioma" == "pt" } {Toplevel2 setvar selectedButton [concat ptbr]
            Toplevel1 setvar menuSelectedButton [concat ptbr]
            .top69.m72.men68.men69 invoke 0} {Toplevel2 setvar selectedButton [concat en]
            Toplevel1 setvar menuSelectedButton [concat en]
            .top69.m72.men68.men69 invoke 1}
        Window show .top59}
}

#############################################################################
## Initialization Procedure:  init

proc ::init {argc argv} {

}

init $argc $argv

#################################
# 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 785 570
    wm minsize $top 1 1
    wm overrideredirect $top 0
    wm resizable $top 1 1
    wm withdraw $top
    wm title $top "vtcl.tcl"
    bindtags $top "$top Vtcl.tcl all"
    vTcl:FireEvent $top <<Create>>
    wm protocol $top WM_DELETE_WINDOW "vTcl:FireEvent $top <<DeleteWindow>>"

    ###################
    # SETTING GEOMETRY
    ###################

    vTcl:FireEvent $base <<Ready>>
}

proc vTclWindow.top59 {base} {
    if {$base == ""} {
        set base .top59
    }
    if {[winfo exists $base]} {
        wm deiconify $base; return
    }
    set top $base
    ###################
    # CREATING WIDGETS
    ###################
    vTcl:toplevel $top -class Toplevel \
        -highlightcolor black 
    wm withdraw $top
    wm focusmodel $top passive
    wm geometry $top 339x185+247+250; update
    wm maxsize $top 785 570
    wm minsize $top 1 1
    wm overrideredirect $top 0
    wm resizable $top 1 1
    wm title $top "Diretorio Default...."
    vTcl:DefineAlias "$top" "Toplevel2" 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.fra61 \
        -borderwidth 2 -relief groove -height 145 -width 330 
    vTcl:DefineAlias "$top.fra61" "Frame1" vTcl:WidgetProc "Toplevel2" 1
    set site_3_0 $top.fra61
    message $site_3_0.cpd62 \
        -highlightcolor black \
        -text {Digite O diretorio Padrão Do IceBG.Você Poderá Posteriormente Modificar O Diretorio Default ou Adicionar Mais Outros...} \
        -width 314 
    vTcl:DefineAlias "$site_3_0.cpd62" "Message1" vTcl:WidgetProc "Toplevel2" 1
    frame $site_3_0.fra65 \
        -borderwidth 2 -relief groove -height 30 -width 320 
    vTcl:DefineAlias "$site_3_0.fra65" "Frame2" vTcl:WidgetProc "Toplevel2" 1
    set site_4_0 $site_3_0.fra65
    entry $site_4_0.ent66 \
        -background white -insertbackground black \
        -textvariable "$top\::ent66" 
    vTcl:DefineAlias "$site_4_0.ent66" "Entry1" vTcl:WidgetProc "Toplevel2" 1
    button $site_4_0.but67 \
        \
        -command {set pasta [tk_chooseDirectory]
Toplevel2 setvar ent66 [concat $pasta]} \
        -text ... 
    vTcl:DefineAlias "$site_4_0.but67" "Button3" vTcl:WidgetProc "Toplevel2" 1
    place $site_4_0.ent66 \
        -in $site_4_0 -x 5 -y 5 -width 268 -height 22 -anchor nw \
        -bordermode ignore 
    place $site_4_0.but67 \
        -in $site_4_0 -x 280 -y 5 -width 34 -height 21 -anchor nw \
        -bordermode ignore 
    labelframe $site_3_0.lab60 \
        -foreground black -text Idioma -highlightcolor black 
    vTcl:DefineAlias "$site_3_0.lab60" "Labelframe1" vTcl:WidgetProc "Toplevel2" 1
    set site_4_0 $site_3_0.lab60
    radiobutton $site_4_0.rad61 \
        -command {.top69.m72.men68.men69 invoke 0} -text Portugues(Brasil) \
        -value ptbr -variable "$top\::selectedButton" 
    vTcl:DefineAlias "$site_4_0.rad61" "Radiobutton1" vTcl:WidgetProc "Toplevel2" 1
    radiobutton $site_4_0.rad62 \
        -command {.top69.m72.men68.men69 invoke 1} -text English -value en \
        -variable "$top\::selectedButton" 
    vTcl:DefineAlias "$site_4_0.rad62" "Radiobutton2" vTcl:WidgetProc "Toplevel2" 1
    place $site_4_0.rad61 \
        -in $site_4_0 -x 10 -y 20 -anchor nw -bordermode ignore 
    place $site_4_0.rad62 \
        -in $site_4_0 -x 160 -y 20 -width 153 -height 22 -anchor nw \
        -bordermode ignore 
    place $site_3_0.cpd62 \
        -in $site_3_0 -x 5 -y 5 -width 314 -height 45 -anchor nw \
        -bordermode inside 
    place $site_3_0.fra65 \
        -in $site_3_0 -x 5 -y 55 -width 320 -height 30 -anchor nw \
        -bordermode ignore 
    place $site_3_0.lab60 \
        -in $site_3_0 -x 5 -y 90 -width 321 -height 51 -anchor nw \
        -bordermode ignore 
    button $top.but63 \
        \
        -command {set HOME [concat $env(HOME)]
set pasta [Toplevel2 setvar ent66]
if { "$pasta" != "" } {exec mkdir -p $HOME/.icebg
exec echo "$pasta" > $HOME/.icebg/config
exec echo "[Toplevel2 setvar selectedButton]" > $HOME/.icebg/lingua
set config [file exist $HOME/.icebg/config]
set pasta [exec cat $HOME/.icebg/config]
set jpg [exec find $pasta -name *.jpg]
set png [exec find $pasta -name *.png | sed s/^/"/ | sed s/$/"/ ]
set bmp [exec find $pasta -name *.bmp | sed s/^/"/ | sed s/$/"/ ]
set xpm [exec find $pasta -name *.xpm | sed s/^/"/ | sed s/$/"/ ]
set gif [exec find $pasta -name *.gif | sed s/^/"/ | sed s/$/"/ ]
set jpeg [exec find $pasta -name *.jpeg | sed s/^/"/ | sed s/$/"/ ]
#------------------------------------------------------------------------------------
# Variavel Da Caixa De Lista....
#------------------------------------------------------------------------------------
Toplevel1 setvar bgs [concat $jpg $png $bmp $xpm $gif $jpeg]
Window hide .top59
Window show .top69} { tk_messageBox -icon error -title "Erro" -message "Por Favor Entre Com Um Diretorio Padrão Inicial!\nComo Ja Lhe Foi Dito,Este Posteriormente Poderá Ser Modificado Ou Removido!"}} \
        -text Adicionar 
    vTcl:DefineAlias "$top.but63" "Button1" vTcl:WidgetProc "Toplevel2" 1
    button $top.but64 \
        -command {Window hide .top59} -text Sair 
    vTcl:DefineAlias "$top.but64" "Button2" vTcl:WidgetProc "Toplevel2" 1
    ###################
    # SETTING GEOMETRY
    ###################
    place $top.fra61 \
        -in $top -x 5 -y 5 -width 330 -height 145 -anchor nw \
        -bordermode ignore 
    place $top.but63 \
        -in $top -x 260 -y 155 -anchor nw -bordermode ignore 
    place $top.but64 \
        -in $top -x 5 -y 155 -anchor nw -bordermode ignore 

    vTcl:FireEvent $base <<Ready>>
}

proc vTclWindow.top69 {base} {
    if {$base == ""} {
        set base .top69
    }
    if {[winfo exists $base]} {
        wm deiconify $base; return
    }
    set top $base
    ###################
    # CREATING WIDGETS
    ###################
    vTcl:toplevel $top -class Toplevel \
        -menu "$top.m72" -highlightcolor black 
    wm focusmodel $top passive
    wm geometry $top 263x260+281+111; update
    wm maxsize $top 785 570
    wm minsize $top 1 1
    wm overrideredirect $top 0
    wm resizable $top 1 1
    wm deiconify $top
    wm title $top "IceBG By Ed2!"
    vTcl:DefineAlias "$top" "Toplevel1" vTcl:Toplevel:WidgetProc "" 1
    bindtags $top "$top Toplevel all _TopLevel"
    vTcl:FireEvent $top <<Create>>
    wm protocol $top WM_DELETE_WINDOW "vTcl:FireEvent $top <<DeleteWindow>>"

    canvas $top.can70 \
        -borderwidth 2 -closeenough 1.0 -height 135 -insertbackground black \
        -relief ridge -selectbackground #c4c4c4 -selectforeground black \
        -width 137 
    vTcl:DefineAlias "$top.can70" "imagem" vTcl:WidgetProc "Toplevel1" 1
    menu $top.m72 \
        -tearoff 1 
    $top.m72 add cascade \
        -menu "$top.m72.men73" -command {} -label Menu 
    set site_3_0 $top.m72
    menu $site_3_0.men73 \
        -tearoff 0 
    $site_3_0.men73 add command \
        \
        -command {set pasta [exec env | sed -n "/HOME/p" | sed "/.*.HOME/d" | sed "s/HOME=//"]
set existe [file exist $pasta/.icewm/prefoverride]
if { $existe == 0 } { .top70.lab72.rad77 select }
if { $existe == 1 } {set procura [exec sed -n "/DesktopBackgroundImage=/p" $pasta/.icewm/prefoverride]
    if { $procura == "" } { .top70.lab72.rad77 select }
    if { $procura != "" } { .top70.lab72.rad76 select }}
set centralizado [exec sed -n "/DesktopBackgroundCenter=/p" $pasta/.icewm/preferences | sed "s/DesktopBackgroundCenter=//"]
set expandido [exec sed -n "/DesktopBackgroundScaled=/p" $pasta/.icewm/preferences | sed "s/DesktopBackgroundScaled=//"]
if { $expandido == 1 } {.top70.lab71.rad73 select}
if { $centralizado == 1 } {.top70.lab71.rad74 select}
if { $centralizado == 0 && $expandido == 0 } {.top70.lab71.rad75 select}
if { $centralizado == "" && $expandido == "" } {.top70.lab71.rad75 select}
Window show .top70} \
        -label Salvar/Modificar 
    $site_3_0.men73 add separator \
        
    $site_3_0.men73 add command \
        \
        -command {#-------------------------------------------------------------
set HOME [exec env | sed -n "/HOME/p" | sed "/.*.HOME/d" | sed "s/HOME=//"]
set pasta [tk_chooseDirectory]
set config [file exist $HOME/.icebg/config]
if { "$config" == "1" } {set pasta2 [regsub -all {/} "$pasta" {\/}]
    set ver [exec cat $HOME/.icebg/config | sed "/$pasta2.*./d" |sed -n "/$pasta2/p"]
    if { "$ver" == "" } {exec echo "$pasta" >> $HOME/.icebg/config
        set arquivo []
        foreach A [exec cat $HOME/.icebg/config] {
            set arquivo2 [exec find "$A" -name "*.jpg" -or -name "*.png" -or -name "*.bmp" -or -name "*.xpm" -or -name "*.gif" -or -name "*.jpeg" | sed s/^/"/ | sed s/$/"/]
            set arquivo [concat "$arquivo\n$arquivo2"]
            }
        Toplevel1 setvar bgs [concat "$arquivo"]} {tk_messageBox -icon error -title "Erro" -message "A Pasta $pasta Ja Existe Em Seu Config..\nPor Favor Adicione Outra"}}} \
        -label {Adicionar Pasta} 
    $site_3_0.men73 add command \
        \
        -command {#-----------------------------------------------------------------
set l $widget(lista)
#-----------------------------------------------------------------
set tipos {
    {{Arquivo JPG}    {.jpg .jpeg}}
    {{Arquivo GIF}    {.gif}}
    {{Arquivo PNG}    {.png}}
    {{Arquivo BMP}    {.bmp}}
    {{Arquivo XPM}    {.xpm}}
    {{Todos Arquivos}    *}
    }
#-----------------------------------------------------------------
set arq [ tk_getOpenFile -filetypes $tipos]
#-----------------------------------------------------------------
$l insert end $arq} \
        -label {Adicionar Arquivo} 
    $site_3_0.men73 add separator \
        
    $site_3_0.men73 add command \
        -command {exec icewmbg -r &
exec killall idesk
exec idesk &} \
        -label {Atualizar Fundo de Tela} 
    $site_3_0.men73 add separator \
        
    $site_3_0.men73 add command \
        -command exit -label Sair 
    $top.m72 add cascade \
        -menu "$top.m72.men68" -command {} -label Outros 
    set site_3_0 $top.m72
    menu $site_3_0.men68 \
        -tearoff 0 
    $site_3_0.men68 add cascade \
        -menu "$site_3_0.men68.men69" -command {} -label Idioma 
    set site_4_0 $site_3_0.men68
    menu $site_4_0.men69 \
        -tearoff 0 
    $site_4_0.men69 add radiobutton \
        -value ptbr -variable "$top\::menuSelectedButton" \
        -command {# TODO: Your menu handler here
#-----------------------------------------------------------------------------------------
# Escreve o arquivo lingua
#-----------------------------------------------------------------------------------------
set HOME [concat $env(HOME)]
exec mkdir -p $HOME/.icebg
exec echo "ptbr" > $HOME/.icebg/lingua
#----------------------------------------------------------------------------------------------------------------------------------------------
# Janela De Criaçao Do Diretorio E Ajuste Da Lingua
#-----------------------------------------------------------------------------------------
# Modifica Botões
#-------------------------------------------------------------------
.top59.but63 configure -text "Adicionar"
.top59.but64 configure -text "Sair"
#-------------------------------------------------------------------
# Modifica Rotulos Do Frame
#-------------------------------------------------------------------
.top59.fra61.lab60 configure -text "Idioma"
#-------------------------------------------------------------------
# Modifica Rotulo
#-------------------------------------------------------------------
.top59.fra61.cpd62 configure -text {Digite O diretorio Padrão Do IceBG.Você Poderá Posteriormente Modificar O Diretorio Default ou Adicionar Mais Outros...}
#-----------------------------------------------------------------------------------------
# Modifica Os Menus
#-----------------------------------------------------------------------------------------
.top69.m72 entryconfigure 3 -label "Sobre"
.top69.m72 entryconfigure 2 -label "Outros"
#-----------------------------------------------------------------------------------------
# Modifica Os Sub-Menus
#-----------------------------------------------------------------------------------------
# Primeiro
#-------------------------------------------------------------------
.top69.m72.men73 entryconfigure 0 -label "Salvar/Modificar"
.top69.m72.men73 entryconfigure 2 -label "Adicionar Pasta"
.top69.m72.men73 entryconfigure 3 -label "Adicionar Arquivo"
.top69.m72.men73 entryconfigure 5 -label "Atualizar Fundo de Tela"
.top69.m72.men73 entryconfigure 7 -label "Sair"
#-------------------------------------------------------------------
# Segundo
#-------------------------------------------------------------------
.top69.m72.men68 entryconfigure 0 -label "Idioma"
.top69.m72.men68 entryconfigure 1 -label "Organizar Diretorios"
#----------------------------------------------------------------------------------------------------------------------------------------------
# Janela Do Salvar/Modificar
#-----------------------------------------------------------------------------------------
# Modifica Botões
#-------------------------------------------------------------------
.top70.but69 configure -text "Cancelar"
#-------------------------------------------------------------------
# Modifica Rotulos Dos Frames
#-------------------------------------------------------------------
.top70.lab72 configure -text "Hierarquia Do Fundo de Tela:"
.top70.lab71 configure -text "Posiçao do Fundo de Tela:"
#-------------------------------------------------------------------
# Modifica Os Rotulos Dos Radiobutton
#-------------------------------------------------------------------
.top70.lab72.rad76 configure -text {Fundo de Tela Padrão.Será
escrito no .icewm/prefoverride}
.top70.lab72.rad77 configure -text {Fundo de Tela não-padrão.Será
escrito no .icewm/preferences}
.top70.lab71.rad73 configure -text {Expandido}
.top70.lab71.rad74 configure -text {Centralizado}
.top70.lab71.rad75 configure -text {Lado A Lado}
#----------------------------------------------------------------------------------------------------------------------------------------------
# Janela Organizar Diretorios
#-----------------------------------------------------------------------------------------
# Modifica Botões
#-------------------------------------------------------------------
.top71.but79 configure -text "Sair"
.top71.fra72.but77 configure -text "Adicionar"
.top71.fra72.but78 configure -text "Deletar"
#-------------------------------------------------------------------
# Modifica Rotulos Dos Frames
#-------------------------------------------------------------------
.top71.fra72.lab73 configure -text "Diretorios"} \
        -label Portugues(Brasil) 
    $site_4_0.men69 add radiobutton \
        -value en -variable "$top\::menuSelectedButton" \
        -command {# TODO: Your menu handler here
#-----------------------------------------------------------------------------------------
# Escreve o arquivo lingua
#-----------------------------------------------------------------------------------------
set HOME [concat $env(HOME)]
exec mkdir -p $HOME/.icebg
exec echo "en" > $HOME/.icebg/lingua
#----------------------------------------------------------------------------------------------------------------------------------------------
# Janela De Criaçao Do Diretorio E Ajuste Da Lingua
#-----------------------------------------------------------------------------------------
# Modifica Botões
#-------------------------------------------------------------------
.top59.but63 configure -text "Add"
.top59.but64 configure -text "Exit"
#-------------------------------------------------------------------
# Modifica Rotulos Do Frame
#-------------------------------------------------------------------
.top59.fra61.lab60 configure -text "Language"
#-------------------------------------------------------------------
# Modifica Rotulo
#-------------------------------------------------------------------
.top59.fra61.cpd62 configure -text {Type the name of the default directory of IceBG. Note that you Can later change this directory or even add more others to incrise the database!}
#----------------------------------------------------------------------------------------------------------------------------------------------
# Janela Incial/Principal
#-----------------------------------------------------------------------------------------
# Modifica Os Menus
#-----------------------------------------------------------------------------------------
.top69.m72 entryconfigure 3 -label "About"
.top69.m72 entryconfigure 2 -label "Others"
#-----------------------------------------------------------------------------------------
# Modifica Os Sub-Menus
#-----------------------------------------------------------------------------------------
# Primeiro
#-------------------------------------------------------------------
.top69.m72.men73 entryconfigure 0 -label "Save/Modify"
.top69.m72.men73 entryconfigure 2 -label "Add Folder"
.top69.m72.men73 entryconfigure 3 -label "Add File"
.top69.m72.men73 entryconfigure 5 -label "Refresh Background"
.top69.m72.men73 entryconfigure 7 -label "Exit"
#-------------------------------------------------------------------
# Segundo
#-------------------------------------------------------------------
.top69.m72.men68 entryconfigure 0 -label "Language"
.top69.m72.men68 entryconfigure 1 -label "Manage Directories"
#----------------------------------------------------------------------------------------------------------------------------------------------
# Janela Do Salvar/Modificar
#-----------------------------------------------------------------------------------------
# Modifica Botões
#-------------------------------------------------------------------
.top70.but69 configure -text "Cancel"
#-------------------------------------------------------------------
# Modifica Rotulos Dos Frames
#-------------------------------------------------------------------
.top70.lab72 configure -text "Background Hierarchy"
.top70.lab71 configure -text "Background Position"
#-------------------------------------------------------------------
# Modifica Os Rotulos Dos Radiobutton
#-------------------------------------------------------------------
.top70.lab72.rad76 configure -text {Default Background.It will be wrote
in .icewm/prefoverride}
.top70.lab72.rad77 configure -text {Non-Default Background.It will be  
wrote in .icewm/preferences}
.top70.lab71.rad73 configure -text {Scaled}
.top70.lab71.rad74 configure -text {Centered}
.top70.lab71.rad75 configure -text {Side by Side}
#----------------------------------------------------------------------------------------------------------------------------------------------
# Janela Organizar Diretorios
#-----------------------------------------------------------------------------------------
# Modifica Botões
#-------------------------------------------------------------------
.top71.but79 configure -text "Exit"
.top71.fra72.but77 configure -text "Add"
.top71.fra72.but78 configure -text "Delete"
#-------------------------------------------------------------------
# Modifica Rotulos Dos Frames
#-------------------------------------------------------------------
.top71.fra72.lab73 configure -text "Directories"} \
        -label English 
    $site_3_0.men68 add command \
        \
        -command {# TODO: Your menu handler here
set HOME [concat $env(HOME)]
set lista [exec cat $HOME/.icebg/config]
Listadir delete -1 end
foreach I $lista {
    Listadir insert end $I
}
Window show .top71} \
        -label {Organizar Diretorios} 
    $top.m72 add command \
        \
        -command [list vTcl:DoCmdOption $top.m72 {if { [Toplevel1 setvar menuSelectedButton] == "ptbr" } {tk_messageBox -title "Sobre O IceBG" -message {IceBG Eh Um Produto 100% Brasileiro[<o>], Feito Por
Eduardo Fagundes Filippo!
Criticas,Sugestões,Duvidas Mande Um E-mail Para:
ed2ef@yahoo.com.br
ou
Via Orkut:
http://www.orkut.com/Profile.aspx?uid=18406490453974940886}} {tk_messageBox -title "About IceBG" -message {IceBG Is A Product 100% Brazilian [<o>], Made By
Eduardo Fagundes Filippo!
Critics,Suggestions,Doubts Send A E-mail To:
ed2ef@yahoo.com.br
or
Scrap On Orkut:
http://www.orkut.com/Profile.aspx?uid=18406490453974940886}}}] \
        -label Sobre 
    frame $top.fra74 \
        -borderwidth 2 -relief groove -height 110 -width 255 
    vTcl:DefineAlias "$top.fra74" "Frame1" vTcl:WidgetProc "Toplevel1" 1
    set site_3_0 $top.fra74
    listbox $site_3_0.lis75 \
        -background white -xscrollcommand "$site_3_0.scr77 set" \
        -yscrollcommand "$site_3_0.scr76 set" -listvariable "$top\::bgs" 
    vTcl:DefineAlias "$site_3_0.lis75" "lista" vTcl:WidgetProc "Toplevel1" 1
    bind $site_3_0.lis75 <Double-Button-1> {
        #----------------------------------------------------------------
# VARIAVEIS                                                      |
#----------------------------------------------------------------
set l $widget(lista)
set i $widget(imagem)
set HOME [concat $env(HOME)]
#----------------------------------------------------------------
# Limpar Tela:                                                   |
#----------------------------------------------------------------
$i delete all
#----------------------------------------------------------------
# Imagem:                                                        |
#----------------------------------------------------------------
set ic [$l get active]
set ico [regsub -all {,} $ic { }]
set ident [exec identify $ico]
set identi [regsub -all $ico $ident {}]
set troca [regsub -all { } $identi ,]
set tamanho [exec echo $troca | cut -d, -f3]
set foto [exec convert -size $tamanho tile:$ico -resize 130x150 $HOME/.icebg/foto.gif]
set object [image create photo -file $HOME/.icebg/foto.gif]
$i create image 70 70 -image $object
exec rm $HOME/.icebg/foto.gif
    }
    scrollbar $site_3_0.scr76 \
        -command "$site_3_0.lis75 yview" 
    vTcl:DefineAlias "$site_3_0.scr76" "Scrollbar1" vTcl:WidgetProc "Toplevel1" 1
    scrollbar $site_3_0.scr77 \
        -command "$site_3_0.lis75 xview" -orient horizontal 
    vTcl:DefineAlias "$site_3_0.scr77" "Scrollbar2" vTcl:WidgetProc "Toplevel1" 1
    place $site_3_0.lis75 \
        -in $site_3_0 -x 5 -y 5 -width 233 -height 86 -anchor nw \
        -bordermode ignore 
    place $site_3_0.scr76 \
        -in $site_3_0 -x 235 -y 5 -width 16 -height 87 -anchor nw \
        -bordermode ignore 
    place $site_3_0.scr77 \
        -in $site_3_0 -x 5 -y 90 -width 232 -height 16 -anchor nw \
        -bordermode ignore 
    ###################
    # SETTING GEOMETRY
    ###################
    place $top.can70 \
        -in $top -x 60 -y 5 -width 137 -height 135 -anchor nw \
        -bordermode ignore 
    place $top.fra74 \
        -in $top -x 5 -y 145 -width 255 -height 110 -anchor nw \
        -bordermode ignore 

    vTcl:FireEvent $base <<Ready>>
}

proc vTclWindow.top70 {base} {
    if {$base == ""} {
        set base .top70
    }
    if {[winfo exists $base]} {
        wm deiconify $base; return
    }
    set top $base
    ###################
    # CREATING WIDGETS
    ###################
    vTcl:toplevel $top -class Toplevel \
        -highlightcolor black 
    wm withdraw $top
    wm focusmodel $top passive
    wm geometry $top 256x210+281+173; update
    wm maxsize $top 785 570
    wm minsize $top 1 1
    wm overrideredirect $top 0
    wm resizable $top 1 1
    wm title $top "Configurar..."
    vTcl:DefineAlias "$top" "Toplevel3" vTcl:Toplevel:WidgetProc "" 1
    bindtags $top "$top Toplevel all _TopLevel"
    vTcl:FireEvent $top <<Create>>
    wm protocol $top WM_DELETE_WINDOW "vTcl:FireEvent $top <<DeleteWindow>>"

    labelframe $top.lab71 \
        -foreground black -text {Posiçao do Fundo de Tela:} \
        -highlightcolor black 
    vTcl:DefineAlias "$top.lab71" "Labelframe1" vTcl:WidgetProc "Toplevel3" 1
    set site_3_0 $top.lab71
    radiobutton $site_3_0.rad73 \
        -text Expandido -value expandido -variable "$top\::selectedButton2" 
    vTcl:DefineAlias "$site_3_0.rad73" "exp" vTcl:WidgetProc "Toplevel3" 1
    radiobutton $site_3_0.rad74 \
        -text Centralizado -value centralizado \
        -variable "$top\::selectedButton2" 
    vTcl:DefineAlias "$site_3_0.rad74" "cen" vTcl:WidgetProc "Toplevel3" 1
    radiobutton $site_3_0.rad75 \
        -text {Lado A Lado} -value ladoalado \
        -variable "$top\::selectedButton2" 
    vTcl:DefineAlias "$site_3_0.rad75" "lado" vTcl:WidgetProc "Toplevel3" 1
    place $site_3_0.rad73 \
        -in $site_3_0 -x 10 -y 20 -anchor nw -bordermode ignore 
    place $site_3_0.rad74 \
        -in $site_3_0 -x 10 -y 40 -anchor nw -bordermode ignore 
    place $site_3_0.rad75 \
        -in $site_3_0 -x 10 -y 60 -anchor nw -bordermode ignore 
    labelframe $top.lab72 \
        -borderwidth 2 -foreground black -relief groove \
        -text {Hierarquia Do Fundo de Tela:} -height 0 -highlightcolor black \
        -width 0 
    vTcl:DefineAlias "$top.lab72" "Labelframe2" vTcl:WidgetProc "Toplevel3" 1
    set site_3_0 $top.lab72
    radiobutton $site_3_0.rad76 \
        -text {Fundo de Tela Padrão.Será
escrito no .icewm/prefoverride} \
        -value bgpadrao -variable "$top\::selectedButton" 
    vTcl:DefineAlias "$site_3_0.rad76" "bgp" vTcl:WidgetProc "Toplevel3" 1
    radiobutton $site_3_0.rad77 \
        -text {Fundo de Tela não-padrão.Será
escrito no .icewm/preferences} \
        -value bgnpadrao -variable "$top\::selectedButton" 
    vTcl:DefineAlias "$site_3_0.rad77" "bgnp" vTcl:WidgetProc "Toplevel3" 1
    place $site_3_0.rad76 \
        -in $site_3_0 -x 5 -y 20 -width 236 -height 34 -anchor nw \
        -bordermode ignore 
    place $site_3_0.rad77 \
        -in $site_3_0 -x 5 -y 55 -width 235 -height 45 -anchor nw \
        -bordermode ignore 
    button $top.but78 \
        \
        -command {#----------------------------------------------------------
# Variavel:                                               |
#----------------------------------------------------------
set pasta [exec env | sed -n "/HOME/p" | sed "/.*.HOME/d" | sed "s/HOME=//"]
#---------------------------------------------------------------------------
set bp $widget(bgp)
set bnp $widget(bgnp)
set e $widget(exp)
set c $widget(cen)
set la $widget(lado)
set l $widget(lista)
set rl [regsub {,} [$l get active] { }]
#----------------------------------------------------------------------------
set v1 [exec sed -n "/DesktopBackgroundImage=/p" $pasta/.icewm/preferences]
set v2 [file exist $pasta/.icewm/prefoverride]
#-----------------------------------------------------------------------------
set centralizado [exec sed -n "/DesktopBackgroundCenter=/p" $pasta/.icewm/preferences | sed "s/DesktopBackgroundCenter=//"]
set expandido [exec sed -n "/DesktopBackgroundScaled=/p" $pasta/.icewm/preferences | sed "s/DesktopBackgroundScaled=//"]
set op [exec echo [Toplevel3 setvar selectedButton]]
set op2 [exec echo [Toplevel3 setvar selectedButton2]]
#----------------------------------------------------------
# Botões:                                                 |
#----------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------
# Bg Como Padrao..........
#-----------------------------------------------------------------------------------------------------------------------
if { $op == "bgpadrao" } {if { $v1 == "" } {exec echo "# Fundo De Tela
DesktopBackgroundImage='$rl'" >> $pasta/.icewm/preferences}
if { $v1 != ""} {exec sed "/# Fundo De Tela/d" $pasta/.icewm/preferences > $pasta/.icewm/preferences2
    exec sed "/DesktopBackgroundImage=/d" $pasta/.icewm/preferences2 > $pasta/.icewm/preferences
    exec echo "# Fundo De Tela
DesktopBackgroundImage='$rl'" >> $pasta/.icewm/preferences}
if { $v2 == 0 } {exec echo "# Fundo De Tela
DesktopBackgroundImage='$rl'" >> $pasta/.icewm/prefoverride}
if { $v2 == 1 } {set branco [exec sed -n "/DesktopBackgroundImage=/p" $pasta/.icewm/prefoverride]
    if { $branco == "" } {exec echo "# Fundo De Tela
DesktopBackgroundImage='$rl'" >> $pasta/.icewm/prefoverride}
    if { $branco != ""} {exec sed "/# Fundo De Tela/d" $pasta/.icewm/prefoverride > $pasta/.icewm/prefoverride2
        exec sed "/DesktopBackgroundImage=/d" $pasta/.icewm/prefoverride2 > $pasta/.icewm/prefoverride
        exec echo "# Fundo De Tela
DesktopBackgroundImage='$rl'" >> $pasta/.icewm/prefoverride}}}
#----------------------------------------------------------------------------------------------------------------------
# Bg Como Nao Padrao......
#----------------------------------------------------------------------------------------------------------------------
if { $op == "bgnpadrao" } {if { $v1 == "" } {exec echo "# Fundo De Tela
DesktopBackgroundImage='$rl'" >> $pasta/.icewm/preferences}
if { $v1 != ""} {exec sed "/# Fundo De Tela/d" $pasta/.icewm/preferences > $pasta/.icewm/preferences2
    exec sed "/DesktopBackgroundImage=/d" $pasta/.icewm/preferences2 > $pasta/.icewm/preferences
    exec echo "# Fundo De Tela
DesktopBackgroundImage='$rl'" >> $pasta/.icewm/preferences}
exec rm -f $pasta/.icewm/prefoverride}
#----------------------------------------------------------------------------------------------------------------------
# ....C/ Fundo Expandido:
#----------------------------------------------------------------------------------------------------------------------
if { $op2 == "expandido" } {exec sed "/# Expandir Bg\\|# Centralizar Bg\\|DesktopBackgroundScaled=\\|DesktopBackgroundCenter=/d" $pasta/.icewm/preferences > $pasta/.icewm/preferences2
    exec echo "# Expandir Bg
DesktopBackgroundScaled=1
# Centralizar Bg
DesktopBackgroundCenter=0" >> $pasta/.icewm/preferences2
exec mv $pasta/.icewm/preferences2 $pasta/.icewm/preferences}
#-----------------------------------------------------------------------------------------------------------------------
# ....C / Fundo Centralizado:
#-----------------------------------------------------------------------------------------------------------------------
if { $op2 == "centralizado" } {exec sed "/# Expandir Bg\\|# Centralizar Bg\\|DesktopBackgroundScaled=\\|DesktopBackgroundCenter=/d" $pasta/.icewm/preferences > $pasta/.icewm/preferences2
    exec echo "# Expandir Bg
DesktopBackgroundScaled=0
# Centralizar Bg
DesktopBackgroundCenter=1" >> $pasta/.icewm/preferences2
exec mv $pasta/.icewm/preferences2 $pasta/.icewm/preferences}
#------------------------------------------------------------------------------------------------------------------------
# .... C/ Fundo Lado A Lado:
#------------------------------------------------------------------------------------------------------------------------
if { $op2 == "ladoalado" } {exec sed "/# Expandir Bg\\|# Centralizar Bg\\|DesktopBackgroundScaled=\\|DesktopBackgroundCenter=/d" $pasta/.icewm/preferences > $pasta/.icewm/preferences2
    exec echo "# Expandir Bg
DesktopBackgroundScaled=0
# Centralizar Bg
DesktopBackgroundCenter=0" >> $pasta/.icewm/preferences2
exec mv $pasta/.icewm/preferences2 $pasta/.icewm/preferences}
#-------------------------------------------------------------------------------------------------------------------------
#----------------------------------------------------------
# Comandos Finais                                         |
#----------------------------------------------------------
exec icewmbg -r &
exec rm -f $pasta/.icewm/prefoverride2
exec rm -f $pasta/.icewm/preferences2
exec killall idesk
exec idesk &
#----------------------------------------------------------
# Sair:                                                   |
#----------------------------------------------------------
Window hide .top70} \
        -text OK 
    vTcl:DefineAlias "$top.but78" "Button4" vTcl:WidgetProc "Toplevel3" 1
    button $top.but69 \
        -command {Window hide .top70} -text Cancelar 
    vTcl:DefineAlias "$top.but69" "Button5" vTcl:WidgetProc "Toplevel3" 1
    ###################
    # SETTING GEOMETRY
    ###################
    place $top.lab71 \
        -in $top -x 5 -y 115 -width 166 -height 86 -anchor nw \
        -bordermode ignore 
    place $top.lab72 \
        -in $top -x 5 -y 5 -width 246 -height 106 -anchor nw \
        -bordermode ignore 
    place $top.but78 \
        -in $top -x 180 -y 130 -width 55 -height 26 -anchor nw \
        -bordermode ignore 
    place $top.but69 \
        -in $top -x 175 -y 165 -width 68 -height 26 -anchor nw \
        -bordermode ignore 

    vTcl:FireEvent $base <<Ready>>
}

proc vTclWindow.top71 {base} {
    if {$base == ""} {
        set base .top71
    }
    if {[winfo exists $base]} {
        wm deiconify $base; return
    }
    set top $base
    ###################
    # CREATING WIDGETS
    ###################
    vTcl:toplevel $top -class Toplevel \
        -highlightcolor black 
    wm withdraw $top
    wm focusmodel $top passive
    wm geometry $top 314x297+269+104; update
    wm maxsize $top 785 570
    wm minsize $top 1 1
    wm overrideredirect $top 0
    wm resizable $top 1 1
    wm title $top "Organizar Diretorios..."
    vTcl:DefineAlias "$top" "Toplevel4" 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.fra72 \
        -borderwidth 2 -relief groove -height 250 -highlightcolor black \
        -width 305 
    vTcl:DefineAlias "$top.fra72" "Frame1" vTcl:WidgetProc "Toplevel4" 1
    set site_3_0 $top.fra72
    labelframe $site_3_0.lab73 \
        -foreground black -text Diretorios -highlightcolor black 
    vTcl:DefineAlias "$site_3_0.lab73" "Labelframe1" vTcl:WidgetProc "Toplevel4" 1
    set site_4_0 $site_3_0.lab73
    listbox $site_4_0.lis74 \
        -background white -foreground black -highlightcolor black \
        -selectbackground #c4c4c4 -selectforeground black \
        -xscrollcommand "$site_4_0.scr75 set" \
        -yscrollcommand "$site_4_0.scr76 set" -listvariable "$top\::lis74" 
    vTcl:DefineAlias "$site_4_0.lis74" "Listadir" vTcl:WidgetProc "Toplevel4" 1
    scrollbar $site_4_0.scr75 \
        -activebackground #f9f9f9 -command "$site_4_0.lis74 xview" \
        -highlightcolor black -orient horizontal -troughcolor #c4c4c4 \
        -width 10 
    vTcl:DefineAlias "$site_4_0.scr75" "Scrollbar1" vTcl:WidgetProc "Toplevel4" 1
    scrollbar $site_4_0.scr76 \
        -activebackground #f9f9f9 -command "$site_4_0.lis74 yview" \
        -highlightcolor black -troughcolor #c4c4c4 -width 10 
    vTcl:DefineAlias "$site_4_0.scr76" "Scrollbar2" vTcl:WidgetProc "Toplevel4" 1
    place $site_4_0.lis74 \
        -in $site_4_0 -x 5 -y 15 -width 268 -height 171 -anchor nw \
        -bordermode ignore 
    place $site_4_0.scr75 \
        -in $site_4_0 -x 5 -y 185 -width 267 -height 16 -anchor nw \
        -bordermode ignore 
    place $site_4_0.scr76 \
        -in $site_4_0 -x 275 -y 10 -width 16 -height 192 -anchor nw \
        -bordermode ignore 
    button $site_3_0.but77 \
        -activebackground #f9f9f9 -activeforeground black \
        -command {set pasta [tk_chooseDirectory]
set HOME [concat $env(HOME)]
if { "$pasta" != "" } {set pasta2 [regsub -all {/} "$pasta" {\/}]
    set ver [exec cat $HOME/.icebg/config | sed "/$pasta2.*./d" | sed -n "/$pasta2/p"]
    if { "$ver" == "" } {exec echo "$pasta" >> $HOME/.icebg/config
    Listadir insert end "$pasta"
    set pasta [exec cat $HOME/.icebg/config]
    set bg []
    foreach A $pasta {
    set bg2 [concat [exec find $A -name "*.jpg" -or -name "*.png" -or -name "*.bmp" -or -name "*.xpm" -or -name "*.gif" -or -name "*.jpeg" | sed s/^/"/ | sed s/$/"/]]
    set bg [concat "$bg\n$bg2"]
    }
#------------------------------------------------------------------------------------
# Variavel Da Caixa De Lista....
#------------------------------------------------------------------------------------
        Toplevel1 setvar bgs [concat $bg]} {tk_messageBox -icon error -title "Erro" -message "A Pasta $pasta Ja Existe No Seu Config"}}} \
        -foreground black -highlightcolor black -text Adicionar 
    vTcl:DefineAlias "$site_3_0.but77" "Button6" vTcl:WidgetProc "Toplevel4" 1
    button $site_3_0.but78 \
        -activebackground #f9f9f9 -activeforeground black \
        -command {set HOME [concat $env(HOME)]
set config [concat $HOME/.icebg/config]
set pasta [Listadir get active]
set lingua [exec cat $HOME/.icebg/lingua]
if { "$lingua" == "ptbr" } {set pergunta [tk_messageBox -icon warning -title "Deletar?" -message "Deseja Realmente Retirar A Pasta $pasta\nE Seus Arquivos Do Programa?" -type yesno]} {set pergunta [tk_messageBox -icon warning -title "Delete?" -message "Did you realy want to move out $pasta\nFrom the program database?" -type yesno]}
if { "$pergunta" == "yes" } {set pasta [regsub -all {/} $pasta {\/}]
    exec sed "/$pasta/d" $config > $HOME/.icebg/config2
    exec mv $HOME/.icebg/config2 $HOME/.icebg/config
    Listadir delete active
    set pasta [exec cat $HOME/.icebg/config]
    set bg []
    foreach A $pasta {
    set bg2 [concat [exec find $A -name "*.jpg" -or -name "*.png" -or -name "*.bmp" -or -name "*.xpm" -or -name "*.gif" -or -name "*.jpeg" | sed s/^/"/ | sed s/$/"/]]
    set bg [concat "$bg\n$bg2"]
    }
#------------------------------------------------------------------------------------
# Variavel Da Caixa De Lista....
#------------------------------------------------------------------------------------
        Toplevel1 setvar bgs [concat $bg]}} \
        -foreground black -highlightcolor black -text Deletar 
    vTcl:DefineAlias "$site_3_0.but78" "Button7" vTcl:WidgetProc "Toplevel4" 1
    place $site_3_0.lab73 \
        -in $site_3_0 -x 5 -y 5 -width 296 -height 206 -anchor nw \
        -bordermode ignore 
    place $site_3_0.but77 \
        -in $site_3_0 -x 225 -y 215 -anchor nw -bordermode ignore 
    place $site_3_0.but78 \
        -in $site_3_0 -x 10 -y 215 -anchor nw -bordermode ignore 
    button $top.but79 \
        -command {Window hide .top71} -text Sair 
    vTcl:DefineAlias "$top.but79" "Button8" vTcl:WidgetProc "Toplevel4" 1
    ###################
    # SETTING GEOMETRY
    ###################
    place $top.fra72 \
        -in $top -x 5 -y 5 -width 305 -height 250 -anchor nw \
        -bordermode ignore 
    place $top.but79 \
        -in $top -x 260 -y 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 .top59
Window show .top69
Window show .top70
Window show .top71

main $argc $argv

Scripts recomendados

O mundo do Polinômio

sysinfo

param - abre aplicativos com parâmetros no Blackbox e outros

Compactando / descompactando arquivos (Melhorado)

Simples relógio digital


  

Comentários

Nenhum comentário foi encontrado.


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts