From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17041 invoked by alias); 21 Feb 2002 09:56:56 -0000 Mailing-List: contact guile-gtk-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: guile-gtk-owner@sources.redhat.com Received: (qmail 16729 invoked from network); 21 Feb 2002 09:56:49 -0000 Received: from unknown (HELO mel-rto3.wanadoo.fr) (193.252.19.233) by sources.redhat.com with SMTP; 21 Feb 2002 09:56:49 -0000 Received: from mel-rta2.wanadoo.fr (193.252.19.152) by mel-rto3.wanadoo.fr; 21 Feb 2002 10:56:49 +0100 Received: from localhost.localdomain (193.253.191.237) by mel-rta2.wanadoo.fr; 21 Feb 2002 10:56:36 +0100 Subject: Re: Newbie pleading for help... From: Hilaire Fernandes To: Alex Kim Cc: Bo Forslund , guile-gtk@sources.redhat.com, guile-user@gnu.org In-Reply-To: <20020220172011.35235.qmail@web20407.mail.yahoo.com> References: <20020220172011.35235.qmail@web20407.mail.yahoo.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/1.0.2 Date: Thu, 21 Feb 2002 01:56:00 -0000 Message-Id: <1014285440.818.29.camel@tice> Mime-Version: 1.0 X-SW-Source: 2002-q1/txt/msg00037.txt.bz2 Alex, Not sure this can help but I have just release DrGenius 0.6.0 which is an interactive geometry software (Gnome/GTK+ based) where guile script can be dropped in the figure. Basicly an user decides to create a script on a figure then input the guile code in a dialog. The code is then evaluated using gh_eval_str when update is needed. You can check at http://www.ofset.org/drgenius Hilaire On Wed, 2002-02-20 at 18:20, Alex Kim wrote: > Hello, > > Thank you very much for your reply. If you wouldn't > mind, I would like to ask you some more questions. > > Guile ref. manual says that "An application can use > Guile as an extension language..." and this is exactly > what I want to do. I am writing a simple image > processing toolkit with GUI in c. The GUI displays an > image and waits for input. The input is an array of > points and the GUI draws lines connecting the points > on top of the image. The input, ie, the array of > points, can be generated using various algorithms and > this is where I am trying to use GUILE as an extension > language: the toolkit provides to GUILE one simple > function that draws a line given two points; the > various algorithms are implemented in GUILE calling > the line drawing function to display their results. > This way, I can easily add new algorithms to the > toolkit without touching any other parts of the code. > And I got it work this far following mainly the > tortoise example written by David Drysdale. > > Then, I wanted to add event processing loop for the > GUI itself to respond to the mouse interaction so > that I can interactively modify the lines as needed. > As I described in the previous message, this > turned out to be very hard for me to achieve since two > event loops that never return are required (one for > gh_repl and the other for GUI). After many days > of struggling with pthread, I learned from the list's > archive that pthread can't solve the problem and also > learned that guile and gtk may give me the solution. > So, I am looking for some example codes or any > pointers that can help me solve my problem. Simply > put, I am looking for something that works just like > the tortoise example (found on GUILE tutorial at > http://www.gnu.org/software/guile/docs/docs.html), > but with added event handling ability for mouse > interaction with GUI. > > I hope I described my problem a bit clearer this time. > Do you think what I am trying to do can be achievable? > Again, I sincerely appreciate your reply and any > further advice/helps. > Thank you very much. > > Sincerely, > --- > > Alex Kim > > > > > > --- Bo Forslund wrote: > > Hello! > > > > > > I'm afraid I can't say that I understand what You > > are asking, but I shall try to give an answer. > > > > I think I understand that You want a graphic > > interface to scheme. You can have the interface > > written entirely in scheme using guile-gtk, or in > > C and use guile-gtk glue functions to to call > > scheme functions. > > I managed to get a deck of cards written in scheme > > into a gtk interface some while ago. I also managed > > to do a little prog with the Glade GUI builder that > > called a scheme function. > > Unfortunate it got lost when I had a a crach and had > > to reinstall Linux from scratch. It was 4 - 5 > > months ago so I don't remember very well what I did > > either. > > > > I started out by reading the examples in guile-gtk > > (guile-1.5.4 and guile-gtk-0.21pre4). It was > > difficult to get them compile due to some errors in > > the Makefile.am. > > > > I also read this pages I found on web. > > > > > > http://www.lilypond.org/wiki/?Guile > > > http://www.nada.kth.se/~mdj/guile-ref/guile-ref_toc.html#TOC10 > > > > > > > > I hope that tihs is to any help > > Bo Forslund > > > > > > Alex Kim wrote: > > > > > Dear guile (and guile-gtk) experts, > > > > > > I understand that my question may irritate some of > > > you since it has been discussed here before. > > > Nevertheless, I am asking the question with > > > desperation and as a last resort. > > > Many apologies. > > > > > > I was given a task a couple of months ago. After > > > a long serious thinking, I came up with an idea > > > which made use of a lot of stack and list > > > operations (which scheme is good at) and wanted to > > > verify my idea as quickly as possible. Fortunately > > > (or unfortunately, I can't say for sure yet), > > > I know just enough scheme to write moderate size > > > programs. So, I started coding in scheme. > > > > > > My intension was to implement the idea in guile > > > scheme and the GUI in c with X or gtk providing > > > one simple line drawing function for guile to call > > > so that I can draw lines as they are computed from > > > scheme code (similar to tortoise example). And it > > > worked great. > > > > > > Then, I wanted to add event processing to the GUI > > > and this is where I got stuck---it also required > > > its own event loop in addition to gh_repl. At > first, > > > I naively thought I could resolve the problem > > > using pthread, which didn't work. With pitiful > > > and (of course) unsuccessful debugging of many > > > days, I looked up the list's archive and found out > > > that the question has been discussed previously > > > and someone successfully solved the problem using > > > event-repl stuff coming with guile-gtk. > > > Nevertheless, with my short knowledge of guile, > > > the discussions were hard to follow and I ended > > > up with a conclusion of rewriting the whole thing > > > in c. > > > > > > However, I still desperately want to stay with > > > > > scheme since it will make further improvement of > > > my idea extremely easier. So, before I begin to > > > rewriting, I thought I might ask you, the guile > > > experts, for help as a last resort. Would anyone > > > out there generously provide me some pointers or > > > simple example codes that work just like tortoise > > > example, but with added event handling ability > > > (either X or gtk)? I would be very grateful to > > > you. > > > > > > Please accept my sincere apology if you got upset > > > by my posting of what has been discussed before. > > > Thank you very much. > > > > > > Sincerely, > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Sports - Coverage of the 2002 Olympic Games > http://sports.yahoo.com > > _______________________________________________ > Guile-user mailing list > Guile-user@gnu.org > http://mail.gnu.org/mailman/listinfo/guile-user >