Edit: Suppose I should explain that the library exposes what amounts to two flat 32bit buffers, one for characters and the other for attributes. So the above example just uses the global variables in [x] and [y] to determine where to put the X, and places the red foreground and blue background attributes at the same location/offset into the buffers. When the draw method calls updatedisplaylist, that triggers the library's "differential" ansi output sequences (such that it is not actually drawing the entire "screen" each and every keypress, only the parts of the screen that changed since its last update). Resizing the terminal window works as you'd expect, etc. etc.

While I could have fixed the tui_background size to 80x25, having it auto-fill a terminal window is better IMO The other two library pieces I wrote, sshtalk and hnwatch both make heavy use of the tui_* components for further examples.

It seems that the 64-bit fasm compiler has some memory management issue. Anyway.

The generated terminal has 80 columns but more than 25 rows (I don't know how many). Besides, navigating the "X" with the arrow keys seems to have some issues. But overall, the generated terminal is what I need.

Now, I would have to study the code in detail and see if I can make sense of it.

Do you maintain a full list of "reserved" names for the HeavyThing library? For example, I suspect that calign, dalign, and falign are some built-in routines for properly aligning code, data, and functions. But that is just my guess.

How about ansi_colors?

If there is a fully-documented hierarchy of functions/routines (which also shows the dependencies of the .inc files), it will be great!

It seems that the 64-bit fasm compiler has some memory management issue. Anyway.

fasm for Linux/Unix always allocates exactly 16 MB of memory by default, for it to use more memory you have to specify the right amount with the switch. This is a general quirk of fasm's memory management, not related to 64 bits.

Do you maintain a full list of "reserved" names for the HeavyThing library? For example, I suspect that calign, dalign, and falign are some built-in routines for properly aligning code, data, and functions. But that is just my guess.

How about ansi_colors?

If there is a fully-documented hierarchy of functions/routines (which also shows the dependencies of the .inc files), it will be great!

The only "master function list" is maintained via javascript on the upper-right corner of my site's search feature (it is scraped when the static pages for the site are constructed).

Outside that, the ht_defaults.inc file is the "settings" for the library, and by copying and/or modifying the settings, you can affect how various things are compiled/generated including those alignment macros (which are in align_macros.inc). Since I maintain those alignment standards throughout the library, it is enlightening (IMO) to know whether 16-byte aligned jump targets on a given architecture throughout the entirety of a codebase affect performance, similarly with data, only-function-targets, etc.

It seems that the 64-bit fasm compiler has some memory management issue. Anyway.

fasm for Linux/Unix always allocates exactly 16 MB of memory by default, for it to use more memory you have to specify the right amount with the switch. This is a general quirk of fasm's memory management, not related to 64 bits.

How do the user know, in advance, how much memory the compiler needs to get the job done?

Besides, why set the limit at 16 MB? Shouldn't the compiler be able to use as much memory as it needs?

One quick question: Where can I set the values for # of columns (80) and # of rows (25)?

If you look in the source file tui_background.inc, you'll see the function that I referenced called init_dd (which is to say, double and double for the width and height arguments).

If OTOH you choose init_ii as the call, then the width and height are not percentage based (but the parameter order/registers changes obviously). The comments above the init_ii function will tell you which registers to fill with the integer width and height and you can omit the references to xmm regs from my demo.

I just tried using init_ii instead of init_dd. It worked. But resizing the terminal window resulted in black margins in the right and at the bottom. Can that issue be fixed? If not, can the terminal window be rendered "not resizable"?

At least with all of the terminals I have tried over the years, resizing is always allowed unless you are on the console itself in runlevel 3 (which probably isn't what you want )

The black margins on the right and bottom are correct if your terminal size is >80x25.

There are a number of ways to deal with that... if it were me, I would be inclined to center your 80x25 onscreen. The HT library makes use of a "panel-based" layout, whereby you can mix up percentage-based dynamic components and fixed size ones. Using the simple_vtable and tui_object itself you can create "spacer/container" objects to fill space as needed.

The tui_simpleauth component I did does a similar thing to center its "enter your user/pass" space, if you look at tui_simpleauth$new and tui_simpleauth$nvsetup you can see how I constructed the layouts there.

There are a number of ways to deal with that... if it were me, I would be inclined to center your 80x25 onscreen. The HT library makes use of a "panel-based" layout, whereby you can mix up percentage-based dynamic components and fixed size ones. Using the simple_vtable and tui_object itself you can create "spacer/container" objects to fill space as needed.

The tui_simpleauth component I did does a similar thing to center its "enter your user/pass" space, if you look at tui_simpleauth$new and tui_simpleauth$nvsetup you can see how I constructed the layouts there.

I tried to use the search at the upper right corner of your website. But nothing happened for a number of inputs: "prolog", "ansi_colors", and even "ht$init". Does the search support only a "selected" list of functions and/or routines?

I tried to change the background color and the default character. It worked. But the upper left corner of the terminal always showed the initial blue box, even after moving the "X" away from it. Where can I set the default color for the initial blue box?

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum