Skip to content

Instantly share code, notes, and snippets.

@Furao
Created September 1, 2011 21:35
Show Gist options
  • Save Furao/1187347 to your computer and use it in GitHub Desktop.
Save Furao/1187347 to your computer and use it in GitHub Desktop.
Prevent a Combobox from scrolling in PyGTK
def combo_scrolling(combobox, event):
"""Prevent the comboboxes from scrolling."""
combobox.emit_stop_by_name("scroll-event")
values = ['item 1', 'item 2', 'item 3']
combo = gtk.combo_box_new_text()
# Fill with part type options
for val in values:
combo.append_text(val)
# Set default selection to first field
combo.set_active(0)
combo.connect("scroll-event", combo_scrolling)
@serdarsen
Copy link

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment