Re: The Big Project I was working on
- Posted by Icy_Viking Jun 21, 2021
- 1024 views
ghaberek said...
Icy_Viking said...
--Snippet of some Wrapper Code public constant xFl_Window_new = define_c_func(fltk,"+Fl_Window_new",{C_INT,C_INT,C_INT,C_INT,C_POINTER},C_POINTER) public function Fl_Window_new(atom x,atom y,atom w,atom h,sequence title) atom str = allocate_wstring(title,1) return c_func(xFl_Window_new,{x,y,w,h,str}) end function
AS you can see that text does not display cleary. At this point it is stuck in limbo until I decide to try to finish or abandon it. I am curious to hear what you guys think.
It looks like the title parameter of Fl_Window_new() is declared as const char* so you need to use allocate_string() (for 8-bit chars) not allocate_wstring() (for 16-bit wchars).
#define WIDGET_DECLARE(widget) \ typedef struct widget widget; \ widget *widget##_new(int x, int y, int width, int height, const char *title); \ int widget##_x(widget *); \ int widget##_y(widget *); \ int widget##_width(widget *); \ int widget##_height(widget *); \ const char *widget##_label(widget *); \ ...
-Greg
The text still doesn't display correctly. I've tried using allocate_string and allocate_wstring().