From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Paul Emsley Newsgroups: gmane.lisp.guile.user Subject: guile + gtk, part II Date: 10 Jan 2003 12:35:17 +0000 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <1042202117.10332.29.camel@maybelline> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1042202922 25587 80.91.224.249 (10 Jan 2003 12:48:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 10 Jan 2003 12:48:42 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18WyaW-0006eO-00 for ; Fri, 10 Jan 2003 13:48:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18WyZd-0005bF-00 for guile-user@m.gmane.org; Fri, 10 Jan 2003 07:47:45 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18WyYQ-0004wD-00 for guile-user@gnu.org; Fri, 10 Jan 2003 07:46:30 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18WyXy-0004bz-00 for guile-user@gnu.org; Fri, 10 Jan 2003 07:46:03 -0500 Original-Received: from gnudist.gnu.org ([199.232.41.7]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18WyXM-0004MM-00 for guile-user@gnu.org; Fri, 10 Jan 2003 07:45:24 -0500 Original-Received: from mta01-svc.ntlworld.com ([62.253.162.41]) by gnudist.gnu.org with esmtp (Exim 4.10.13) id 18WyOd-0002SR-00 for guile-user@gnu.org; Fri, 10 Jan 2003 07:36:23 -0500 Original-Received: from pc3-broo2-4-cust124.renf.cable.ntl.com ([81.101.238.124]) by mta01-svc.ntlworld.comESMTP <20030110123613.UKRZ22267.mta01-svc.ntlworld.com@pc3-broo2-4-cust124.renf.cable.ntl.com> for ; Fri, 10 Jan 2003 12:36:13 +0000 Original-To: guile-user@gnu.org X-Mailer: Ximian Evolution 1.0.5 (1.0.5-4) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: General Guile related discussions List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:1522 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1522 Hi, I read the reference manual, and decided that my program was sufficiently like the example (dia) that I would follow the described method. I also looked at gtk-guile and guile-gui. I used swig to generate the new function names and used a gtk-entry (with callback) so that I could type commands. I must tell you how totally thrilling it was to type the command and for the display DO IT as if I'd gui-ed it. Marvellous - I've wanted to be able to do that for a long time. Now, it seems that I am living in the C world, but gtk-guile and guile-gui are in the guile world. I want to add to my program something similar to what guile-gui has - a gtk-entry and a gtk-text to capture display the result. However, I can't see how to do this from the C world. Incidently, I had problems with void c_inner_main(int argc, char** argv) in my c++ program. There was problems relating to types and void, I think. I don't have the error code to hand, sorry. I fixed it by having the c++ main calling a c c_inner_main routine - it was ugly and i'd rather not do it. Is this a known problem? It is not clear to me how to add "protection" to the commands that I type in the gtk-entry. Here is how I wrap them (I copied this from somewhere): SCM handler = scm_c_eval_string ("(lambda (key . args) " "(display (list \"Error in proc:\" key \" args: \" args)) (newline))"); std::string my_typed_function("(lambda() "); my_typed_function += gtk_entry_get_text(GTK_ENTRY(entry)); my_typed_function += " )"; SCM scm_code = scm_c_eval_string(my_typed_function.c_str()); scm_catch(SCM_BOOL_T, scm_code, handler); Is that right? I want to capture the result and display it in the gtk-text. How do I do that? So that I could try a different approach (from the guile-world), I did make an attempt to recompile my program and all its libraries and dependences as PIC libs, but not finished (since there was a problem loading the so libraries in my previous version of guile). This is still non-trivial for me to do - is it The Right Way To Go? Also, I want to read in a myprogramrc file. If I use: scm_c_primitive_load(file); then that falls over (as you know) if there is a syntax error. What should I use instead? Thanks for your time, I am at the stage where this is still twisting my head into little knots. Paul. _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user