[27124] in Source-Commits
Re: /svn/athena r25960 - in trunk/debathena/debathena/nautilus-afs: . debian
daemon@ATHENA.MIT.EDU (Jonathan Reed)
Fri May 3 13:25:23 2013
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=us-ascii
From: Jonathan Reed <jdreed@MIT.EDU>
In-Reply-To: <alpine.GSO.1.10.1305031318410.9389@multics.mit.edu>
Date: Fri, 3 May 2013 13:25:13 -0400
Cc: source-commits@MIT.EDU
Message-Id: <D1F071A7-1841-443F-A0B3-7FE9926A1E1A@MIT.EDU>
To: Benjamin Kaduk <kaduk@MIT.EDU>
Content-Transfer-Encoding: 8bit
On May 3, 2013, at 1:19 PM, Benjamin Kaduk wrote:
>> + # Set entity combo to "specify manually"
>> + # This would be easier if GtkBuilder actually set the id-column
>> + # property. Fortunately, it's the first entry in the list.
>> + self.builder.get_object("entityCombo").set_active_iter(self.builder.get_object("entityCombo").get_model().get_iter_first())
>
> Is it documented that the first entry is the id?
> In the absence of such a guarantee, this feels like a fragile hack (not that I am an experienced GtkBuilder user or anything).
Sorry, pronoun overload in the comments. The second "it's" refers to the combobox entry we want. That is, the combo box entry we want to set as the current selection is the first item in the list, and that is guaranteed to be true (specified in the Glade file).
The set_active_iter(get_model().get_iter_first()) is the accepted idiom for "Set the first item in the {combobox,listview,treeview} as the currently selected item".
-Jon