[FAQTS] Python Knowledge Base Update -- August 28th, 2000

Fiona Czuczman fiona at sitegnome.com
Mon Aug 28 02:00:00 EDT 2000


Hi Guys,

The latest entries into http://python.faqts.com

regards,

Fiona Czuczman


## New Entries #################################################


-------------------------------------------------------------
Is it possible to get the reference count of a PyObject* object?
http://www.faqts.com/knowledge-base/view.phtml/aid/5580
-------------------------------------------------------------
Fiona Czuczman
Just van Rossum

sys.getrefcount(object)

Note that this always returns one more than the actual value, as
there's always an additional ref when inside sys.getrefcount().


-------------------------------------------------------------
How can I make a tkinter window unsizeable?
http://www.faqts.com/knowledge-base/view.phtml/aid/5581
-------------------------------------------------------------
Fiona Czuczman
Matthew Dixon Cowles

Problem:

i have a very simple tkinter interface.  the code is more or less

#-----------------------
def MakeInterface():
    b = Pmw.ScrolledText(root, usehullsize=1, hull_width=400,
hull_height=300)
    b.pack(side=TOP, expand=0, padx=5, pady=5, anchor=S)


if __name__=='__main__':
    root = Tk()
    root.title('Title')
    MakeInterface()
    root.mainloop()

#------------------------

there are a few other things there, but not many.  how do i keep the 
user from resizing the window (minimizing i fine).

Solution:

Add

root.resizable(0,0)

after root = Tk().

That's from Fredrik Lundh's excellent An Introduction to Tkinter.
Specifically, the page at (wrapped for line length):

http://www.pythonware.com/library/tkinter/introduction/
  x9489-window-geometry-methods.htm


-------------------------------------------------------------
Is there a way to set a Tkinter window (Tk or Toplevel) to be at a certain position on the screen?
http://www.faqts.com/knowledge-base/view.phtml/aid/5582
-------------------------------------------------------------
Fiona Czuczman
Richard Chamberlain

You can use the geometry method:

root=Tk()
root.geometry('100x100+20+20')

This makes root 100 pixels high and wide and positions it at 20,20
pixels on the screen.







More information about the Python-list mailing list