473,549 Members | 2,346 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[Tkinter] first app

my questions are
1. how to force focus to Entry widget
2. how to link the buttons and launch(servernu mber, button) function

see for sources below or in attachment

=============== =============== =============== =============== =============
la2launcher.py
=============== =============== =============== =============== =============
# Line Age II Launcher
# futures are
# * select server
# * account registration
# * reset game options
from Tkinter import *
from config import *
def launch(servernu mber, button):
"""server number - server number entered, button - string =
['start'|'reg'|' reset']
"""
print servernumber, button
root = Tk()

root.title(msgM ainWindowTitle)

l1 = Label(root, text = msgServerNumber ).grid(padx = 5, pady = 5, column =
0, row = 0)
e1 = Entry(root, width = 4)
e1.grid(padx = 5, pady = 5, column = 1, row = 0)
e1.insert(END, '1')
dummy1 = Label(root, text = ' ' * 60).grid(padx = 5, pady = 5, column = 2,
row = 0)

m1 = Message(root, text = msgServersList, width = 400).grid(padx = 5, pady
= 5, column = 0, row = 1, columnspan = 3, sticky = W)

b1 = Button(root, text = msgStartButton) .grid(padx = 5, pady = 5, column =
0, row = 2)
b2 = Button(root, text = msgRegistration Button).grid(pa dx = 5, pady = 5,
column = 1, row = 2)
b3 = Button(root, text = msgResetConfigs Button).grid(pa dx = 5, pady = 5,
column = 2, row = 2, sticky = E)

root.mainloop()
=============== =============== =============== =============== =============
=============== =============== =============== =============== =============
config.py
=============== =============== =============== =============== =============
# codepage = cp1251
#
#
#
def u(s):
return unicode(s, 'cp1251')
msgMainWindowTi tle = u('Line Age II Стартер - Выбор сервера,
регистрация и настройки')
msgServerNumber = u('Номер сервера')
msgStartButton = u(' Запуск игры ')
msgRegistration Button = u(' Регистрация на сервере ')
msgResetConfigs Button = u(' Сбросить настройки игры ')
msgServersList = u("""Номера серверов:
[1] http://www.enforce.ru/
[2] http://www.melcosoft.ru/

""")
=============== =============== =============== =============== =============

Jul 18 '05 #1
0 1054

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

Similar topics

2
4612
by: Stewart Midwinter | last post by:
I would like to link the contents of three OptionMenu lists. When I select an item from the first list (call it continents), the contents of the 2nd list (call it countries) would update. And in turn the contents of the 3rd list (call it states would be updated by a change in the 2nd list. If anyone can share a recipe or some ideas, I'd be...
7
11886
by: SeeBelow | last post by:
Do many people think that wxPython should replace Tkinter? Is this likely to happen? I ask because I have just started learning Tkinter, and I wonder if I should abandon it in favor of wxPython. Mitchell Timin -- "Many are stubborn in pursuit of the path they have chosen, few in
25
3328
by: BJЖrn Lindqvist | last post by:
See: http://www.wxpython.org/quotes.php. especially: "wxPython is the best and most mature cross-platform GUI toolkit, given a number of constraints. The only reason wxPython isn't the standard Python GUI toolkit is that Tkinter was there first." - Guido van Rossum Guess, that answers my question, but isn't "Tkinter was there first" a...
4
2090
by: Peter G Carswell | last post by:
Good Morning. I am new to Tkinter. I have been testing the installation of Tkinter through the python web site. The first two test steps give no errors, 'import _tkinter' and 'import Tkinter'. However, the third step, 'Tkinter._test', gives the error: <function _test at 0xb7ec8df4> Any suggestions?
1
2955
by: syed_saqib_ali | last post by:
Please take a look at and run the code snippet shown below. It creates a canvas with vertical & Horizontal scroll-bars. If you shrink the window to smaller than the area of the canvas, the scroll-bars work as advertised. That's great. However, if you click the Left Mouse button, it calls code which expands the width of the canvas by 100...
1
5216
by: yvesd | last post by:
hello i want to intercept tkinter python system events like wm_delete_window and if possible for any window, but the newest code I've produced give me an error : Traceback (most recent call last): File "C:\Documents and Settings\yvesd\Bureau\protowin.py", line 36, in ? b1 = Tkinter.Button (win1)
7
1938
by: krishnakant Mane | last post by:
hello all, I seam to have noticed this a bit late but it appears to me that tkinter is being used very widely for gui development on all platform? is that right? since fredric lundh has written a very good introduction to tkinter (was that just an intro?), I have got keen interest to know the following. may be fredric himself might put some...
8
3270
by: karthikbalaguru | last post by:
Hi, One of my python program needs tkinter to be installed to run successfully. I am using Redhat 9.0 and hence tried installing by copying the tkinter-2.2.2-36.i386.rpm alone from the CD 3 to my pc. But, it is not getting installed and is failing by throwing the below errors. Should i need to configure / install any specific files for...
3
3904
by: J-Burns | last post by:
Hello. Im a bit new to using Tkinter and im not a real pro in programming itself... :P. Need some help here. Problem 1: How do I make something appear on 2 separate windows using Tkinter? By this I mean that the format would be something like this: You have Page1 : This has 2-3 buttons on it. Clicking on each button opens up a new...
4
4968
by: njwilson23 | last post by:
I'm having trouble with tkinter on a new installation of Python (2.6), built with the framework option from source that was downloaded from python.org. I'm running OS 10.4 on a PowerPC G4. The problem first arose when I tried to run matplotlib - it couldn't find tcl/tk because it was searching for 8.5, and I had 8.4. I found and built...
0
7740
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7985
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...
1
7503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7830
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...
1
5387
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...
0
5111
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3496
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1082
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
784
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...

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.