From: Paul Emsley <emsley@ysbl.york.ac.uk>
Subject: guile + gtk, part II
Date: 10 Jan 2003 12:35:17 +0000 [thread overview]
Message-ID: <1042202117.10332.29.camel@maybelline> (raw)
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
reply other threads:[~2003-01-10 12:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1042202117.10332.29.camel@maybelline \
--to=emsley@ysbl.york.ac.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).