LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-17-2012, 09:01 AM   #1
devilboy09
Member
 
Registered: Nov 2011
Location: Iran
Distribution: Debian, CentOS, LFS, CloudLinux
Posts: 377

Rep: Reputation: 10
pygtk --> default value in ComboBox()


i've created a combo box with this command:
Code:
combo = gtk.combo_box_new_text()
and i added a few text to it.my question is how can i set a default string to this combo box.by default when i run my program the content of combo box is empty until i choose one the entries.
 
Old 04-16-2012, 06:36 PM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
Use the set_active member function to set the index of the default.

Code:
combo.set_active(0)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gtk.Toolbar() -> add combobox devilboy09 Programming 1 03-15-2012 05:14 AM
[SOLVED] How to build pygtk with non system default python? Dstruct0 Linux - Software 3 04-14-2011 03:15 PM
Clean Qt selection comboBox threaderslash Programming 1 11-05-2009 05:00 PM
gtkmm combobox problem shmonkey Programming 2 03-26-2005 05:07 PM
How to open a Combobox in GTK captainfreedom Programming 0 05-30-2004 03:26 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration