#############################################################################
# Generated by PAGE version 8.1z
#  in conjunction with Tcl version 8.6
#  Nov 07, 2024 12:27:31 AM PST  platform: Linux
set vTcl(timestamp) ""
if {![info exists vTcl(borrow)]} {
    ::vTcl::MessageBox -title Error -message  "You must open project files from within PAGE."
    exit}


set desc "-family {DejaVu Sans Mono} -size 14"
set vTcl(actual_gui_font_dft_desc) $desc
set vTcl(actual_gui_font_dft_name) [font create {*}$desc]
set desc "-family {DejaVu Sans} -size 14"
set vTcl(actual_gui_font_text_desc) $desc
set vTcl(actual_gui_font_text_name) [font create {*}$desc]
set desc "-family {DejaVu Sans Mono} -size 14"
set vTcl(actual_gui_font_fixed_desc) $desc
set vTcl(actual_gui_font_fixed_name) [font create {*}$desc]
set desc "-family {DejaVu Sans} -size 12"
set vTcl(actual_gui_font_menu_desc) $desc
set vTcl(actual_gui_font_menu_name) [font create {*}$desc]
set desc "-family {DejaVu Sans} -size 12"
set vTcl(actual_gui_font_tooltip_desc) $desc
set vTcl(actual_gui_font_tooltip_name) [font create {*}$desc]
set vTcl(actual_gui_font_treeview_desc)  TkDefaultFont
set vTcl(actual_gui_font_treeview_name)  TkDefaultFont
########################################### 
set vTcl(actual_gui_bg) wheat
set vTcl(actual_gui_fg) #000000
set vTcl(actual_gui_analog) #f4bcb2
set vTcl(actual_gui_menu_analog) #ececec
set vTcl(actual_gui_menu_bg) wheat
set vTcl(actual_gui_menu_fg) #000000
set vTcl(complement_color) #b2c9f4
set vTcl(analog_color_p) #eaf4b2
set vTcl(analog_color_m) #f4bcb2
set vTcl(tabfg1) black
set vTcl(tabfg2) black
set vTcl(actual_gui_menu_active_bg)  #f4bcb2
set vTcl(actual_gui_menu_active_fg)  #000000
########################################### 
set vTcl(pr,autoalias) 1
set vTcl(pr,relative_placement) 1
set vTcl(mode) Relative
set vTcl(project_theme) page-legacy



proc vTclWindow.top34 {base} {
    global vTcl
    if {$base == ""} {
        set base .top34
    }
    if {[winfo exists $base]} {
        wm deiconify $base; return
    }
    set top $base
    set target $base

############ toplevel.wgt #############################
    ###################
    # CREATING WIDGETS
    ###################
    vTcl::widgets::core::toplevel::createCmd $top -class Toplevel \
        -borderwidth 0 -relief flat -background wheat -container 0 -height 0 \
        -highlightbackground wheat -highlightcolor #000000 \
        -highlightthickness 0 -padx 0 -pady 0 -takefocus 0 -width 0 
    wm focusmodel $top passive
    wm geometry $top 410x347+278+339
    update
    # set in toplevel.wgt.
    global vTcl
    global img_list
    set vTcl(save,dflt,origin) 0
    wm maxsize $top 1905 1170
    wm minsize $top 1 1
    wm overrideredirect $top 0
    wm resizable $top 1 1
    wm deiconify $top
    set toptitle "Main"
    wm title $top $toptitle
    namespace eval ::widgets::${top}::ClassOption {}
    set ::widgets::${top}::ClassOption(-toptitle) $toptitle
    vTcl:DefineAlias "$top" "Main" vTcl:Toplevel:WidgetProc "" 1
    set vTcl(real_top) {}
    button "$top.but35" \
        -activebackground #f4bcb2 -activeforeground black -anchor center \
        -background wheat -borderwidth 1 -command "open_middle" \
        -compound none -default disabled -disabledforeground #b8a786 \
        -font "-family {DejaVu Sans} -size 14" -foreground #000000 -height 0 \
        -highlightbackground wheat -highlightcolor #000000 \
        -highlightthickness 1 -justify center -padx 3m -pady 1m \
        -relief raised -repeatdelay 0 -repeatinterval 0 -state normal \
        -text "Open Middle" -underline -1 -width 0 -wraplength 0 
    vTcl:DefineAlias "$top.but35" "Button1" vTcl:WidgetProc "Main" 1
    button "$top.but36" \
        -activebackground #f4bcb2 -activeforeground black -anchor center \
        -background wheat -borderwidth 1 -command "quit" -compound none \
        -default disabled -disabledforeground #b8a786 \
        -font "-family {DejaVu Sans} -size 14" -foreground #000000 -height 0 \
        -highlightbackground wheat -highlightcolor #000000 \
        -highlightthickness 1 -justify center -padx 3m -pady 1m \
        -relief raised -repeatdelay 0 -repeatinterval 0 -state normal \
        -text "Quit" -underline -1 -width 0 -wraplength 0 
    vTcl:DefineAlias "$top.but36" "Button2" vTcl:WidgetProc "Main" 1
    message "$top.mes43" \
        -anchor center -aspect 150 -background wheat -borderwidth 1 \
        -font "-family {DejaVu Sans Mono} -size 14" -foreground #000000 \
        -highlightbackground wheat -highlightcolor #000000 \
        -highlightthickness 0 -justify left -padx -1 -pady -1 -relief flat \
        -takefocus 0 -text "Main GUI" -width 90 
    vTcl:DefineAlias "$top.mes43" "Message1" vTcl:WidgetProc "Main" 1
    ###################
    # SETTING GEOMETRY
    ###################
    place $top.but35 \
        -in $top -x 0 -relx 0.317 -y 0 -rely 0.461 -anchor nw \
        -bordermode ignore 
    place $top.but36 \
        -in $top -x 0 -relx 0.4171 -y 0 -rely 0.692 -anchor nw \
        -bordermode ignore 
    place $top.mes43 \
        -in $top -x 0 -relx 0.361 -y 0 -rely 0.173 -width 0 -relwidth 0.237 \
        -height 0 -relheight 0.092 -anchor nw -bordermode ignore 

############# Spot ttt ##############################

    vTcl:FireEvent $base <<Ready>>
}

proc vTclWindow.top35 {base} {
    global vTcl
    if {$base == ""} {
        set base .top35
    }
    if {[winfo exists $base]} {
        wm deiconify $base; return
    }
    set top $base
    set target $base

############ toplevel.wgt #############################
    ###################
    # CREATING WIDGETS
    ###################
    vTcl::widgets::core::toplevel::createCmd $top -class Toplevel \
        -borderwidth 0 -relief flat -background wheat -container 0 -height 0 \
        -highlightbackground wheat -highlightcolor #000000 \
        -highlightthickness 0 -padx 0 -pady 0 -takefocus 0 -width 0 
    wm focusmodel $top passive
    wm geometry $top 459x315+700+341
    update
    # set in toplevel.wgt.
    global vTcl
    global img_list
    set vTcl(save,dflt,origin) 0
    wm maxsize $top 1905 1050
    wm minsize $top 1 1
    wm overrideredirect $top 0
    wm resizable $top 1 1
    wm deiconify $top
    set toptitle "Man in the Middle"
    wm title $top $toptitle
    namespace eval ::widgets::${top}::ClassOption {}
    set ::widgets::${top}::ClassOption(-toptitle) $toptitle
    vTcl:DefineAlias "$top" "Middle" vTcl:Toplevel:WidgetProc "" 1
    set vTcl(real_top) {}
    message "$top.mes44" \
        -anchor center -aspect 150 -background wheat -borderwidth 1 \
        -font "-family {DejaVu Sans} -size 12" -foreground #000000 \
        -highlightbackground wheat -highlightcolor #000000 \
        -highlightthickness 0 -justify left -padx -1 -pady -1 -relief flat \
        -takefocus 0 \
        -text "This is a man-in-the-middle toplevel.

It is invoked from the main toplevel
and in turn invokes another GUI which
has a popup and therefore, needs 'root'." \
        -width 326 
    vTcl:DefineAlias "$top.mes44" "Message1_1" vTcl:WidgetProc "Middle" 1
    button "$top.but46" \
        -activebackground #f4bcb2 -activeforeground black -anchor center \
        -background wheat -borderwidth 1 -command "invoke" -compound none \
        -default disabled -disabledforeground #b8a786 \
        -font "-family {DejaVu Sans Mono} -size 14" -foreground #000000 \
        -height 0 -highlightbackground wheat -highlightcolor #000000 \
        -highlightthickness 1 -justify center -padx 3m -pady 1m \
        -relief raised -repeatdelay 0 -repeatinterval 0 -state normal \
        -text "Invoke" -underline -1 -width 0 -wraplength 0 
    vTcl:DefineAlias "$top.but46" "Button1_1" vTcl:WidgetProc "Middle" 1
    button "$top.but43" \
        -activebackground #f4bcb2 -activeforeground black -anchor center \
        -background wheat -borderwidth 1 -command "quit" -compound none \
        -default disabled -disabledforeground #b8a786 \
        -font "-family {DejaVu Sans Mono} -size 14" -foreground #000000 \
        -height 0 -highlightbackground wheat -highlightcolor #000000 \
        -highlightthickness 1 -justify center -padx 3m -pady 1m \
        -relief raised -repeatdelay 0 -repeatinterval 0 -state normal \
        -text "Quit" -underline -1 -width 0 -wraplength 0 
    vTcl:DefineAlias "$top.but43" "Button2_1" vTcl:WidgetProc "Middle" 1
    ###################
    # SETTING GEOMETRY
    ###################
    place $top.mes44 \
        -in $top -x 0 -relx 0.1438 -y 0 -rely 0.159 -width 0 -relwidth 0.71 \
        -height 0 -relheight 0.371 -anchor nw -bordermode ignore 
    place $top.but46 \
        -in $top -x 0 -relx 0.196 -y 0 -rely 0.698 -width 94 -relwidth 0 \
        -height 33 -relheight 0 -anchor nw -bordermode ignore 
    place $top.but43 \
        -in $top -x 0 -relx 0.627 -y 0 -rely 0.698 -width 72 -relwidth 0 \
        -height 32 -relheight 0 -anchor nw -bordermode ignore 

############# Spot ttt ##############################

    vTcl:FireEvent $base <<Ready>>
}

proc vTclWindow.top36 {base} {
    global vTcl
    if {$base == ""} {
        set base .top36
    }
    if {[winfo exists $base]} {
        wm deiconify $base; return
    }
    set top $base
    set target $base

############ toplevel.wgt #############################
    ###################
    # CREATING WIDGETS
    ###################
    vTcl::widgets::core::toplevel::createCmd $top -class Toplevel \
        -borderwidth 0 -relief flat -background wheat -container 0 -height 0 \
        -highlightbackground wheat -highlightcolor #000000 \
        -highlightthickness 0 -padx 0 -pady 0 -takefocus 0 -width 0 
    wm focusmodel $top passive
    wm geometry $top 420x325+1171+339
    update
    # set in toplevel.wgt.
    global vTcl
    global img_list
    set vTcl(save,dflt,origin) 0
    wm maxsize $top 1905 1170
    wm minsize $top 1 1
    wm overrideredirect $top 0
    wm resizable $top 1 1
    wm deiconify $top
    set toptitle "Popup"
    wm title $top $toptitle
    namespace eval ::widgets::${top}::ClassOption {}
    set ::widgets::${top}::ClassOption(-toptitle) $toptitle
    vTcl:DefineAlias "$top" "Popup" vTcl:Toplevel:WidgetProc "" 1
    set vTcl(real_top) {}
    message "$top.mes43" \
        -anchor center -aspect 150 -background wheat -borderwidth 1 \
        -font "-family {DejaVu Sans} -size 12" -foreground #000000 \
        -highlightbackground wheat -highlightcolor #000000 \
        -highlightthickness 0 -justify left -padx -1 -pady -1 -relief flat \
        -takefocus 0 -text "Each button
has a popup menu." -width 207 
    vTcl:DefineAlias "$top.mes43" "Message1_2" vTcl:WidgetProc "Popup" 1
    button "$top.but44" \
        -activebackground #f4bcb2 -activeforeground black -anchor center \
        -background wheat -borderwidth 1 -command "quit" -compound none \
        -default disabled -disabledforeground #b8a786 \
        -font "-family {DejaVu Sans Mono} -size 14" -foreground #000000 \
        -height 0 -highlightbackground wheat -highlightcolor #000000 \
        -highlightthickness 1 -justify center -padx 3m -pady 1m \
        -relief raised -repeatdelay 0 -repeatinterval 0 -state normal \
        -text "Quit" -underline -1 -width 0 -wraplength 0 
    vTcl:DefineAlias "$top.but44" "Button3_1" vTcl:WidgetProc "Popup" 1
# add pa len = 3
# add pa target = .top36.pop49, basename = $top.pop49
    vTcl::widgets::core::popup::createCmd "$top.pop49" \
        -activebackground #f4bcb2 -activeborderwidth 1 \
        -activeforeground black -background wheat -borderwidth 1 \
        -cursor arrow -disabledforeground #b8a786 \
        -font "-family {DejaVu Sans} -size 12" -foreground #000000 \
        -relief raised -selectcolor #000000 -takefocus 0 -tearoff 0 \
        -type normal 
    global vTcl
    set val vTcl($top.pop49,-proc)
    set vTcl($top.pop49,-proc) popup0
    namespace eval ::widgets::$top.pop49 {}
    set ::widgets::$top.pop49::ClassOption(-proc) popup0
    set ::widgets::$top.pop49::options(-proc) popup0
    set ::widgets::$top.pop49::save(-proc) 1
    vTcl:DefineAlias "$top.pop49" "Popupmenu1" vTcl:WidgetProc "" 1
# add first pop
    $top.pop49 add command \
        -command "#" -compound left -font "-family {DejaVu Sans} -size 12" \
        -label "This" 
    $top.pop49 add command \
        -command "#" -compound left -font "-family {DejaVu Sans} -size 12" \
        -label "That" 
    $top.pop49 add command \
        -command "#" -compound left -font "-family {DejaVu Sans} -size 12" \
        -label "But" 
    $top.pop49 add separator \
        
    
    $top.pop49 add cascade \
        -menu $top.pop49.men51 -compound left -font "-family {DejaVu Sans} -size 12" -label "Maybe" 
    set site_3_0 $top.pop49
# spot z childMenu = .top36.pop49.men51 	childBasename = $site_3_0.men51
# add pa len = 4
# add pa target = .top36.pop49.men51, basename = $site_3_0.men51
    menu "$site_3_0.men51" \
        -activebackground #d9d9d9 -activeborderwidth 1 \
        -activeforeground black -background wheat -borderwidth 1 \
        -cursor arrow -disabledforeground #b8a786 \
        -font "-family {DejaVu Sans} -size 10" -foreground #000000 \
        -relief raised -selectcolor #000000 -takefocus 0 -tearoff 0 \
        -type normal 
# add first pop
    $site_3_0.men51 add command \
        -command "#sys.exit" -compound left \
        -font "-family {DejaVu Sans} -size 12" -label "Exit" 
# add pa len = 3
# add pa target = .top36.pop50, basename = $top.pop50
    vTcl::widgets::core::popup::createCmd "$top.pop50" \
        -activebackground #f4bcb2 -activeborderwidth 1 \
        -activeforeground black -background wheat -borderwidth 1 \
        -cursor arrow -disabledforeground #b8a786 \
        -font "-family {DejaVu Sans} -size 12" -foreground #000000 \
        -relief raised -selectcolor #000000 -takefocus 0 -tearoff 0 \
        -type normal 
    global vTcl
    set val vTcl($top.pop50,-proc)
    set vTcl($top.pop50,-proc) popup1
    namespace eval ::widgets::$top.pop50 {}
    set ::widgets::$top.pop50::ClassOption(-proc) popup1
    set ::widgets::$top.pop50::options(-proc) popup1
    set ::widgets::$top.pop50::save(-proc) 1
    vTcl:DefineAlias "$top.pop50" "Popupmenu2" vTcl:WidgetProc "" 1
    bind $top.pop50 <Button-3> {
        lambda e: popup1(e)
    }
# add first pop
    $top.pop50 add command \
        -command "#" -compound left -font "-family {DejaVu Sans} -size 12" \
        -label "How" 
    $top.pop50 add command \
        -command "#" -compound left -font "-family {DejaVu Sans} -size 12" \
        -label "Now" 
    $top.pop50 add separator \
        
    
    $top.pop50 add cascade \
        -menu $top.pop50.men49 -compound left -font "-family {DejaVu Sans} -size 12" \
        -label "Brown Cow" 
    set site_3_0 $top.pop50
# spot z childMenu = .top36.pop50.men49 	childBasename = $site_3_0.men49
# add pa len = 4
# add pa target = .top36.pop50.men49, basename = $site_3_0.men49
    menu "$site_3_0.men49" \
        -activebackground #d9d9d9 -activeborderwidth 1 \
        -activeforeground black -background wheat -borderwidth 1 \
        -cursor arrow -disabledforeground #b8a786 \
        -font "-family {DejaVu Sans} -size 10" -foreground #000000 \
        -relief raised -selectcolor #000000 -takefocus 0 -tearoff 0 \
        -type normal 
# add first pop
    $site_3_0.men49 add command \
        -command "#sys.exit" -compound left \
        -font "-family {DejaVu Sans} -size 12" -label "Quit" 
    button "$top.but37" \
        -activebackground #f4bcb2 -activeforeground black -anchor center \
        -background wheat -borderwidth 1 -compound none -default disabled \
        -disabledforeground #b8a786 \
        -font "-family {DejaVu Sans Mono} -size 14" -foreground #000000 \
        -height 0 -highlightbackground wheat -highlightcolor #000000 \
        -highlightthickness 1 -justify center -padx 3m -pady 1m \
        -relief raised -repeatdelay 0 -repeatinterval 0 -state normal \
        -text "Button1" -underline -1 -width 0 -wraplength 0 
    vTcl:DefineAlias "$top.but37" "Button1_2" vTcl:WidgetProc "Popup" 1
    bind $top.but37 <Button-3> {
        lambda e: popup0(e)
    }
    button "$top.but38" \
        -activebackground #f4bcb2 -activeforeground black -anchor center \
        -background wheat -borderwidth 1 -compound none -default disabled \
        -disabledforeground #b8a786 \
        -font "-family {DejaVu Sans Mono} -size 14" -foreground #000000 \
        -height 0 -highlightbackground wheat -highlightcolor #000000 \
        -highlightthickness 1 -justify center -padx 3m -pady 1m \
        -relief raised -repeatdelay 0 -repeatinterval 0 -state normal \
        -text "Button2" -underline -1 -width 0 -wraplength 0 
    vTcl:DefineAlias "$top.but38" "Button2_2" vTcl:WidgetProc "Popup" 1
    bind $top.but38 <Button-3> {
        lambda e: popup1(e)
    }
    ###################
    # SETTING GEOMETRY
    ###################
    place $top.mes43 \
        -in $top -x 0 -relx 0.2524 -y 0 -rely 0.092 -width 0 -relwidth 0.493 \
        -height 0 -relheight 0.28 -anchor nw -bordermode ignore 
    place $top.but44 \
        -in $top -x 0 -relx 0.364 -y 0 -rely 0.783 -height 0 -relheight 0.152 \
        -anchor nw -bordermode ignore 
    place $top.but37 \
        -in $top -x 0 -relx 0.168 -y 0 -rely 0.493 -width 91 -relwidth 0 \
        -height 33 -relheight 0 -anchor nw -bordermode ignore 
    place $top.but38 \
        -in $top -x 0 -relx 0.524 -y 0 -rely 0.492 -width 91 -relwidth 0 \
        -height 33 -relheight 0 -anchor nw -bordermode ignore 

############# Spot ttt ##############################

    vTcl:FireEvent $base <<Ready>>
}

proc 36 {args} {return 1}


Window show .
set btop1 ""
if {$vTcl(borrow)} {
    set btop1 .bor[expr int([expr rand() * 100])]
    while {[lsearch $btop1 $vTcl(tops)] != -1} {
        set btop1 .bor[expr int([expr rand() * 100])]
    }
}
set vTcl(btop) $btop1
Window show .top34 $btop1
if {$vTcl(borrow)} {
    $btop1 configure -background plum
}
set btop2 ""
if {$vTcl(borrow)} {
    set btop2 .bor[expr int([expr rand() * 100])]
    while {[lsearch $btop2 $vTcl(tops)] != -1} {
        set btop2 .bor[expr int([expr rand() * 100])]
    }
}
set vTcl(btop) $btop2
Window show .top35 $btop2
if {$vTcl(borrow)} {
    $btop2 configure -background plum
}
set btop3 ""
if {$vTcl(borrow)} {
    set btop3 .bor[expr int([expr rand() * 100])]
    while {[lsearch $btop3 $vTcl(tops)] != -1} {
        set btop3 .bor[expr int([expr rand() * 100])]
    }
}
set vTcl(btop) $btop3
Window show .top36 $btop3
if {$vTcl(borrow)} {
    $btop3 configure -background plum
}

