Made use of the new cmdline textentry input handler. This both reduces code size and improves user experience:
- no alternating between normal and edit mode
- no flickering of the window titile
diff --git a/contiki/apps/irc.c b/contiki/apps/irc.c
index 03a951a..948c391 100644
--- a/contiki/apps/irc.c
+++ b/contiki/apps/irc.c
@@ -30,7 +30,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
- * $Id: irc.c,v 1.8 2005/04/28 20:57:36 oliverschmidt Exp $
+ * $Id: irc.c,v 1.9 2005/05/05 23:32:01 oliverschmidt Exp $
*/
#include "irc-conf.h"
@@ -42,6 +42,8 @@
#include "petsciiconv.h"
+#include "ctk-textentry-cmdline.h"
+
#include <string.h>
#define LOG_WIDTH IRC_CONF_WIDTH
@@ -61,7 +63,8 @@
static struct ctk_label loglabel =
{CTK_LABEL(0, 0, LOG_WIDTH, LOG_HEIGHT, log)};
static struct ctk_textentry lineedit =
- {CTK_TEXTENTRY(0, LOG_HEIGHT, LOG_WIDTH - 2, 1, line, sizeof(line) - 1)};
+ {CTK_TEXTENTRY_INPUT(0, LOG_HEIGHT, LOG_WIDTH - 2, 1, line, sizeof(line) - 1,
+ ctk_textentry_cmdline_input)};
static struct ctk_window setupwindow;
#define SETUPWINDOW_WIDTH 18
@@ -193,13 +196,8 @@
void
ircc_sent(struct ircc_state *s)
{
- struct ctk_widget *focused;
-
/* ctk_textedit_init(&lineedit);*/
CTK_TEXTENTRY_CLEAR(&lineedit);
- focused = window.focused;
- CTK_WIDGET_FOCUS(&window, &lineedit);
- CTK_WIDGET_REDRAW(focused);
CTK_WIDGET_REDRAW(&lineedit);
}
/*---------------------------------------------------------------------------*/