Tk Source Code

Artifact [486b1f0d]
Login

Artifact 486b1f0d20090736a086a5a1096e1a2b6ad1d148464bb62c518d5a1a798d1546:

Attachment "blue1.tcl" to ticket [111de2ed] added by bll 2017-10-09 18:47:03.
package require Tk

   # -- create an image 20x20 filled with blue pixels
  image create photo bluePhoto
  bluePhoto put #0000ff -to 0 0 20 20
  image create photo bluepng -file blue1.png
  image create photo bluegif -file blue1.gif

   # -- create a label-widget holding the image
  label .blueLabel -image bluePhoto
  label .bluepng -image bluepng
  label .bluegif -image bluegif
  ttk::separator .a
  ttk::separator .b
  
  pack .blueLabel
  pack .a -expand true -fill x
  pack .bluepng
  pack .b -expand true -fill x
  pack .bluegif
   # -- change the background of its container
  . configure -background #0000ff
  . configure -width 60
  
   # -  for a better visual perception of the contrast between the 
   # -   blue background and the blue label
   # -  remove all the label-widget's borders
  .blueLabel configure -borderwidth 0 -padx 0 -pady 0
  .bluepng configure -borderwidth 0 -padx 0 -pady 0
  .bluegif configure -borderwidth 0 -padx 0 -pady 0