Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 768975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:15:53+00:00 2026-05-14T18:15:53+00:00

I create a combo box using PyGTK: fileAttrCombo = gtk.ComboBox(); I want to attach

  • 0

I create a combo box using PyGTK:

fileAttrCombo = gtk.ComboBox(); 

I want to attach a signal handler for this combo box. This signal handler handles when user change selection in the combo box.

What is be the best approach to do this ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:15:53+00:00Added an answer on May 14, 2026 at 6:15 pm

    The combobox has a “changed” signal.

    This is a nice minimal example of using it.

    #!/usr/bin/env python
    
    import pygtk
    pygtk.require('2.0')
    import gtk
    
    class ComboBoxExample:
        def __init__(self):
            window = gtk.Window()
            window.connect('destroy', lambda w: gtk.main_quit())
            combobox = gtk.combo_box_new_text()
            window.add(combobox)
            combobox.append_text('Select a pie:')
            combobox.append_text('Apple')
            combobox.append_text('Cherry')
            combobox.append_text('Blueberry')
            combobox.append_text('Grape')
            combobox.append_text('Peach')
            combobox.append_text('Raisin')
            combobox.connect('changed', self.changed_cb)
            combobox.set_active(0)
            window.show_all()
            return
    
        def changed_cb(self, combobox):
            model = combobox.get_model()
            index = combobox.get_active()
            if index:
                print 'I like', model[index][0], 'pie'
            return
    
    def main():
        gtk.main()
        return
    
    if __name__ == "__main__":
        bcb = ComboBoxExample()
        main()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a GUI in which the combo-box allows me to open
Using Cocoa, I'd like to create a combo box as seen in Safari -
I want to create a HTML customized select combo box. What are the libraries
1) I want to redesign a combo box using CSS and (minimal or none
I need to create a combo box that can be modified by the user
I have to create the classic combo-box with arrows up and down to increment
I'm trying to create a class that manages the events of a combo box
I'm making a windows application where user selects a type from combo box. Based
I have a combo box and a datagrid in my page. when the user
I'm using Glade 3 to create a GtkBuilder file for a PyGTK app I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.