guile-gtk-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to get value from combo


From: Andreas Rottmann
Subject: Re: how to get value from combo
Date: Wed, 01 Dec 2004 13:39:45 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Maarten Grachten <address@hidden> writes:

> On Wed, 1 Dec 2004, Andreas Rottmann wrote:
>
>> (use-modules (gnome gtk))
>>
>> (let ((combo (gtk-combo-box-entry-new-text)))
>>   (for-each (lambda (text)
>>               (append-text combo text))
>>             '("foo" "bar" "baz"))
>>
>>   (let ((model (get-model combo)))
>>     (let loop ((iter (get-iter-first model)))
>>       (if iter
>>           (begin
>>             (format #t "~A\n" (get-value model iter 0))
>>             (loop (iter-next model iter)))))))
>
> Thanks Andreas,
>
> the code you provided prints all the values in the combo. But how do I
> know which is the currently selected item?
>
Have you tried (get-active-iter combo)?

Regards, Rotty
-- 
Andreas Rottmann         | address@hidden      | address@hidden | address@hidden
http://yi.org/rotty      | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

Say NO to Software Patents! -- http://petition.eurolinux.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]