public
Rubygem
Description: High-level game framework based on rubygame
Homepage:
Clone URL: git://github.com/singpolyma/xgame.git
click handler
singpolyma (author)
Sun Jan 04 13:49:10 -0800 2009
commit  4ca0d8de08abf98eccb4a761dd3ccd79df19bfb2
tree    f8df3595beb54678c979c82dc9fd57ed3edfdd42
parent  859da8947d9ebdadd4df9e6a5e5de66ab81e1171
...
3
4
5
6
 
7
8
9
...
30
31
32
 
 
 
 
33
34
35
36
37
38
 
 
39
40
41
42
 
43
 
 
 
 
 
 
 
 
44
45
46
...
49
50
51
52
53
54
55
...
3
4
5
 
6
7
8
9
...
30
31
32
33
34
35
36
37
38
39
40
 
 
41
42
43
44
45
 
46
47
48
49
50
51
52
53
54
55
56
57
58
...
61
62
63
 
 
 
 
0
@@ -3,7 +3,7 @@ catch {package require tile}
0
 if [catch {ttk::setTheme tilegtk}] {
0
   catch {ttk::setTheme tileqt}
0
 }
0
-#catch {namespace import -force ttk::*}
0
+catch {namespace import -force ttk::*}
0
 source scrollable.tcl
0
 
0
 # Get the main scrollable canvas
0
@@ -30,17 +30,29 @@ grid .viewyscroll -sticky ns
0
 grid rowconfigure . 0 -weight 1
0
 grid columnconfigure . 0 -weight 1
0
 
0
+# Add label to viewarea
0
+set viewlabel [label ${viewarea}.frame.label -text "Package Description"]
0
+pack $viewlabel -fill both
0
+
0
 set pkgs [split [exec search/search ""] "\n"]
0
 
0
 set i 0
0
 foreach {item} $pkgs {
0
-  regexp {^(.)\s+(.+?)\s+(.+?)\s+(.+)$} $item matches status name version desc
0
-  frame ${canvas}.frame.row$i -highlightbackground "#abc" -highlightthickness 2 -background blue
0
+  regexp {^(.)\s+(.+?)\s+(.+?)\s+(.+)$} $item matches status pkg version desc
0
+  canvas ${canvas}.frame.row$i -highlightbackground "#abc" -highlightthickness 2 -background blue
0
   pack ${canvas}.frame.row$i -side top -fill x
0
   set cb [checkbutton ${canvas}.frame.row$i.check]
0
   set icon [canvas $canvas.frame.row$i.icon -height 24 -width 24 -background blue]
0
-  set name [label ${canvas}.frame.row$i.desc -text $name]
0
+  set name [label ${canvas}.frame.row$i.desc -text $pkg]
0
   set desc [label ${canvas}.frame.row$i.longer -text $desc]
0
+
0
+  # Should get longer info from search eventually
0
+  set handler "$viewlabel configure -text $pkg"
0
+  bind ${canvas}.frame.row$i <ButtonPress-1> $handler
0
+  bind $name <ButtonPress-1> $handler
0
+  bind $icon <ButtonPress-1> $handler
0
+  bind $desc <ButtonPress-1> $handler
0
+
0
   # Invoke may be ttk only... may need to catch that
0
   if {$status == "U" || $status == "I"} {$cb invoke}
0
   grid $cb -column 0 -rowspan 2 -padx 5 -row $i
0
@@ -49,7 +61,3 @@ foreach {item} $pkgs {
0
   grid $desc -column 2 -padx 5 -sticky nw -row [expr {1+$i}]
0
   incr i 2
0
 }
0
-
0
-# Add label to viewarea
0
-set viewlabel [label ${viewarea}.frame.label -text "Package Description"]
0
-pack $viewlabel -fill both

Comments