Beispiel #1
0
        public static bool SetActiveText(ComboBox cbox, string text)
        {
            // returns true if found, false if not found

            string    tvalue;
            TreeIter  iter;
            ListStore store = (ListStore)cbox.Model;

            store.IterChildren(out iter);
            tvalue = store.GetValue(iter, 0).ToString();
            if (tvalue.Equals(text))
            {
                cbox.SetActiveIter(iter);
                return(true);
            }
            else
            {
                bool found = store.IterNext(ref iter);
                while (found == true)
                {
                    tvalue = store.GetValue(iter, 0).ToString();
                    if (tvalue.Equals(text))
                    {
                        cbox.SetActiveIter(iter);
                        return(true);
                    }
                    else
                    {
                        found = store.IterNext(ref iter);
                    }
                }
            }

            return(false);            // not found
        }
Beispiel #2
0
        private void RefreshMemberSelector()
        {
            TreeIter iter;

            memberStore.IterChildren(out iter);
            foreach (MemberRecordFactory rv in recordFactory)
            {
                memberStore.SetValue(iter, 0, new GLib.Value(rv.FullTitle));
                memberStore.IterNext(out iter);
            }
        }