News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
convertFluidToMurguaLua sh
Author Message
iGame3D
Moderator
***


Posts: 231
Group: Moderators
Joined: Apr 2007
Status: Offline
Reputation: 0
Post: #1
convertFluidToMurguaLua sh

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

This post was last modified: 04-25-2007 06:36 PM by iGame3D.

04-25-2007 06:22 PM
Visit this user's website Find all posts by this user Quote this message in a reply
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #2
RE: convertFluidToMurguaLua sh

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

04-25-2007 06:44 PM
Visit this user's website Find all posts by this user Quote this message in a reply
iGame3D
Moderator
***


Posts: 231
Group: Moderators
Joined: Apr 2007
Status: Offline
Reputation: 0
Post: #3
RE: convertFluidToMurguaLua sh

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

I can get the Lua to work.

Thanks for the help.

04-26-2007 03:30 AM
Visit this user's website Find all posts by this user Quote this message in a reply
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #4
RE: convertFluidToMurguaLua sh

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

04-26-2007 03:57 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: