473,396 Members | 2,029 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.

Creating gui in python using opengl. How can i make the text boxes which take values

How can i create gui in python using pyopengl?
Or simply i want to create textbox in python using pyopengl which takes the value entered in text box and the calculation can be conducted. please help me to get through it (p.s. not using thread)
Feb 28 '13 #1
1 2725
bvdet
2,851 Expert Mod 2GB
My understanding is PyOpenGL is interoperable with PyQt, PyGTK, Tkinter, wxPython and other GUI libraries. I know a little Tkinter and have an example of an entry dialog. It's more than you need, but shows how you can do it with Tkinter.
Expand|Select|Wrap|Line Numbers
  1. import Tkinter
  2.  
  3. textFont1 = ("Arial", 20, "bold italic")
  4.  
  5. class EntryWidget(Tkinter.Entry):
  6.     def __init__(self, master, initial=""):
  7.         Tkinter.Entry.__init__(self, master=master)
  8.         self.value = Tkinter.StringVar()
  9.         self.config(textvariable=self.value, width=40,
  10.                     relief="ridge", font=textFont1,
  11.                     bg="#ddd", fg="#e00",
  12.                     justify='center')
  13.         self.pack()
  14.         self.value.set(initial)
  15.  
  16. class App(Tkinter.Tk):
  17.     def __init__(self, title="Case Insensitive Entry"):
  18.         Tkinter.Tk.__init__(self)
  19.         self.title(title)
  20.         self.w = EntryWidget(self, "Enter Text")
  21.         self.w.bind(sequence="<KeyRelease>", func=self.lower)
  22.         self.mainloop()
  23.         self.value = self.w.value.get()
  24.  
  25.     def lower(self, event):
  26.         event.widget.value.set(event.widget.value.get().lower())
  27.  
  28. if __name__ == "__main__":
  29.     app = App()
  30.     print app.value
Feb 28 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
0
by: Neo | last post by:
Hi, i was trying to use textbox and label within a repeater such that when the values on those text boxes are changed the changed values and its coresponding label values must be added to a...
11
by: Edson Peacock | last post by:
I have a report with sub reports, one of the subreports have 12 text boxes that are 2" high and I want them all to grow if one goes to 3" high. If anyone has any suggestions they are very much...
2
by: dpryan | last post by:
I've written a python program that analyzes some data. However, I would like to make it easier to input data from the user. Currently, I have nine text boxes arranged vertically, and the user types...
8
by: Edward | last post by:
I used to do this all the time in HTML-table layouting. How do I do this in CSS? -------------------------------------------------- <table width="400px"> <tr> <td bgcolor="beige">one line of...
6
by: BurntWithTime | last post by:
Hello everyone, Please can anyone tell me if it is possible for a VB.NET application to check a database and then create textboxes on a form that correspond to those records on the database? For...
3
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
5
by: John | last post by:
Hi I am using text boxes on a web form. How can I make it so users can insert values only in the format 99-99-99 ? Thanks Regards
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
11
by: jwessner | last post by:
I have a form (Form1) which contains basic Project data and a subform listing the personnel assigned to the Project as a continuous form. Selecting a person on that project and clicking on a command...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
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
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,...
0
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...

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.