Search found 13 matches

by taijinantangXX
Aug 14, 2018 12:43
Forum: Libraries Questions
Topic: Question about FLTK and FreeBASIC
Replies: 18
Views: 6643

Re: Question about FLTK and FreeBASIC

And another version with Chinese characters (So you can see the error is not caused by REMs) REM 编译方法(Windows) fbc -s gui xxx.bas REM 编译方法(Linux) fbc -s gui xxx.bas -l X11 #include once "fltk-c.bi" #include once "vbcompat.bi" #IFDEF __FB_LINUX__ #include once "X11/Xlib.bi&qu...
by taijinantangXX
Aug 14, 2018 12:41
Forum: Libraries Questions
Topic: Question about FLTK and FreeBASIC
Replies: 18
Views: 6643

Re: Question about FLTK and FreeBASIC

I've found the best solution by surfing the Internet day by day. I combined my previous code with WQ1980's code. NOW, this programme can be compiled on both Windows and Linux machines, and works fine(just as my wish - parsing time second by second). REM (Windows) fbc -s gui xxx.bas REM (Linux) fbc -...
by taijinantangXX
Aug 14, 2018 12:36
Forum: Libraries Questions
Topic: Question about FLTK and FreeBASIC
Replies: 18
Views: 6643

Re: Question about FLTK and FreeBASIC

WQ1980 Thank you for your help. But your code can't run on my machine. The system reported "segment fault, core dumped." Here too: [xcb] Unknown request in queue while dequeuing [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called [xcb] Aborting, sorry ab...
by taijinantangXX
Aug 14, 2018 12:33
Forum: Libraries Questions
Topic: Question about FLTK and FreeBASIC
Replies: 18
Views: 6643

Re: Question about FLTK and FreeBASIC

badidea wrote:Yep, without sleep, the computer is probably to busy looping (throwing all its computing power at this loop), no time for graphics updates. Sleep 1,1 is probably also OK.

Edit: Not sure if sleep is needed if Fl_wait is also used.
Yes sleep is VERY IMPORTANT in such programme.
by taijinantangXX
Aug 14, 2018 12:32
Forum: Libraries Questions
Topic: Question about FLTK and FreeBASIC
Replies: 18
Views: 6643

Re: Question about FLTK and FreeBASIC

grindstone wrote:On my machine (WinXP/32) WQ1980's code works.

Commenting out the Fl_SetFont statement causes a segmentation fault.
I've tested : Yes, On WinXP it works fine (just as my wish - parsing time second by second). But, it didn't work on Linux.

(BTW: The error is not caused by the REM...)
by taijinantangXX
Aug 07, 2018 18:26
Forum: Libraries Questions
Topic: Question about FLTK and FreeBASIC
Replies: 18
Views: 6643

Re: Question about FLTK and FreeBASIC

WQ1980

Thank you for your help.
But your code can't run on my machine. The system reported "segment fault, core dumped."
by taijinantangXX
Aug 07, 2018 18:22
Forum: Libraries Questions
Topic: Question about FLTK and FreeBASIC
Replies: 18
Views: 6643

Re: Question about FLTK and FreeBASIC

grindstone I've REMed some lines with Chinese characters and font settings. Your computer may have not got the Chinese font I used, so you got a grey window with nothing showing on it. Following is ths code: #include once "fltk-c.bi" #include once "fbthread.bi" #include once &qu...
by taijinantangXX
Aug 07, 2018 7:17
Forum: Libraries Questions
Topic: Question about FLTK and FreeBASIC
Replies: 18
Views: 6643

Question about FLTK and FreeBASIC

Hey, guys! I've wrote a simple programme which is a window showing DATE and TIME second by second using FreeBASIC and FLTK. BUT, The time didn't go second by second (sometime did sometime no). Is there anything wrong with my code? Could someone kindly correct it for me. Thank you. Here is the code: ...
by taijinantangXX
May 24, 2015 8:13
Forum: General
Topic: How to transcode between ANSI anc UTF?
Replies: 3
Views: 1817

Re: How to transcode between ANSI anc UTF?

Thank you very much, grindstone. But I still have problems about using UTFtoChar and UTFtoWchar. When I used UTFtoChar (and my programme was in UTF-8), I followed your instruction and the bi file to DIM my variables and pointers. The compilation got through without any error or warning, but the outp...
by taijinantangXX
May 23, 2015 2:07
Forum: General
Topic: How to transcode between ANSI anc UTF?
Replies: 3
Views: 1817

How to transcode between ANSI anc UTF?

I've noticed that there is a utf_conv.bi include file. There are 4 functions in it. They make me confused and I can't figure out how to use them. Could anyone kindly write some code to show how to use each of them? Or explain what is stand for each parameter?
by taijinantangXX
Mar 23, 2015 5:25
Forum: Sources, Examples, Tips and Tricks
Topic: Can anyone kindly translate this GTK program?
Replies: 1
Views: 1160

Can anyone kindly translate this GTK program?

Could anyone kindly translate this GTK sample program for me? from C to FB Thank you! #include <gtk-2.0/gtk/gtk.h> #define NAME "root" #define PWD "123456" //structure of main window struct login_widget{ GtkWidget *window; //main window GtkWidget *label_tips; //tooltip GtkWidget ...
by taijinantangXX
Dec 19, 2014 6:22
Forum: Windows
Topic: How to compile a gen gcc generated c file?
Replies: 2
Views: 1124

How to compile a gen gcc generated c file?

I saw fbc has an option called gen gcc.
I use this: -gen gcc -r to get a .c file.
But when compiling with gcc, it reports a lot of errors.

My question is that : can the -gen gcc -r generated .c file be compiled with normal gcc?
by taijinantangXX
Dec 19, 2014 6:13
Forum: Windows
Topic: Cross Compiling
Replies: 1
Views: 975

Cross Compiling

How to cross compile using FreeBASIC?
1, how to compile from Windows to Linux or vise versa?
2, how to compile from Windows 64bit to Windows 32bit or vise versa?
THX