Exemplo n.º 1
0
	def createWindow(self):
		self.createMenu()
		#settings for the grid
		shoppingList.getSettings(True)
		self.master.rowconfigure(0, weight = 1)
		self.master.columnconfigure(0, weight = 1)
		self.grid(sticky = W+E+N+S)			
		# Useless text
		self.entryLabel = Label(self, height=2, width=20)
		self.entryLabel["text"] = "Enter item name:"
		self.entryLabel.grid(column=0,row=0, rowspan=2)
	
		# Textbox with defoult content
		self.text1 = Text(self, height= 2, width=20)
		self.text1.grid(column=1, row=0, rowspan=2)
		self.text1.insert(INSERT,"mjau")	
	
		# Button to add content
		self.sendButton = Button(self)
		self.sendButton.grid(column=2,row=0)
		self.sendButton["text"] = "Add"
		self.sendButton["command"] = self.addToList
		
		# Button to remove content.
		self.deleteButton = Button(self)
		self.deleteButton.grid(column=2,row=1)
		self.deleteButton["text"] = "Remove"
		self.deleteButton["command"] = self.removeFromList
		
		# Creates a Listbox.	
		self.listbox = Listbox(self)
		self.listbox.grid(columnspan=3,rowspan=3,pady=5, ipadx=100)		
		self.updateList()	
Exemplo n.º 2
0
	def Preferences(self):
		self.other = Toplevel()
		self.other.title("Second Window")

		# First line
		self.other.description = Label(self.other, height=1, width=15)
		self.other.description["text"] = "Server:"
		self.other.description.grid(row=0, column=0, columnspan=1)
		shoppingList.getSettings(True)
		self.other.inputServer = Text(self.other,height=1, width=60)
		self.other.inputServer.grid(column=2, row=0, columnspan=2,padx=3,pady=3)
		self.other.inputServer.insert(INSERT,shoppingList.server)
			
		# Second line
		self.other.description2 = Label(self.other, height=1, width=15)
		self.other.description2.grid(row=1, column=0, columnspan=1)
		self.other.description2["text"] = "Username:"******"text"] = "Password:"******"Use?", offvalue=False,onvalue=True,variable=self.other.var)
		self.other.checkbox.grid(row=3,column=0)
		if shoppingList.checked == True:
			self.other.checkbox.select()


		# Save settings
		self.other.acceptSettings = Button(self.other)
		self.other.acceptSettings.grid(row=3, column=2)
		self.other.acceptSettings["text"] = "Save settings"
		self.other.acceptSettings["command"] = self.saveSettings