Eugtk 2 s paths
- Posted by Chris Burch <chriscrylex at aol.com> Sep 22, 2004
- 495 views
Hi Downloaded and installed eugtk 2 august 22, and installed it on my newly upgraded (SuSE 7.1 to 9.1) systems. Previous eugtks, 1 and 2 had worked great but hadn't updated it for a while. Tried to run the demos, and first there was no path to the wrappers. gtk2 includes put into ~/euphoria/include/gtk2. No problem, just update the demos before running them, so in front of wrapper.gtk, I put gtk2/, eg include gtk2/wrapper.e. Then got no paths to the other included gtk includes when running a demo. Further investigation turns out that all the includes include files without using the path, ie wrapper.e has the line include controls.gtk Ok, I thought, there is no path to the includes in the include. I had to change them all. So I chucked this together.
include file.e include wildcard.e sequence x,file, p1, p2 integer fp, pos object line file = {} p1 = {} p2 = {} pos = 0 x = dir(current_dir()) for i = 1 to length(x) do file = {} if x[i][D_NAME][1] != '.' and compare("convert.exu", x[i][D_NAME]) != 0 then puts(1, "Scanning " & x[i][D_NAME] & "\n") --read in file fp = open(x[i][D_NAME], "r") while 1 do line = gets(fp) if atom(line) then exit end if file = append(file, line) end while close(fp) --check file for gtk matches for j = 1 to length(file) do if wildcard_match("*ude *.gtk*", file[j]) = 1 then puts(1, " Match found - " & file[j]) pos = match("ude ", file[j]) p1 = file[j][1..pos+3] p2 = file[j][pos+4..length(file[j])] file[j] = p1 & "gtk2/" & p2 puts(1, " Replaced with - " & file[j]) end if end for --check file for dlg matches for j = 1 to length(file) do if wildcard_match("*ude *.dlg*", file[j]) = 1 then puts(1, " Match found - " & file[j]) pos = match("ude ", file[j]) p1 = file[j][1..pos+3] p2 = file[j][pos+4..length(file[j])] file[j] = p1 & "gtk2/" & p2 puts(1, " Replaced with - " & file[j]) end if end for --write out file fp = open(x[i][D_NAME], "w") for k = 1 to length(file) do puts(fp, file[k]) end for close(fp) end if end for
this adds gtk2/ to all the gtk and dlg includes. Run it in the gtk2 include directory, but only run it once, make sure you have your back up archive to hand. The demos run fine now, providing you add gtk2/wrapper. to that first vital include in the demo. Now, I'm just curious. Getting something to work is half the fun for me, but am I doing something wrong. You obviously made a conscious change here Irv, and should I just be dumping all the includes into the base include directory? Is this a change made to allow win32 compatability? Or should I have changed the path somewhere along the line? If so how? Anyway, its working now, and as long as you remain consistent with naming and style, I'll be able to update as I go. Good work BTW, nice, smooth, pretty and fast. Oh, and your website was down again earlier today. Chris http://members.aol.com/chriscrylex/euphoria.htm http://uboard.proboards32.com/