Keith Vetter 2003-03-12 : after seeing some tcl code on wiki pages that tried to use the "^" and "V" as arrow symbols on buttons[L1 ] , I thought I'd make available simple bitmap images of the four arrows that can be used instead. Remember, you can use Bitmap Editor to tailor the images to exactly how you'd like them.
##+########################################################################## # # arrows.tcl -- bitmaps for four directional arrows # by Keith Vetter, Mar 12, 2003 # set I(up) [image create bitmap -data { #define up_width 11 #define up_height 11 static char up_bits = { 0x00, 0x00, 0x20, 0x00, 0x70, 0x00, 0xf8, 0x00, 0xfc, 0x01, 0xfe, 0x03, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00 } }] set I(down) [image create bitmap -data { #define down_width 11 #define down_height 11 static char down_bits = { 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0xfe, 0x03, 0xfc, 0x01, 0xf8, 0x00, 0x70, 0x00, 0x20, 0x00, 0x00, 0x00 } }] set I(left) [image create bitmap -data { #define left_width 11 #define left_height 11 static char left_bits = { 0x00, 0x00, 0x20, 0x00, 0x30, 0x00, 0x38, 0x00, 0xfc, 0x01, 0xfe, 0x01, 0xfc, 0x01, 0x38, 0x00, 0x30, 0x00, 0x20, 0x00, 0x00, 0x00 } }] set I(right) [image create bitmap -data { #define right_width 11 #define right_height 11 static char right_bits = { 0x00, 0x00, 0x20, 0x00, 0x60, 0x00, 0xe0, 0x00, 0xfc, 0x01, 0xfc, 0x03, 0xfc, 0x01, 0xe0, 0x00, 0x60, 0x00, 0x20, 0x00, 0x00, 0x00 } }] # Now for a simple demo package require Tk frame .buttons foreach dir {up down left right} { button .$dir -image $I($dir) -command [list set S(msg) "$dir arrow"] } label .lbl -textvariable S(msg) -bd 2 -relief sunken set S(msg) "press a button" grid .buttons -row 0 -pady .05i grid .lbl -sticky ew grid columnconfigure . 0 -weight 1 grid x .up x -in .buttons -row 0 grid .left x .right -in .buttons grid x .down x -in .buttons
Catagory ?