¿How to change the colors using GWindows on infrom6?

Hello everyone, my name is Fran and I like interactive fiction.

I just started learning how to use the GWINDOWS library, but I can not change the colors in the text buffer type windows, I tried:

glk_window_set_background_color (MainWin.winid, $ 110101);
glk_window_clear (MainWin.winid);
grapw1.setimage (PIC1);

But the colors do not change, could anyone help me?

glk_window_set_background_color() is for graphics windows only.

This is what’s in the Glk spec about glk_window_set_background_color():

You can set the initial color for a tekst buffer window before you create it, I don’t know if and how you can change it for an existing window.

Here’s how I do it:

To set the initial color:

Use the glk_stylehint-set() function to set the initial values.

Example: glk_stylehint_set(wintype_TextBuffer, style_Normal, stylehint_Backcolor, 0x00000084) sets the background color to blue for style normal.

Then create the tekst buffer window with mainwin = glk_window_open(0, 0, 0, wintype_TextBuffer, 1)
(function parameters are from my own code, you may need other parameters)

Hope this helps.

You can’t change colours (or any other styles) once a window has been created.

The normal approach is to run a loop to set the background colour for all the styles. If you only set it for style_Normal then other styles won’t have the background colour.

thanks for the answers and sorry for taking a long time to respond, I’m practicing, if I get something I’ll share the results,