- Subject: Re: [slang-users] Refresh problem
- From: "John E. Davis" <davis@xxxxxxxxxxxxx>
- Date: Thu, 29 Jun 2006 00:16:28 -0400
On Wed, 28 Jun 2006 19:57:55 +0200, leslie.polzer@xxxxxxx said:
>No, nothing like that. The relevant code snippet is very simple:
>
>---
> SLtt_set_color(200, NULL, "white", "cyan");
>
> SLsmg_set_color(200);
>
> SLsmg_gotorc(1, 1);
> SLsmg_write_nstring(NULL, 10);
>
> SLsmg_gotorc(1, 1);
> SLsmg_printf("%s", "some string");
>
> SLsmg_refresh();
The SLtt_set_color function is a "setup" type of function that should
not be called everytime you want to update the screen. As you know,
it is a function that associates a foreground/background color with a
color object (an integer--- 200 in this case). Note that it is part
of the lower-level SLtt interface--- not the higher-level SLsmg
interface. When you call SLtt_set_color, it informs the SLsmg
interface that color object 200 has been changed causing SLsmg to
invalidate the display. This is the effect that you are seeing.
I may change the code in SLtt_set_color to do nothing if the
specified color object already has the requested attributes. However,
I encourage you to move the call to SLtt_set_color to some sort of
initialization function that you call once. For example, in main use:
int main (...)
{
/* Setup color objects */
SLtt_set_color (200, NULL, "white", "cyan");
.
.
main_loop ();
return 0;
}
void main_loop (void)
{
while (1)
{
.
.
draw_screen ();
SLsmg_refresh ();
.
.
}
}
--John
_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html
[2006 date index]
[2006 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]