473,657 Members | 2,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Maximize main window with code

I am new to Python. How do I get the following program to appear
initially with the window maximized? Thanks for your help!

from Tkinter import *
# set up the window itself
top = Tk()
F = Frame(top)
F.pack()
# add the widgets
lHello = Label(F, text="Hello")
lHello.pack()
bQuit = Button(F, text="Quit", command=F.quit)
bQuit.pack()
# set the loop running
top.mainloop()

Jul 1 '06 #1
2 7594
JohnJohnUSA wrote:
I am new to Python. How do I get the following program to appear
initially with the window maximized? Thanks for your help!

from Tkinter import *
# set up the window itself
top = Tk()
F = Frame(top)
F.pack()
# add the widgets
lHello = Label(F, text="Hello")
lHello.pack()
bQuit = Button(F, text="Quit", command=F.quit)
bQuit.pack()
# set the loop running
top.mainloop()


This gets pretty close:

top.geometry('% sx%s+0+0' % top.maxsize())

James

--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/
Jul 1 '06 #2
JohnJohnUSA wrote:
I am new to Python. How do I get the following program to appear
initially with the window maximized? Thanks for your help!

from Tkinter import *
# set up the window itself
top = Tk()
top.state("zoom ed")
F = Frame(top)
F.pack()
# add the widgets
lHello = Label(F, text="Hello")
lHello.pack()
bQuit = Button(F, text="Quit", command=F.quit)
bQuit.pack()
# set the loop running
top.mainloop()


</F>

Jul 1 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1839
by: w.p. | last post by:
I use code below: 1) frame receive too many maximize events on create and on close child window - why? 2) how to catch key events for wxMDIParentFrame ? 3) childWin.SetSize() in OnMaximize send additional maximize event (?) 4) wxMDIChildFrame is initially visible! 5) sorry for english :) 6) wxPython 2.5.4.1 (Windows) ################################################################ import wx
10
9740
by: MJB | last post by:
In the main function of my form I check to see if the application is already running. If it is, I throw up a message box telling the user. What I would like to do is also maximize the application, but I am unable to do so. Does anyone have any experience with this. TIA, Matt
1
10907
by: Sanjay Seshasainam | last post by:
How can I maximize a process window I am using the Process class in System.Diagnostics. I can identify the specific process I want using the window title after that I want to maximize the window. I can get the handle for the window using MainWindowHandle how do I maximize the window ? Thanks, Sanjay
0
834
by: Laura Zeafla via .NET 247 | last post by:
I used the .NET forms application wizard. From the form youclick a button and it calls a C++ function through its dll. This function is supposed to pop-up a command prompt window. Something about using this forms application wizard prevents thewindow from opening. The program otherwise runs correctly. Inoticed that the wizard gave me a main with the notation: int APIENTRY main(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR ...
7
5456
by: Colleyville Alan | last post by:
I have an app that uses Access to grab various PowerPoint slides using the followhyperlink command. I have set the PPT window to run in a minimized state: FollowHyperlink link Set oPres = oPPT.ActivePresentation oPPT.WindowState = ppWindowMinimized Then I do the copy and paste part: With oPres
1
2637
by: Brandon | last post by:
Hello there. I'm currently working on a moderately complex Visual C# windows application that I have run into a bit of a problem on. To start things off, the application has normally been run under Windows XP with the theme mode set to Windows Classic (disabling the newer XP theme) at a resolution of 1280 x 1024 on a dual monitor system. The application has two sizes; one is roughly 800 x 600, and the second is full maximize mode. It...
2
2808
by: jj | last post by:
I have a single threaded application in c# that scans through a file system. While doing this if I try to minimize, maximize buttons on the top,right hand corner of my form do not do as they are supposed to do. To maximize the window I have to go to "task manager" and double click the application. How do I control those maximize, minimize buttons on the top right section of my form? A learner here
5
3195
by: Mrozu | last post by:
Hi When I maximize a form in VB.Net 2003 the bottom of the form gets hidden by the start bar (so my status bar is invisible). How can I get my app to maximize to the usable screen area above the start bar? Thx Mrozu
1
2338
by: neeraj | last post by:
Hi people's I developed one MDI application with one MDI form and 2 child forms, form. Border style of first child forms set as Fixed3D and Window State set as normal (like dialog Box) and maximize button set false minimize button set false. My first child form name like FrmClient I have one another child form which Form Border Style property set as Fixed3D and
4
13451
by: EmilH | last post by:
Hi, Can anybody show me how to minimize/maximize a window dynamically? I placed buttons for each of these commands and want to place the code which will minimize and maximize the window. Thanks in advance. Emil.
0
8319
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.