473,396 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

[Tkinter] first app

my questions are
1. how to force focus to Entry widget
2. how to link the buttons and launch(servernumber, 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(servernumber, button):
"""server number - server number entered, button - string =
['start'|'reg'|'reset']
"""
print servernumber, button
root = Tk()

root.title(msgMainWindowTitle)

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 = msgRegistrationButton).grid(padx = 5, pady = 5,
column = 1, row = 2)
b3 = Button(root, text = msgResetConfigsButton).grid(padx = 5, pady = 5,
column = 2, row = 2, sticky = E)

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

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

Jul 18 '05 #1
0 1047

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

Similar topics

2
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...
7
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...
25
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...
4
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'....
1
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...
1
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...
7
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...
8
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...
3
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.