Changeset e74c01c
- Timestamp:
- Oct 27, 2006, 1:39:46 PM (18 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- db8b00b
- Parents:
- 1b6b2f3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
editwin.c
r4c46dfd re74c01c 35 35 e->dotsend=0; 36 36 e->echochar='\0'; 37 38 /* 39 // We get initialized multiple times, but we need to hold on to 40 // the callbacks, so we can't NULL them here. 41 e->command = NULL; 42 e->callback = NULL; 43 e->cbdata = NULL; 44 */ 37 45 if (win) werase(win); 38 46 } … … 74 82 { 75 83 e->dotsend=1; 84 } 85 86 void owl_editwin_set_command(owl_editwin *e, char *command) { 87 if(e->command) owl_free(e->command); 88 e->command = owl_strdup(command); 89 } 90 91 char *owl_editwin_get_command(owl_editwin *e) { 92 if(e->command) return e->command; 93 return ""; 94 } 95 96 void owl_editwin_set_callback(owl_editwin *e, void (*cb)(owl_editwin*)) { 97 e->callback = cb; 98 } 99 100 void (*owl_editwin_get_callback(owl_editwin *e))(owl_editwin*) { 101 return e->callback; 102 } 103 104 void owl_editwin_set_cbdata(owl_editwin *e, void *data) { 105 e->cbdata = data; 106 } 107 108 void* owl_editwin_get_cbdata(owl_editwin *e) { 109 return e->cbdata; 110 } 111 112 void owl_editwin_do_callback(owl_editwin *e) { 113 void (*cb)(owl_editwin*); 114 cb=owl_editwin_get_callback(e); 115 if(!cb) { 116 owl_function_error("Internal error: No editwin callback!"); 117 } else { 118 // owl_function_error("text: |%s|", owl_editwin_get_text(e)); 119 cb(e); 120 } 76 121 } 77 122
Note: See TracChangeset
for help on using the changeset viewer.