- Timestamp:
- May 12, 2004, 5:25:46 PM (21 years ago)
- Location:
- orxonox/branches/gui/console
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/gui/console/orxonox_console.cc
r1884 r1890 44 44 gtk_box_pack_start(GTK_BOX(vbox_main), log.createLog(), TRUE, TRUE, 0); 45 45 gtk_box_pack_start(GTK_BOX(vbox_main), entry.createEntry(), FALSE, FALSE, 0); 46 entry.setLog(&log ,&entry);46 entry.setLog(&log); 47 47 } 48 48 gtk_container_add(GTK_CONTAINER(window), vbox_main); … … 57 57 int main( int argc, char *argv[] ) 58 58 { 59 verbose = 0; 60 59 61 OrxonoxConsole console; 60 62 -
orxonox/branches/gui/console/orxonox_console.h
r1880 r1890 12 12 #include "orxonox_console_log.h" 13 13 14 OrxonoxConsoleLog log; 15 OrxonoxConsoleEntry entry; 14 int verbose; 16 15 17 16 class OrxonoxConsole { … … 20 19 GtkWidget *window; 21 20 GtkWidget *vbox_main; 21 OrxonoxConsoleLog log; 22 OrxonoxConsoleEntry entry; 22 23 23 24 -
orxonox/branches/gui/console/orxonox_console_entry.cc
r1884 r1890 49 49 { 50 50 entry = gtk_entry_new(); 51 g_signal_connect(GTK_ENTRY(entry), "activate", G_CALLBACK(submit), entry);51 //g_signal_connect(GTK_ENTRY(entry), "activate", G_CALLBACK(submit), entry); 52 52 gtk_box_pack_start(GTK_BOX(entrybox), entry, TRUE, TRUE, 5); 53 53 54 54 55 55 button = gtk_button_new_with_label("Submit"); 56 g_signal_connect(GTK_BUTTON(button), "clicked", G_CALLBACK(submit), entry);56 g_signal_connect(GTK_BUTTON(button), "clicked", G_CALLBACK(submit), this); 57 57 gtk_box_pack_start(GTK_BOX(entrybox), button, FALSE, FALSE, 5); 58 58 } … … 62 62 } 63 63 64 void OrxonoxConsoleEntry::setLog(OrxonoxConsoleLog* log , OrxonoxConsoleEntry* entry)64 void OrxonoxConsoleEntry::setLog(OrxonoxConsoleLog* log) 65 65 { 66 66 consoleLog = log; 67 test = entry;68 67 } 69 68 70 69 71 void OrxonoxConsoleEntry::submit(GtkWidget *widget, GtkWidget* entry)70 void OrxonoxConsoleEntry::submit(GtkWidget *widget, OrxonoxConsoleEntry* entry) 72 71 { 73 char* entryText = (char*)gtk_entry_get_text(GTK_ENTRY(entry)); 74 printf("%s\n", entryText); 75 test->sendtoLog(entryText); 76 gtk_entry_set_text(GTK_ENTRY(entry),""); 77 // freen entryText; 72 char* entryText = (char*)gtk_entry_get_text(GTK_ENTRY(entry->entry)); 73 entry->sendtoLog(entryText); 74 gtk_entry_set_text(GTK_ENTRY(entry->entry),""); 75 entryText; 78 76 return; 79 77 } -
orxonox/branches/gui/console/orxonox_console_entry.h
r1884 r1890 10 10 #include "orxonox_console_log.h" 11 11 12 extern int verbose; 13 12 14 class OrxonoxConsoleEntry { 13 15 … … 20 22 OrxonoxConsoleLog* consoleLog; 21 23 22 static OrxonoxConsoleEntry* test;23 24 24 25 25 … … 28 28 29 29 GtkWidget* createEntry(void); 30 void setLog(OrxonoxConsoleLog* log , OrxonoxConsoleEntry* entry);31 static void submit(GtkWidget *widget, GtkWidget* data);30 void setLog(OrxonoxConsoleLog* log); 31 static void submit(GtkWidget *widget, OrxonoxConsoleEntry* entry); 32 32 void sendtoLog(char* submitText); 33 33 -
orxonox/branches/gui/console/orxonox_console_log.cc
r1882 r1890 47 47 gtk_container_add(GTK_CONTAINER(scrollframe), logView); 48 48 gtk_container_add(GTK_CONTAINER(frame),scrollframe); 49 a=3;50 49 gtk_text_buffer_set_text (log, "Orxonox Console:\n", -1); 51 50 … … 57 56 { 58 57 char* buffer = new char; 59 printf("%i\n",a);60 58 sprintf (buffer, "%s\n", append); 61 printf ("appending %s\n", append); 59 if (verbose>=1) 60 printf ("appending %s\n", append); 62 61 gtk_text_buffer_insert_at_cursor (log, buffer, -1); 63 62 return; -
orxonox/branches/gui/console/orxonox_console_log.h
r1882 r1890 10 10 #include <gtk/gtk.h> 11 11 12 extern int verbose; 13 12 14 class OrxonoxConsoleLog { 13 15 … … 19 21 GtkTextBuffer *log; 20 22 GtkWidget *label; 21 int a;22 23 23 24 char *logtext;
Note: See TracChangeset
for help on using the changeset viewer.