The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Python Programming
|
Tkinter( button )
Discuss Tkinter( button ) in the Python Programming forum on Dev Shed. Tkinter( button ) Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

March 7th, 2004, 10:45 PM
|
 |
Only the strong survives!!.
|
|
Join Date: Feb 2003
Location: A World of wonders.
|
|
|
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( )
|

March 7th, 2004, 11:00 PM
|
 |
Only the strong survives!!.
|
|
Join Date: Feb 2003
Location: A World of wonders.
|
|
nm 
|

March 8th, 2004, 02:35 AM
|
 |
Mini me.
|
|
Join Date: Nov 2003
Location: Cambridge, UK
|
|
Perhaps
self.button.pack(side=RIGHT, expand=1)
is a clue ?

Grim
|

March 8th, 2004, 06:21 AM
|
 |
Mini me.
|
|
Join Date: Nov 2003
Location: Cambridge, UK
|
|
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)
|

March 8th, 2004, 09:33 AM
|
 |
Only the strong survives!!.
|
|
Join Date: Feb 2003
Location: A World of wonders.
|
|
|
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?
|

March 8th, 2004, 09:51 AM
|
 |
Mini me.
|
|
Join Date: Nov 2003
Location: Cambridge, UK
|
|
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|