473,287 Members | 1,866 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,287 software developers and data experts.

gtk.combo problem

rhitam30111985
112 100+
Hi all.. i am trying to create a combo with the pop down list being modfied in real time as i type each character :
Expand|Select|Wrap|Line Numbers
  1. import gtk
  2. window=gtk.Window(gtk.WINDOW_TOPLEVEL)
  3. window.connect("destroy",gtk.main_quit)
  4. combo=gtk.Combo()
  5. combo.set_use_arrows(True)
  6.  
  7. wordlist=['aata','abbay','acute','adistance','bobbby','cat','cbount','daddy']
  8. def entry_callback(widget,combo):
  9. # ------
  10.  
  11. combo.entry.connect("activate",entry_callback,combo)
  12. window.add(combo)
  13. window.show()
  14. combo.show()
  15. gtk.main()   
  16.  
now my aim is when i enter a chareacter 'a' into the combo.entry field .. all the words beginning with the letter 'a' wud be set in the popdown list .. if the next character is 'c' , meaning now the entry is 'ac' then the pop down list should be modified to only the word 'acute' .. now the problem is the combo.entry.get_text() function will return a string only when the enter key is pressed .. how do i set the pop down list without pressing the enter key ? :( assuming i already haev a function which is a python version of the C function getch() . returning the character which is pressed on the keyboard .. here is the fucntion:

Expand|Select|Wrap|Line Numbers
  1.  
  2. def getch():
  3.     import os, tty
  4.  
  5.     fd = sys.stdin.fileno()
  6.     tty_mode = tty.tcgetattr(fd)
  7.     tty.setcbreak(fd)
  8.     try:
  9.             ch = os.read(fd, 1)
  10.     finally:
  11.             tty.tcsetattr(fd, tty.TCSAFLUSH, tty_mode)
  12.  
  13.     return ch
  14.  
but this wud catch a chaarcter entered in the console .. how do i do the same for the entry box of the combo.. any help appreciated.
regards
Oct 23 '07 #1
3 1960
rhitam30111985
112 100+
uhhhh.... nobody?
Oct 25 '07 #2
bartonc
6,596 Expert 4TB
uhhhh.... nobody?
I wish that you were using wx instead of gtk. Not only would I be able to help when you got stuck, but many of the issues are already taken care of in the framework.
Oct 25 '07 #3
rhitam30111985
112 100+
i wish i was using wx too.. but .. what to do .. the boss is always right :-|
Oct 25 '07 #4

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

Similar topics

4
by: Heather | last post by:
Hi I am desparately looking for advice in relation to storing the results after selecting items from two combo boxes on a Referral form. The first combo box 'ctl Type' displays a full list of...
1
by: Jeff Smith | last post by:
Hi This is a repost due to no responses Here's a problem I've encountered with Access 2003 which has got me to redesign how I get the row source in a second combo box using the first combo...
9
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the...
7
by: Ausclad | last post by:
Ok, ill try again..... It seems fairly simple. I have two combo boxes in a datagrid. The datagrid is bound to a a table in a dataset. The two combo boxes are bound to a single data table...
1
by: lawton | last post by:
Source: this is an access 2003 question My knowledge level: reading books, internet, and trial & error; no formal training I'm trying to get a running sum of what's filtered in a subform which is...
4
by: Dave | last post by:
I wasn't sure how to search for previous posts about this, it felt real specific. Ok so here's the database & problem: I have 4 combo boxes: cboServer, cboPolicy, cboDB, and cboApplication. ...
2
by: biganthony via AccessMonster.com | last post by:
Hi, I decided to install Office 2003 Service Pack 3 on my home computer to test (in full knowledge that there may be some issues with it). After installation, I have noticed that with a small...
6
by: =?Utf-8?B?amVmZmVyeQ==?= | last post by:
i need help with a combo box and this same code works on my first tab with a combo box. The error or problem i have is this code causes an index out of range error when i run it on my second combo...
3
by: evenlater | last post by:
Using Access 2007, I've found that combo box back colors change to transparent from normal inconsistently for no reason I can discern. Never had that problem in previous versions of Access. I do...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.