|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
||||
|
||||
|
Tkinter( button )
For some reason my button wont go at the end of the program it keeps showing up on the right side of the listbox
any idea?Code:
from Tkinter import *
import os
class GUI:
def __init__(self, master, dir_path):
frame = Frame(master)
frame.pack()
self.label2 = Label(frame, text="Files in your current Directory", background="blue",foreground="white")
self.label2.pack(fill=BOTH, expand=1)
self.scrollbar = Scrollbar(frame, orient=VERTICAL)
self.list = Listbox(frame, yscrollcommand=self.scrollbar.set, background="black", foreground="white")
self.scrollbar.config(command=self.list.yview)
self.scrollbar.pack(side=RIGHT, fill=Y)
for i in range(0,len(dir_path)):
self.list.insert(END, str(dir_path[i]))
self.list.pack(side=LEFT, fill=BOTH, expand=1)
self.Creat_buttons(frame)
def Creat_buttons(self,root):
self.button = Button(root, text="Quit", command=root.quit)
self.button.pack(side=RIGHT, expand=1)
root = Tk( )
dir_data = os.listdir(os.curdir)
send_var = GUI(root, dir_data)
root.mainloop( )
__________________
IE QUOTE | PHP Manual | Google | C/C++ Compiler | Linux Tutorials | General Stuff Game Dev |
|
#2
|
||||
|
||||
|
nm
![]() |
|
#3
|
||||
|
||||
|
Perhaps
self.button.pack(side=RIGHT, expand=1) is a clue ? ![]() Grim
__________________
*** Experimental Python Markup CGI V2 *** |
|
#4
|
||||
|
||||
|
Code:
def Creat_buttons(self, root):
self.button = Button(root, text = "Quit", command = root.quit)
self.button.pack(side = RIGHT, expand = 1)
self.button.pack(side = RIGHT, expand = 1) |
|
#5
|
||||
|
||||
|
ya it was that.. i have another question though.. in tkinter.. i visited a site that has some of the example etc but im still confused on how to use some function is there another site that shows you an example on each function?
|
|
#6
|
||||
|
||||
|
My favourites:
Fredrik Lundh's documentation. There is a PDF version that I use. It is not complete but has detail. This is widget collection that builds on Tkinter and has good documentation:PMW Python Mega Widgets I hope this helps some .Grim |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Tkinter( button ) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|