Advertisement
gregwa

ttkdemo.tcl

Aug 26th, 2019
1,219
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #############################################################################
  2. # Generated by PAGE version 4.25
  3. #  in conjunction with Tcl version 8.6
  4. #  Aug 26, 2019 06:22:44 AM CDT  platform: Linux
  5. set vTcl(timestamp) ""
  6.  
  7.  
  8. if {!$vTcl(borrow) && !$vTcl(template)} {
  9.  
  10. set desc "-family {DejaVu Sans} -size 10"
  11. set vTcl(actual_gui_font_text_desc) $desc
  12. set vTcl(actual_gui_font_text_name) [font create {*}$desc]
  13. set desc "-family {DejaVu Sans Mono} -size 10"
  14. set vTcl(actual_gui_font_fixed_desc) $desc
  15. set vTcl(actual_gui_font_fixed_name) [font create {*}$desc]
  16. set desc "-family {DejaVu Sans} -size 10"
  17. set vTcl(actual_gui_font_menu_desc) $desc
  18. set vTcl(actual_gui_font_menu_name) [font create {*}$desc]
  19. set desc "-family {DejaVu Sans} -size 10"
  20. set vTcl(actual_gui_font_tooltip_desc) $desc
  21. set vTcl(actual_gui_font_tooltip_name) [font create {*}$desc]
  22. set vTcl(actual_gui_bg) #d9d9d9
  23. set vTcl(actual_gui_fg) #000000
  24. set vTcl(actual_gui_analog) #595959
  25. set vTcl(actual_gui_menu_analog) #ececec
  26. set vTcl(actual_gui_menu_bg) #d9d9d9
  27. set vTcl(actual_gui_menu_fg) #000000
  28. set vTcl(complement_color) #d9d9d9
  29. set vTcl(analog_color_p) #d9d9d9
  30. set vTcl(analog_color_m) #ececec
  31. set vTcl(active_fg) #000000
  32. set vTcl(actual_gui_menu_active_bg)  #ececec
  33. set vTcl(active_menu_fg) #000000
  34. }
  35.  
  36.  
  37.  
  38.  
  39. proc vTclWindow.top42 {base} {
  40.     global vTcl
  41.     if {$base == ""} {
  42.         set base .top42
  43.     }
  44.     if {[winfo exists $base]} {
  45.         wm deiconify $base; return
  46.     }
  47.     set top $base
  48.     ###################
  49.     # CREATING WIDGETS
  50.     ###################
  51.     vTcl::widgets::core::toplevel::createCmd $top -class Toplevel \
  52.         -background $vTcl(actual_gui_bg) -highlightcolor black
  53.     wm focusmodel $top passive
  54.     wm geometry $top 516x450+262+131
  55.     update
  56.     # set in toplevel.wgt.
  57.     global vTcl
  58.     global img_list
  59.     set vTcl(save,dflt,origin) 0
  60.     wm maxsize $top 1905 1050
  61.     wm minsize $top 1 1
  62.     wm overrideredirect $top 0
  63.     wm resizable $top 1 1
  64.     wm deiconify $top
  65.     wm title $top "ttk Widget Demo"
  66.     vTcl:DefineAlias "$top" "Toplevel1" vTcl:Toplevel:WidgetProc "" 1
  67.     ttk::style configure TButton -background $vTcl(actual_gui_bg)
  68.     ttk::style configure TButton -foreground $vTcl(actual_gui_fg)
  69.     ttk::style configure TButton -font "$vTcl(actual_gui_font_dft_desc)"
  70.     ttk::button $top.tBu45 \
  71.         -command on_btnExit -takefocus {} -text Exit
  72.     vTcl:DefineAlias "$top.tBu45" "TButton1" vTcl:WidgetProc "Toplevel1" 1
  73.     ttk::style configure TCheckbutton -background $vTcl(actual_gui_bg)
  74.     ttk::style configure TCheckbutton -foreground $vTcl(actual_gui_fg)
  75.     ttk::style configure TCheckbutton -font "$vTcl(actual_gui_font_dft_desc)"
  76.     ttk::checkbutton $top.tCh46 \
  77.         -variable tch46 -takefocus {} -text Tcheck
  78.     vTcl:DefineAlias "$top.tCh46" "TCheckbutton1" vTcl:WidgetProc "Toplevel1" 1
  79.     ttk::combobox $top.tCo47 \
  80.         -font TkTextFont -textvariable combobox -foreground {} -background {} \
  81.         -takefocus {}
  82.     vTcl:DefineAlias "$top.tCo47" "TCombobox1" vTcl:WidgetProc "Toplevel1" 1
  83.     ttk::style configure TLabelframe.Label -background $vTcl(actual_gui_bg)
  84.     ttk::style configure TLabelframe.Label -foreground $vTcl(actual_gui_fg)
  85.     ttk::style configure TLabelframe.Label -font "$vTcl(actual_gui_font_dft_desc)"
  86.     ttk::style configure TLabelframe -background $vTcl(actual_gui_bg)
  87.     ttk::labelframe $top.tLa56 \
  88.         -text Styles -width 150 -height 265
  89.     vTcl:DefineAlias "$top.tLa56" "TLabelframe1" vTcl:WidgetProc "Toplevel1" 1
  90.     set site_3_0 $top.tLa56
  91.     ttk::style configure TRadiobutton -background $vTcl(actual_gui_bg)
  92.     ttk::style configure TRadiobutton -foreground $vTcl(actual_gui_fg)
  93.     ttk::style configure TRadiobutton -font "$vTcl(actual_gui_font_dft_desc)"
  94.     ttk::radiobutton $site_3_0.tRa57 \
  95.         -value 0 -command on_rbClick -text TRadio
  96.     vTcl:DefineAlias "$site_3_0.tRa57" "TRadiobutton1" vTcl:WidgetProc "Toplevel1" 1
  97.     ttk::style configure TRadiobutton -background $vTcl(actual_gui_bg)
  98.     ttk::style configure TRadiobutton -foreground $vTcl(actual_gui_fg)
  99.     ttk::style configure TRadiobutton -font "$vTcl(actual_gui_font_dft_desc)"
  100.     ttk::radiobutton $site_3_0.tRa58 \
  101.         -command on_rbClick -text TRadio
  102.     vTcl:DefineAlias "$site_3_0.tRa58" "TRadiobutton2" vTcl:WidgetProc "Toplevel1" 1
  103.     ttk::style configure TRadiobutton -background $vTcl(actual_gui_bg)
  104.     ttk::style configure TRadiobutton -foreground $vTcl(actual_gui_fg)
  105.     ttk::style configure TRadiobutton -font "$vTcl(actual_gui_font_dft_desc)"
  106.     ttk::radiobutton $site_3_0.tRa59 \
  107.         -value 2 -command on_rbClick -text TRadio
  108.     vTcl:DefineAlias "$site_3_0.tRa59" "TRadiobutton3" vTcl:WidgetProc "Toplevel1" 1
  109.     ttk::style configure TRadiobutton -background $vTcl(actual_gui_bg)
  110.     ttk::style configure TRadiobutton -foreground $vTcl(actual_gui_fg)
  111.     ttk::style configure TRadiobutton -font "$vTcl(actual_gui_font_dft_desc)"
  112.     ttk::radiobutton $site_3_0.tRa62 \
  113.         -value 3 -command on_rbClick -text TRadio
  114.     vTcl:DefineAlias "$site_3_0.tRa62" "TRadiobutton4" vTcl:WidgetProc "Toplevel1" 1
  115.     ttk::style configure TRadiobutton -background $vTcl(actual_gui_bg)
  116.     ttk::style configure TRadiobutton -foreground $vTcl(actual_gui_fg)
  117.     ttk::style configure TRadiobutton -font "$vTcl(actual_gui_font_dft_desc)"
  118.     ttk::radiobutton $site_3_0.tRa63 \
  119.         -value 4 -command on_rbClick -text TRadio
  120.     vTcl:DefineAlias "$site_3_0.tRa63" "TRadiobutton5" vTcl:WidgetProc "Toplevel1" 1
  121.     ttk::style configure TRadiobutton -background $vTcl(actual_gui_bg)
  122.     ttk::style configure TRadiobutton -foreground $vTcl(actual_gui_fg)
  123.     ttk::style configure TRadiobutton -font "$vTcl(actual_gui_font_dft_desc)"
  124.     ttk::radiobutton $site_3_0.tRa64 \
  125.         -value 5 -command on_rbClick -text TRadio
  126.     vTcl:DefineAlias "$site_3_0.tRa64" "TRadiobutton6" vTcl:WidgetProc "Toplevel1" 1
  127.     ttk::style configure TRadiobutton -background $vTcl(actual_gui_bg)
  128.     ttk::style configure TRadiobutton -foreground $vTcl(actual_gui_fg)
  129.     ttk::style configure TRadiobutton -font "$vTcl(actual_gui_font_dft_desc)"
  130.     ttk::radiobutton $site_3_0.tRa65 \
  131.         -value 6 -command on_rbClick -text TRadio
  132.     vTcl:DefineAlias "$site_3_0.tRa65" "TRadiobutton7" vTcl:WidgetProc "Toplevel1" 1
  133.     place $site_3_0.tRa57 \
  134.         -in $site_3_0 -x 20 -y 30 -width 66 -height 21 -anchor nw \
  135.         -bordermode ignore
  136.     place $site_3_0.tRa58 \
  137.         -in $site_3_0 -x 20 -y 60 -width 66 -height 21 -anchor nw \
  138.         -bordermode ignore
  139.     place $site_3_0.tRa59 \
  140.         -in $site_3_0 -x 20 -y 90 -width 66 -height 21 -anchor nw \
  141.         -bordermode ignore
  142.     place $site_3_0.tRa62 \
  143.         -in $site_3_0 -x 20 -y 120 -width 66 -height 21 -anchor nw \
  144.         -bordermode ignore
  145.     place $site_3_0.tRa63 \
  146.         -in $site_3_0 -x 20 -y 150 -width 66 -height 21 -anchor nw \
  147.         -bordermode ignore
  148.     place $site_3_0.tRa64 \
  149.         -in $site_3_0 -x 20 -y 180 -width 66 -height 21 -anchor nw \
  150.         -bordermode ignore
  151.     place $site_3_0.tRa65 \
  152.         -in $site_3_0 -x 20 -y 210 -width 66 -height 21 -anchor nw \
  153.         -bordermode ignore
  154.     ttk::progressbar $top.tPr66 \
  155.         -mode indeterminate
  156.     vTcl:DefineAlias "$top.tPr66" "TProgressbar1" vTcl:WidgetProc "Toplevel1" 1
  157.     ttk::entry $top.tEn67 \
  158.         -font TkTextFont -textvariable EntryVar -foreground {} -background {} \
  159.         -takefocus {} -cursor xterm
  160.     vTcl:DefineAlias "$top.tEn67" "TEntry1" vTcl:WidgetProc "Toplevel1" 1
  161.     ttk::label $top.tLa68 \
  162.         -background $vTcl(actual_gui_bg) -foreground $vTcl(actual_gui_fg) \
  163.         -font TkDefaultFont -relief flat -textvariable LabelVar
  164.     vTcl:DefineAlias "$top.tLa68" "TLabel1" vTcl:WidgetProc "Toplevel1" 1
  165.     ttk::separator $top.tSe69 \
  166.         -orient vertical
  167.     vTcl:DefineAlias "$top.tSe69" "TSeparator1" vTcl:WidgetProc "Toplevel1" 1
  168.     ttk::separator $top.tSe70
  169.     vTcl:DefineAlias "$top.tSe70" "TSeparator2" vTcl:WidgetProc "Toplevel1" 1
  170.     ###################
  171.     # SETTING GEOMETRY
  172.     ###################
  173.     place $top.tBu45 \
  174.         -in $top -x 370 -y 30 -anchor nw -bordermode ignore
  175.     place $top.tCh46 \
  176.         -in $top -x 70 -y 90 -width 104 -relwidth 0 -height 21 -relheight 0 \
  177.         -anchor nw -bordermode ignore
  178.     place $top.tCo47 \
  179.         -in $top -x 70 -y 140 -anchor nw -bordermode ignore
  180.     place $top.tLa56 \
  181.         -in $top -x 340 -y 120 -width 150 -relwidth 0 -height 265 \
  182.         -relheight 0 -anchor nw -bordermode ignore
  183.     place $top.tPr66 \
  184.         -in $top -x 70 -y 200 -width 100 -relwidth 0 -height 19 -relheight 0 \
  185.         -anchor nw -bordermode ignore
  186.     place $top.tEn67 \
  187.         -in $top -x 70 -y 260 -anchor nw -bordermode ignore
  188.     place $top.tLa68 \
  189.         -in $top -x 70 -y 330 -width 172 -relwidth 0 -height 19 -relheight 0 \
  190.         -anchor nw -bordermode ignore
  191.     place $top.tSe69 \
  192.         -in $top -x 310 -y 40 -height 380 -anchor nw -bordermode inside
  193.     place $top.tSe70 \
  194.         -in $top -x 40 -y 70 -width 450 -anchor nw -bordermode inside
  195.  
  196.     vTcl:FireEvent $base <<Ready>>
  197. }
  198.  
  199. set btop ""
  200. if {$vTcl(borrow)} {
  201.     set btop .bor[expr int([expr rand() * 100])]
  202.     while {[lsearch $btop $vTcl(tops)] != -1} {
  203.         set btop .bor[expr int([expr rand() * 100])]
  204.     }
  205. }
  206. set vTcl(btop) $btop
  207. Window show .
  208. Window show .top42 $btop
  209. if {$vTcl(borrow)} {
  210.     $btop configure -background plum
  211. }
Advertisement
RAW Paste Data Copied
Advertisement