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 3311048
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:49:51+00:00 2026-05-17T21:49:51+00:00

If I have a combo box in pyGTK and would like to set a

  • 0

If I have a combo box in pyGTK and would like to set a list of strings and then on clicking on one activate a command how would I do it?

At the moment I have:

    self.combo_key = gtk.Combo()
    self.combo_key.set_popdown_strings(self.keys)
    self.combo_key.entry.set_text(db.keys()[0])
    self.combo_key.entry.connect("activate", self.key_sel)

But "activate" only calls after selection, and then by pressing enter. I’m also getting a deprecation warning for gtk.Combo() but cannot find any help on using gtk.ComboBoxEntry()

Any help guys?

  • 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-17T21:49:52+00:00Added an answer on May 17, 2026 at 9:49 pm

    Try using a gtk.ComboBox instead of gtk.Combo, since the latter is deprecated in favor of the former. To initialise, you can you code like:

    liststore = gtk.ListStore(gobject.TYPE_STRING)
    for key in self.keys:
        liststore.append((key,))
    combobox = gtk.ComboBox(liststore)
    cell = gtk.CellRendererText()
    combobox.pack_start(cell, True)
    combobox.add_attribute(cell, 'text', 0)
    

    Now you connect to the changed signal of the combobox and use its get_active() method to ask for the item that was selected.

    As you might guess from this explanation, the ComboBox isn’t exactly made for this purpose. You probably want to use gtk.Menu.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a combo box in my WPF project and I would like to
I have created combo box that I would like to load with all of
I want to have file combo box in delphi. It must behave like this:
I have a combo box and drop down items are coming like: <select name=combo1
I have one combo box which displays a text box when 2nd or 3rd
I have a combo box where I am displaying some entries like: Equals Not
I have a combo box in which I set up an ItemTemplate that looks
I have a combo box with forceSelection config is set to true. The combo
I have a combo box in Access and it contains a list of the
I have a combo box that contains 5 items. I have one label on

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.