Still some issues with GTXWC

407 views
Skip to first unread message

flicker177

unread,
Jan 31, 2026, 4:17:14 PMJan 31
to Harbour Users

I thought this would be simple. (I keep making that mistake ;-) )

I have a Harbour app that I started working on 30 years ago in Clipper S’87. It has always run under Windows. In the current version I’m compiling it with Harbour 3.2-dev and using the GT system to provide a realizable window and this works fine. At the start of the program I have this GT setup:

ANNOUNCE HB_GT_SYS

REQUEST HB_GT_WVT_DEFAULT


// get font size and width from system file

SELECT 1

USE SAILSYS

GO TOP

hb_gtInfo( HB_GTI_FONTSIZE, FONT_SIZE )

hb_gtInfo( HB_GTI_FONTWIDTH, FONT_WIDTH )


hb_gtInfo( HB_GTI_WINTITLE, "Flickerware" )

hb_gtInfo( HB_GTI_ICONFILE, "Flickerware45.ico" )

hb_gtInfo( HB_GTI_FONTNAME, "Consolas" )


hb_gtInfo( HB_GTI_SELECTCOPY, .T. )

hb_gtInfo( HB_GTI_CLOSABLE, .T. )

hb_gtInfo( HB_GTI_RESIZABLE, .T. )

hb_gtInfo( HB_GTI_CODEPAGE, 255 )

hb_gtInfo( HB_GTI_ALTENTER, .T. )


SetMode( 25, 80 )


I compile the program using hbmk2 like this:

hbmk2 sail.prg hbwin.hbc -comp=mingw

This works fine and gives me a readable and resizable window.

Now I’m trying to port the app to Linux. I have it running fine in the terminal. However all my attempts to use the GT system in Linux have issues.

My Linux GT setup is this:

ANNOUNCE HB_GT_SYS

REQUEST HB_GT_XWC_DEFAULT

// get font size and width from system file

SELECT 1

USE SAILSYS

GO TOP

hb_gtInfo( HB_GTI_FONTSIZE, FONT_SIZE )

hb_gtInfo( HB_GTI_FONTWIDTH, FONT_WIDTH )


hb_gtInfo( HB_GTI_WINTITLE, "Flickerware" )

hb_gtInfo( HB_GTI_ICONFILE, "Flickerware45.ico" )

hb_gtInfo( HB_GTI_FONTNAME, "Monospace Regular" )


hb_gtInfo( HB_GTI_SELECTCOPY, .T. )

hb_gtInfo( HB_GTI_CLOSABLE, .T. )

hb_gtInfo( HB_GTI_RESIZABLE, .T. )

hb_gtInfo( HB_GTI_CODEPAGE, 255 )

hb_gtInfo( HB_GTI_ALTENTER, .T. )


SetMode( 25, 80 )


If I compile the app like this:

hbmk2 sail.prg

I get this:

Harbour 3.2.0dev (r2512120309)

Copyright (c) 1999-2025, https://harbour.github.io/

Compiling 'sail.prg'...

Compiling 'SAILPRC.prg'...

Compiling 'SAILAWD.prg'...

Compiling 'SAILSER.prg'...

Compiling 'SAILMNT.prg'...

Compiling 'SAILPHRF.prg'...

Compiling 'SAILFLG.prg'...

Compiling 'SAILHI.prg'...

Lines 573, Functions/Procedures 83

Generating C source output to '/tmp/hbmk_ywsca9.dir/sail.c'... Done.

/usr/bin/ld: /tmp/hbmk_ywsca9.dir/sail.o:(.data.rel+0x1750): undefined reference to `HB_FUN_HB_GT_XWC_DEFAULT'

collect2: error: ld returned 1 exit status

I looked all over the place and could not find any HB_FUN_xxxx files, maybe these are internal functions?

I then tried compiling like this:

hbmk2 -gtxwc sail.prg

This eliminates the compile error and I can actually run my program. It comes up in a very small X11 window. If I resize the window my program doesn’t resize with it, if I make the window even smaller line wraps cause fragmenting of the display. Also my hb_gtInfo options seem to be ignored.

I’m sure I’m showing my ignorance here, I know xBase better than Linux/Unix. I hope what I’m trying to do is understandable. Thanks in advance for any help.

--Bill



Davide Ricca

unread,
Feb 1, 2026, 10:49:48 AMFeb 1
to Harbour Users
Hi,
I've been using gtxwc for many years.
With Ubuntu 22.04, not all the fixed X fonts were available.
So I switched to using gttrm on the Linux Mint Cinnamon terminal.
In the terminal preferences, choose the font (Liberation Mono Regular works).
Compile with hbmk2 -gttrm myapp.hbp
I only use setmode() for the window size (row x col) and setcolor().
 However, you can resize with the mouse and read maxrow() maxcol().
By the way, it also works well over ssh.
Regards
Davide

flicker177

unread,
Feb 2, 2026, 11:56:56 AMFeb 2
to Harbour Users
Hi Davide,

I tried your suggestion with gttrm but I have the same problem. I made a couple of small test programs to more easily troubleshoot this. The first one is for Windows, this works fine. Compile and run it under Windows and you'll get a window with some dummy text. Grab the lower-right corner of the window with the mouse and drag it to resize the window. You'll notice that the contents of the window change size with the window.

I'm compiling it like this: hbmk2 gtwin.prg

--------------------------------------------
// gtwin.prg
// test windows gt system bt 02/02/2026
PROCEDURE main

// harbour setup
#include "inkey.ch"
#include "hbgtinfo.ch"

ANNOUNCE HB_GT_SYS
REQUEST HB_GT_WVT_DEFAULT

// set font size and width
hb_gtInfo( HB_GTI_FONTSIZE, 30 )
hb_gtInfo( HB_GTI_FONTWIDTH, 15 )

// window title and font
hb_gtInfo( HB_GTI_WINTITLE, "GT test" )
hb_gtInfo( HB_GTI_FONTNAME, "Consolas" )

// window parameters

hb_gtInfo( HB_GTI_SELECTCOPY, .T. )
hb_gtInfo( HB_GTI_CLOSABLE, .T. )
hb_gtInfo( HB_GTI_RESIZABLE, .T. )
hb_gtInfo( HB_GTI_CODEPAGE, 255 )
hb_gtInfo( HB_GTI_ALTENTER, .T. )

// window size
SetMode( 23, 50 )
set color to "6+/1,4/3"
clear

@ 1,1 to 20,48
@ 2,2   say "--------------top of window------------------"
@ 11,2  say "-----------middle of window------------------"
@ 19,2  say "----------bottom of window------------------"
@ 21,1

wait
set color to

// end

---------------------------------------------
Here is the same program for Linux. I compile it with: hbmk2 gtlnx.prg The only changes are that it uses HB_GT_TRM instead of HB_GT_WVT and it uses the Liberation Mono font instead of Courier. This does not act the same. The contents of the window do not change size with the window. Also all of the hb_gtinfo parameters seem to be ignored. I'd like the Linux version work like the Windows version.

// gtlnx.prg
// test linux gt system bt 02/02/2026
PROCEDURE main

// harbour setup
#include "inkey.ch"
#include "hbgtinfo.ch"

ANNOUNCE HB_GT_SYS
REQUEST HB_GT_TRM_DEFAULT

// set font size and width
hb_gtInfo( HB_GTI_FONTSIZE, 30 )
hb_gtInfo( HB_GTI_FONTWIDTH, 15 )

// window title and font
hb_gtInfo( HB_GTI_WINTITLE, "GT test" )
hb_gtInfo( HB_GTI_FONTNAME, "Liberation Mono" )

// window parameters

hb_gtInfo( HB_GTI_SELECTCOPY, .T. )
hb_gtInfo( HB_GTI_CLOSABLE, .T. )
hb_gtInfo( HB_GTI_RESIZABLE, .T. )
hb_gtInfo( HB_GTI_CODEPAGE, 255 )
hb_gtInfo( HB_GTI_ALTENTER, .T. )

// window size
SetMode( 23, 50 )
set color to "6+/1,4/3"
clear

@ 1,1 to 20,48
@ 2,2   say "--------------top of window------------------"
@ 11,2  say "-----------middle of window------------------"
@ 19,2  say "----------bottom of window------------------"
@ 21,1

wait
set color to

// end

--------------------------------------------------

So...still stuck here. I can run the program in a terminal just fine if I set up the terminal first with the desired font and size, I just can't resize the window or let the program select the font like I can in Windows.

Davide Ricca

unread,
Feb 4, 2026, 2:31:32 AMFeb 4
to Harbour Users
Hi Bill,
Sorry, maybe I didn't understand what you meant.
I haven't used WVT in a while, so I don't remember everything. I haven't tried all the alternatives for Linux (various GUIs and contrib/gtqtc...).
As a user interface, Harbour is much more advanced on Windows.
To be productive, I focused on gttrm because my applications need to be used everywhere (via ssh...).
Today I'm moving towards mod_harbour / fastcgi.
Anyway, if you're interested, I'll send you another version of your test.
Bye
Davide
gtlnx_1.prg

flicker177

unread,
Feb 4, 2026, 8:25:22 AMFeb 4
to Harbour Users
Hi Davide,

What I want to do is have my program run in a window where if I resize the window the contents resize with it. I've been unable to do this in Linux with any of the GT systems I tried. What works best for me is to just run it in the terminal, first setting up the terminal with the font and font size to get the window size I want. However I can't then change the window size on the fly.

In Windows using GTWVT I can resize the window with the program running and the text size changes automatically. For instance I can be running my program full screen and then shrink the window so I can open another program, etc. I can then expand my program's window to any size I like and, again, the contents of my window expands. I've been totally unable to do the same thing in Linux.

If you have a better test program I'd certainly like to look at it. In the mean time if I compile my own test program in Windows and then in Linux, then drag the lower right corner of the window to change its size the difference in the result is pretty obvious.

Thanks much for your time and attention!

--Bill

flicker177

unread,
Feb 4, 2026, 8:26:08 AMFeb 4
to Harbour Users
Oh sorry, I see you already attached your program, thanks!

jgt

unread,
Feb 4, 2026, 8:45:08 AMFeb 4
to Harbour Users
I use putty and set host to "localhost" and  the window size to 80x25 and select "When screen size changes, change size of font").

flicker177

unread,
Feb 4, 2026, 10:52:26 AMFeb 4
to Harbour Users
Oh sure, I use Putty for other things so I'm familiar with it and this works. What I'm doing is largely an experiment, I have no pressing need, just trying to learn. I'm trying to make a standalone program that doesn't need other stuff like Putty.

I'm just surprised that something that is so trivially easy in Windows seems impossible in Linux. If you can compile and run my program gtwin.prg (shown in an earlier post) in Windows you can see exactly what I'm trying to do. I don't care what GT system I need to get the job done, I just haven't found one.

Anyway, I think for now I'll just run it in a terminal; that works perfectly as long as I don't want to change window size on the fly. I'll move on to some other frustrating experiments ;-) Thanks for all the suggestions.

--Bill

Przemyslaw Czerpak

unread,
Feb 4, 2026, 11:04:59 AMFeb 4
to harbou...@googlegroups.com
Hi,

The GT driver can work in two different resize mode:
HB_GTI_RESIZEMODE_ROWS = 0
    when GT window is resized number of rows and columns is changed
HB_GTI_RESIZEMODE_FONT = 0
    when GT window is resized the size of font is changed
Some GT drivers can work only in one mode usually
HB_GTI_RESIZEMODE_ROWS some other in both.

GTWVT, GTWVG, GTWVW, GTQTC can work in both modes and you can
change the mode with:
    hb_gtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_* )
GTs like GTTRM, GTSLN, GTCRS, GTDOS, GTWIN, GTOS2 do not create
own GT window and have to accept what the window/screen controller
does so the resize mode behavior is not Harbour dependent, f.e. some
terminal programs change number of rows and columns when window
is resized and some others try to keep row&col screen dimensions and
change the font size so GTTRM resize mode behavior depends on used
terminal.
GTXWC can workonly in HB_GTI_RESIZEMODE_ROWS.
I didn't implemented HB_GTI_RESIZEMODE_FONT in this GT driver
because such mode needs support for scalable fonts and this is a
problem in many systems. In current days and linux it's possible to
use XFT so support for TTF/OTF/Type1/... fonts can be added to
GTXWC but I do not have enough spare time to make it soon.
Meanwhile you can use GTQTC.
BTW some monotype fonts do not have really fixed metrics. It may
produce some bad side effects like garbage on the screen. To resolve
it in GTs which creates own GT window (GTWVT, GTXWC, GTQTC)
I implemented few hacks which can "fix" this problem. If you have
such problem then add to your code:
    nAttr := hb_gtInfo( HB_GTI_FONTATTRIBUTE )
    nAttr := hb_bitOr( nAttr, HB_GTI_FONTA_FIXMETRIC )
    nAttr := hb_bitOr( nAttr, HB_GTI_FONTA_CLRBKG )
    hb_gtInfo( HB_GTI_FONTATTRIBUTE, nAttr )
and if you want to use fonts without box drawing characters or
when they look ugly then use also:
    nAttr := hb_bitOr( nAttr, HB_GTI_FONTA_DRAWBOX )

best regards,
Przemek


W dniu 4.02.2026 o 14:25, flicker177 pisze:
--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/7f2fbf75-8ab6-4087-8b33-6aac286a6110n%40googlegroups.com.

Davide Ricca

unread,
Feb 4, 2026, 1:19:34 PMFeb 4
to Harbour Users
Hi,
thanks Przemek

best regards,
Davide

flicker177

unread,
Feb 5, 2026, 12:06:47 PMFeb 5
to Harbour Users
Hi Przemyslaw,

Thanks so much for your time, this is beginning to make some sense. So far I've been unable to use GTQTC, I don't think I managed to include it in my Harbour build. This is Harbour 3.2.dev which I compiled from source.

I have this at the beginning of my program:
----------------------------------------------
ANNOUNCE HB_GT_SYS
REQUEST HB_GT_QTC_DEFAULT


// get font size and width from system file
SELECT 1
USE SAILSYS
GO TOP
hb_gtInfo( HB_GTI_FONTSIZE, FONT_SIZE )
hb_gtInfo( HB_GTI_FONTWIDTH, FONT_WIDTH )

hb_gtInfo( HB_GTI_WINTITLE, "Flickerware" )
hb_gtInfo( HB_GTI_ICONFILE, "Flickerware45.ico" )
hb_gtInfo( HB_GTI_FONTNAME, "Monospace Regular" )

hb_gtInfo( HB_GTI_SELECTCOPY, .T. )
hb_gtInfo( HB_GTI_CLOSABLE, .T. )
hb_gtInfo( HB_GTI_RESIZABLE, .F. )

hb_gtInfo( HB_GTI_CODEPAGE, 255 )
hb_gtInfo( HB_GTI_ALTENTER, .T. )
hb_gtInfo( HB_GTI_RESIZEMODE_FONT = 0 )

SetMode( 25, 80 )
-------------------------------------
if I compile it with "hbmk2 sail.prg" I get this:
-------------------------------------
Generating C source output to '/tmp/hbmk_bgidni.dir/sail.c'... Done.
/usr/bin/ld: /tmp/hbmk_bgidni.dir/sail.o:(.data.rel+0x1750): undefined reference to `HB_FUN_HB_GT_QTC_DEFAULT'

collect2: error: ld returned 1 exit status
hbmk2: Error: Running linker. 1
gcc '/tmp/hbmk_bgidni.dir/sail.o'   -Wl,--start-group -lhbcplr -lhbdebug -lharbour   -Wl,--end-group -osail -L/usr/local/lib/harbour

hbmk2: Error: Referenced, missing, but unknown function(s): HB_GT_QTC_DEFAULT()
-----------------------------------------
If I compile it with "hbmk2 -gtqtc sail.prg" I get this:
------------------------
Generating C source output to '/tmp/hbmk_yrf864.dir/sail.c'... Done.
/usr/bin/ld: cannot find -lgtqtc: No such file or directory

collect2: error: ld returned 1 exit status
hbmk2: Error: Running linker. 1
gcc '/tmp/hbmk_yrf864.dir/sail.o' '/tmp/hbmk_yrf864.dir/hbmk_oe81dd.o'   -Wl,--start-group -lgtqtc -lhbcplr -lhbdebug -lharbour   -Wl,--end-group -osail -L/usr/local/lib/harbour
--------------------------

I'm concluding from this that gtqtc is broken or not available in my Harbour installation. I'm not clear on what I need to do to make it available but I'm optimistic that if I can solve that problem I can make it work. Hopefully this won't be too difficult. I know enough xBase to be dangerous  but I'm not enough of a Linux/Unix expert to know how to make gtqtc available.

Thanks again for your time!

Regards,
--Bill

Przemyslaw Czerpak

unread,
Feb 5, 2026, 7:16:37 PMFeb 5
to harbou...@googlegroups.com
Hi Bill,

Try:
    hbmk2 gtqtc.hbc sail.prg

If you do not have qtqtc.hbc then it means that you
compiled Harbour without QT devel libraries.
Install them and rebuild Harbour. BTW QT6 still have
problems with font antyaliasing in some systems.
This is one of items on my Harbour TODO list.
If someone has already diagnosed the problem and
knows the solution then please inform me about it.
Meanwhile I suggest to use QT5.

best regards,
Przemek

W dniu 5.02.2026 o 18:06, flicker177 pisze:

Przemyslaw Czerpak

unread,
Feb 5, 2026, 7:18:56 PMFeb 5
to harbou...@googlegroups.com
W dniu 5.02.2026 o 18:06, flicker177 pisze:
> hb_gtInfo( HB_GTI_RESIZEMODE_FONT = 0 )

BTW: copy and past typo. It should be:
    hb_gtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_FONT )

best regards,
Przemek

kamlesh patel

unread,
Feb 5, 2026, 11:45:12 PMFeb 5
to harbou...@googlegroups.com
Sir,

How to use GTQTC. compile and command and function etc.
how to setup GTQTC.

Regards
Kamlesh
> --
> You received this message because you are subscribed to the Google Groups "Harbour Users" group.
> Unsubscribe: harbour-user...@googlegroups.com
> Web: https://groups.google.com/group/harbour-users
> ---
> You received this message because you are subscribed to the Google Groups "Harbour Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/harbour-users/7cd965c7-e364-4191-ace9-1fa77a476ffa%40poczta.onet.pl.

flicker177

unread,
Feb 6, 2026, 12:43:47 PMFeb 6
to Harbour Users
Hi Przemyslaw,

Well, after days of trying to get this to work I did what you sail and finally have some success!! I installed the QT5 dev library, rebuilt Harbour, and compiled my program using "hbmk2 gtqtc.hbc sail.prg"

I was almost startled when it compiled fine and gave me a resizable window! Thanks so much for your time and patience.

The appearance is not perfect yet, I'm using Monospace Regular and I do seem to have some issues with font scaling. Plus the text is more bold than it is in the text editor using the same font but I can work on that.

This was an interesting exercise and I learned a lot.

I started using xBase with dBase II running under CP/M back in about 1985 and have always found the language very useful for many things. When Clipper was abandoned as a 16 bit app, I thought my days were numbered and I never found a good alternative. Harbour has preserved xBase and it works much better than Clipper ever did. And now I even have source code!

Best regards,
--Bill

Przemyslaw Czerpak

unread,
Feb 7, 2026, 12:11:43 AMFeb 7
to harbou...@googlegroups.com
Hi Bill,

To change the font weight use:
    hb_gtInfo( HB_GTI_FONTWEIGHT, HB_GTI_FONTW_THIN )
or:
    hb_gtInfo( HB_GTI_FONTWEIGHT, HB_GTI_FONTW_NORMAL )
By default it's HB_GTI_FONTW_BOLD

Please remember that when you are changing font parameters after GT window is created then you have to call
    hb_gtInfo( HB_GTI_FONTSIZE, hb_gtInfo( HB_GTI_FONTSIZE ) )
to force font refreshing.

best regards,
Przemek


W dniu 6.02.2026 o 18:43, flicker177 pisze:

flicker177

unread,
Feb 7, 2026, 9:09:56 AMFeb 7
to Harbour Users
Hi Przemek,

Wow!!! Your latest suggestions fixed all the remaining issues, everything works perfectly now. The program now looks *exactly* like it does in Windows and the resizing works perfectly. I can't thank you enough. But THANKS SO MUCH!!

Regards,
--Bill
Reply all
Reply to author
Forward
0 new messages