[Clg-devel] Re: gtk_main?
Brought to you by:
espen
From: ephrem b. <Eph...@ir...> - 2006-04-11 16:28:12
|
Hi Espen, How can we run the main loop waiting the return value for a dialog for example. I've tried the function (main) to wait the return value of the OK button of a file chooser for example, but it doesn't seem to work. Isn't it possible to make something like that: (defun my-choose-file-dialog () (let* ((dialog (make-instance 'file-chooser-dialog )) (return-value nil)) (dialog-add-button dialog "gtk-cancel" #'widget-destroy :object t) (dialog-add-button dialog "gtk-ok" #'(lambda () (if (slot-boundp dialog 'filename) (setq return-value (file-chooser-filename dialog)) (widget-destroy dialog)))) (widget-show-all dialog) (main) ;;????? return-value)) to use it like : (setf my-chosen-file (my-choose-file-dialog)) Have I made something wrong? Thanx |