Mercurial > pidgin
comparison console/libgnt/gntmenu.c @ 14876:70623f0d5cdc
[gaim-migrate @ 17645]
Use terminfo/termcap information (from ncurses) as much as possible. There
still need to be some manual 'refinement' based on $TERM. I'll see if I
can get rid of those. Also, I am probably going to allow users to provide
information that terminfo can't provide, like the keycode for ctrl+up etc.
Let me know if any of the keybinding doesn't work.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Wed, 01 Nov 2006 03:38:23 +0000 |
parents | b1650510f4b8 |
children | 065e7ac30338 |
comparison
equal
deleted
inserted
replaced
14875:7357d46ba817 | 14876:70623f0d5cdc |
---|---|
146 gnt_widget_hide(widget); | 146 gnt_widget_hide(widget); |
147 return TRUE; | 147 return TRUE; |
148 } | 148 } |
149 | 149 |
150 if (menu->type == GNT_MENU_TOPLEVEL) { | 150 if (menu->type == GNT_MENU_TOPLEVEL) { |
151 if (text[0] == 27) { | 151 if (strcmp(text, GNT_KEY_LEFT) == 0) { |
152 if (strcmp(text + 1, GNT_KEY_LEFT) == 0) { | 152 menu->selected--; |
153 menu->selected--; | 153 if (menu->selected < 0) |
154 if (menu->selected < 0) | 154 menu->selected = g_list_length(menu->list) - 1; |
155 menu->selected = g_list_length(menu->list) - 1; | 155 } else if (strcmp(text, GNT_KEY_RIGHT) == 0) { |
156 } else if (strcmp(text + 1, GNT_KEY_RIGHT) == 0) { | 156 menu->selected++; |
157 menu->selected++; | 157 if (menu->selected >= g_list_length(menu->list)) |
158 if (menu->selected >= g_list_length(menu->list)) | 158 menu->selected = 0; |
159 menu->selected = 0; | 159 } else if (strcmp(text, GNT_KEY_ENTER) == 0) { |
160 } | |
161 } else if (text[0] == '\r' && text[1] == 0) { | |
162 gnt_widget_activate(widget); | 160 gnt_widget_activate(widget); |
163 } | 161 } |
164 | 162 |
165 if (current != menu->selected) { | 163 if (current != menu->selected) { |
166 gnt_widget_draw(widget); | 164 gnt_widget_draw(widget); |