Check-in [84f33b6654]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:- Get rid of hard-coded path to icons.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:84f33b6654e4285c65eb3b86a1bb4dae76d2fa5f
User & Date: schelte 2014-08-27 15:38:27
Context
2014-08-27
15:39
- Specify the correct content type when invoking control commands. check-in: f6f7e5b691 user: schelte tags: trunk
15:38
- Get rid of hard-coded path to icons. check-in: 84f33b6654 user: schelte tags: trunk
13:00
Initial check-in check-in: 7aead6b94e user: schelte tags: trunk
Changes

Changes to demos/mbrowser.tcl.

11
12
13
14
15
16
17


18
19
20
21
22
23
24
...
112
113
114
115
116
117
118
119

120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
        }
    }
}

package require upnp
package require didl



proc yieldm {{value ""}} {
    yieldto return -level 0 $value
}

proc main {} {
    wm title . "Media browser"
    ttk::treeview .tv -style Listbox.Treeview -height 16 \
................................................................................
		}
	    }
	}
    }
}

proc icons {w} {
    set dir ~/ha/images/tango-icon-theme-0.8.1/16x16

    foreach {tag file} {
	object.container			folder.png
	object.container.album.photoAlbum	emblem-photos.png
	object.container.storageFolder		drive-harddisk.png
	object.item				text-x-generic.png
	object.item.imageItem.photo		image-x-generic.png
	object.item.videoItem			applications-multimedia.png
	object.item.audioItem.musicTrack	audio-x-generic.png
    } {
	set ls [glob -dir $dir */$file]
	if {[llength $ls]} {
	    set name [file rootname $file]
	    set img [image create photo ::icon::$name \
	      -file [lindex $ls 0] -width 20]
	    $w tag configure $tag -image $img
	}
    }







>
>







 







|
>









|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
...
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
        }
    }
}

package require upnp
package require didl

set dir [file dirname [info script]]

proc yieldm {{value ""}} {
    yieldto return -level 0 $value
}

proc main {} {
    wm title . "Media browser"
    ttk::treeview .tv -style Listbox.Treeview -height 16 \
................................................................................
		}
	    }
	}
    }
}

proc icons {w} {
    global dir
    set path [file join $dir icons 16x16]
    foreach {tag file} {
	object.container			folder.png
	object.container.album.photoAlbum	emblem-photos.png
	object.container.storageFolder		drive-harddisk.png
	object.item				text-x-generic.png
	object.item.imageItem.photo		image-x-generic.png
	object.item.videoItem			applications-multimedia.png
	object.item.audioItem.musicTrack	audio-x-generic.png
    } {
	set ls [glob -nocomplain -dir $path */$file]
	if {[llength $ls]} {
	    set name [file rootname $file]
	    set img [image create photo ::icon::$name \
	      -file [lindex $ls 0] -width 20]
	    $w tag configure $tag -image $img
	}
    }