summaryrefslogtreecommitdiff
path: root/src/tempUI.py
blob: 6b22ba7d6410bee01ea6aca0ce395cec52e87d49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import pygtk,gtk
import gtk.gdk
import os
gdk = gtk.gdk

home=os.getenv("HOME")
entry = (gtk.Entry(),gtk.Entry(),gtk.Entry(),gtk.Entry(),gtk.Entry(),gtk.Entry(),gtk.Entry(),gtk.Entry())

def writeFile(widget,data=None):
	f= open(home+"/.bdm/wallpaper.list",'w')
	f.write("[wallpapers]\n")
	for i in (0,1,2,3,4,5,6,7):
		if entry[i].get_text():
			f.write(str(i+1)+"="+entry[i].get_text()+"\n")
	f.close()
		
		

if __name__=="__main__":
	window = gtk.Window(gtk.WINDOW_TOPLEVEL)
	window.connect("destroy", gtk.main_quit)
	window.set_title("BDM Desktop Selector")
	label = gtk.Label()
	label.set_text("Enter path to backgrounds")
	label.show()
	vbox = gtk.VBox()
	vbox.show()
	window.show()
	window.add(vbox)
	vbox.add(label)
	for i in (0,1,2,3,4,5,6,7):
		entry[i].show()
		vbox.pack_start(entry[i])
		entry[i].connect("changed",writeFile,i)
	gtk.main()