Murga-Projects Forums
convertFluidToMurguaLua sh - Printable Version

+- Murga-Projects Forums (http://www.murga-projects.com/forum)
+-- Forum: Project Forums (/forumdisplay.php?fid=1)
+--- Forum: MurgaLua - General (/forumdisplay.php?fid=2)
+--- Thread: convertFluidToMurguaLua sh (/showthread.php?tid=7)


convertFluidToMurguaLua sh - iGame3D - 04-25-2007 06:22 PM

Fluid created this code to create a window.

Code:
# data file for the Fltk User Interface Designer (fluid)
version 1.0108
header_name {.h}
code_name {.cxx}
Function {make_window()} {open selected
} {
  Fl_Window {} {
    label aname open
    xywh {815 56 100 100} type Double labeltype NO_LABEL align 1 visible
  } {}
}



send convertFluidToMurgaLua in terminal results in the error, and an empty lua file is made

Code:
awk: illegal field $(  { Fl_Double_Window* o = new Fl_Double_Window(100, 100);), name "currentLine"
input record number 7, file /murgasrc/murgaLua/examples/2test.cxx
source line number 15


I get the same error trying to convert any of the example .cxx files

The CXX

Code:
// generated by Fast Light User Interface Designer (fluid) version 1.0108

#include "2test.h"

Fl_Double_Window* make_window() {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = new Fl_Double_Window(100, 100, "aname");
    w = o;
    o->labeltype(FL_NO_LABEL);
    o->align(FL_ALIGN_TOP);
    o->end();
  } // Fl_Double_Window* o
  return w;
}


and the H

Code:
enerated by Fast Light User Interface Designer (fluid) version 1.0108

#ifndef _2test_h
#define _2test_h
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
Fl_Double_Window* make_window();
#endif




RE: convertFluidToMurguaLua sh - JohnMurga - 04-25-2007 06:44 PM

iGame3D Wrote:
I get the same error trying to convert any of the example .cxx files

The CXX

Code:
// generated by Fast Light User Interface Designer (fluid) version 1.0108

#include "2test.h"

Fl_Double_Window* make_window() {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = new Fl_Double_Window(100, 100, "aname");
    w = o;
    o->labeltype(FL_NO_LABEL);
    o->align(FL_ALIGN_TOP);
    o->end();
  } // Fl_Double_Window* o
  return w;
}


OK, it's that CXX file that you should be converting.

I saved it to "text.cxx" and then did :

Code:
sh tools/convertFluidToMurgaLua.sh test.cxx > test.lua


And got the file, alternatively if AWK on your system is causing the problem (unlikely), you can also try :

Code:
bin/murgaLua tools/convertFluidToMurgaLua.lua test.cxx > test.lua


Which worked for me too.

The output from both was :

Code:
do local object = fltk:Fl_Double_Window(100, 100, "aname");
    window = object;
    object:labeltype(fltk.FL_NO_LABEL);
    object:align(fltk.FL_ALIGN_TOP);
  end
  window:show();
  Fl:run();


Which runs out of the box.

Cheers
JohnM


RE: convertFluidToMurguaLua sh - iGame3D - 04-26-2007 03:30 AM

Ok still can't get the SH to work, still produces the error.

I can get the Lua to work.

Thanks for the help.


RE: convertFluidToMurguaLua sh - JohnMurga - 04-26-2007 03:57 AM

iGame3D Wrote:
Ok still can't get the SH to work, still produces the error.

I can get the Lua to work.

Thanks for the help.


Cool, I'll be removing the SH when I re-work the documentation for the next release ...

Cheers
JohnM