Setting Window Size using Pack Under Tkinter

Fuzzyman michael at foord.net
Mon Jan 19 12:50:10 CET 2004


Short of actually trying it...... (when I get home I *will* try it)

Would the following work :

 from Tkinter import *
 gui=Tk()
 Button(gui, text='A button', command=a_function).pack()

  ####code####
 gui.geometry("+%d+%d" %(300, 100))
 gui.resizable(0,0)
 gui.mainloop()

??

If I recall correctly it ought to.... (mixing the pack and geometry
methods in the same GUI)...

Anyway - thanks.

Fuzzy


"duikboot" <arjen.dijkstraNoSpam at hccnet.nl> wrote in message news:<4007dedc$0$166$e4fe514c at dreader5.news.xs4all.nl>...
> from Tkinter import *
>  gui=Tk()
> 
>  ####code####
>  gui.geometry("+%d+%d" %(300, 100))
>  gui.resizable(0,0)
>  gui.mainloop()
> 
> Will work offcourse too.. :-)
> 
> cheers,
> 
> Arjen
> 
> 
> 
> "duikboot" <arjen.dijkstraNoSpam at hccnet.nl> schreef in bericht
> news:4007de09$0$151$e4fe514c at dreader5.news.xs4all.nl...
> > from Tkinter import *
> > gui=Tk()
> >
> > ####code####
> > gui.geometry("+%d+%d" %(300, 100))
> > gui.resizable(0,0)
> >
> > if __name__=='__main__':
> >     gui.mainloop()
> >
> >
> >
> >
> > "Fuzzyman" <michael at foord.net> schreef in bericht
> > news:8089854e.0401160134.5674a86c at posting.google.com...
> > > I'm having trouble implementing my GUI using Tkinter......
> > > I've been working through the Tkinter tutorials from 'Programming
> > > Python' and am generally happy enough with the functionality and feel
> > > of the results *but* - I can't see how to set the size of the root
> > > window (or any top level window) and to stop it being resized........
> > >
> > > Thanks for any help.
> > >
> > > Fuzzyman
> > >
> > >
> > > --
> > >
> > > YAPLP
> > > Yet Another Python Links Page
> > > http://www.voidspace.org.uk/coollinks/python_links.shtml
> > >
> > > Python Utils
> > > http://www.voidspace.org.uk/atlantibots/pythonutils.html
> > >
> > > --
> > >
> > > http://www.Voidspace.org.uk
> > > The Place where headspace meets cyberspace. Online resource site -
> > > covering science, technology, computing, cyberpunk, psychology,
> > > spirituality, fiction and more.
> > >
> > > ---
> > > http://www.atlantibots.org.uk
> > > http://groups.yahoo.com/group/atlantis_talk/
> > > Atlantibots - stomping across the worlds of Atlantis.
> > > ---
> > > http://www.fuchsiashockz.co.uk
> > > http://groups.yahoo.com/group/void-shockz
> > > ---
> > >
> > > Everyone has talent. What is rare is the courage to follow talent
> > > to the dark place where it leads. -Erica Jong
> > > Ambition is a poor excuse for not having sense enough to be lazy.
> > >          -Milan Kundera
> >
> >



More information about the Python-list mailing list