summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/color.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/color.c b/src/color.c
index cfe6077..ad21919 100644
--- a/src/color.c
+++ b/src/color.c
@@ -47,9 +47,9 @@ int redraw_display(update_info *display_summary, XTextItem *text_prompt, GC *gc,
display_summary->foreground.blue = 0xffff - display_summary->background.blue;
XAllocColor(display_summary->display, display_summary->colormap, &display_summary->foreground);
XClearWindow(display_summary->display, display_summary->window);
+ printf("%i\n", display_summary->background.pixel);
XSetWindowBackground(display_summary->display, display_summary->window, display_summary->background.pixel);
XSetForeground(display_summary->display, *gc, display_summary->foreground.pixel);
- printf("%i\n", display_summary->foreground.red);
XDrawText(display_summary->display, display_summary->window, *gc, TEXT_CORNER_OFFSET, textpos_y, text_prompt, 1);
}
@@ -166,8 +166,10 @@ int main(void) {
break;
case X_ENTER_KEY:
text_prompt_buffer[text_prompt.nchars + 1] = '\0';
- printf("%i: %s\n", strlen(text_prompt_buffer), text_prompt_buffer);
+ XFreeColors(display, colormap, background_color.pixel, 1, NULL);
XParseColor(display, colormap, text_prompt_buffer, &background_color);
+ background_color.red = 60000;
+ XAllocColor(display, colormap, &background_color);
is_prompt = 0;
text_prompt.nchars = 0;
redraw_display(&display_summary, &text_prompt, &text_prompt_gc, textpos_y);