Changeset 1882 in orxonox.OLD for orxonox/branches/gui
- Timestamp:
- May 8, 2004, 8:27:03 PM (21 years ago)
- Location:
- orxonox/branches/gui/console
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/gui/console/orxonox_console.cc
r1880 r1882 43 43 gtk_box_pack_start(GTK_BOX(vbox_main), log.createLog(), TRUE, TRUE, 0); 44 44 gtk_box_pack_start(GTK_BOX(vbox_main), entry.createEntry(), FALSE, FALSE, 0); 45 entry.setLog(&log); 45 46 } 46 47 gtk_container_add(GTK_CONTAINER(window), vbox_main); 47 48 48 49 49 gtk_widget_show_all(window); -
orxonox/branches/gui/console/orxonox_console_entry.cc
r1881 r1882 49 49 g_signal_connect(GTK_BUTTON(button), "clicked", G_CALLBACK(submit), entry); 50 50 gtk_box_pack_start(GTK_BOX(entrybox), button, FALSE, FALSE, 5); 51 52 51 } 53 52 gtk_container_add(GTK_CONTAINER(frame), entrybox); … … 56 55 } 57 56 58 void OrxonoxConsoleEntry::s ubmit(GtkWidget *widget, GtkWidget* data)57 void OrxonoxConsoleEntry::setLog(OrxonoxConsoleLog* log) 59 58 { 60 char* entryText = (char*)gtk_entry_get_text(GTK_ENTRY(data)); 59 consoleLog = log; 60 } 61 62 63 void OrxonoxConsoleEntry::submit(GtkWidget *widget, GtkWidget* entry) 64 { 65 char* entryText = (char*)gtk_entry_get_text(GTK_ENTRY(entry)); 61 66 printf("%s\n", entryText); 62 63 gtk_entry_set_text(GTK_ENTRY( data),"");67 //sendtoLog(entryText); 68 gtk_entry_set_text(GTK_ENTRY(entry),""); 64 69 // freen entryText; 65 70 return; … … 69 74 void OrxonoxConsoleEntry::sendtoLog(char* submitText) 70 75 { 71 printf("submitting %s\n",submitText);76 consoleLog->appendText(submitText); 72 77 73 78 return; -
orxonox/branches/gui/console/orxonox_console_entry.h
r1881 r1882 26 26 27 27 GtkWidget* createEntry(void); 28 void setLog(OrxonoxConsoleLog* log); 28 29 static void submit(GtkWidget *widget, GtkWidget* data); 29 30 void sendtoLog(char* submitText); -
orxonox/branches/gui/console/orxonox_console_log.cc
r1880 r1882 42 42 gtk_container_set_border_width (GTK_CONTAINER(scrollframe), 5); 43 43 44 log = gtk_text_view_new(); 45 gtk_text_view_set_editable(GTK_TEXT_VIEW(log), FALSE); 46 gtk_container_add(GTK_CONTAINER(scrollframe), log); 44 logView = gtk_text_view_new(); 45 gtk_text_view_set_editable(GTK_TEXT_VIEW(logView), FALSE); 46 log = gtk_text_view_get_buffer (GTK_TEXT_VIEW (logView)); 47 gtk_container_add(GTK_CONTAINER(scrollframe), logView); 47 48 gtk_container_add(GTK_CONTAINER(frame),scrollframe); 49 a=3; 50 gtk_text_buffer_set_text (log, "Orxonox Console:\n", -1); 51 48 52 } 49 53 return (frame); … … 52 56 void OrxonoxConsoleLog::appendText(char* append) 53 57 { 58 char* buffer = new char; 59 printf("%i\n",a); 60 sprintf (buffer, "%s\n", append); 54 61 printf ("appending %s\n", append); 55 /* strcat(logtext, append); 56 printf(logtext); 57 return;*/ 62 gtk_text_buffer_insert_at_cursor (log, buffer, -1); 63 return; 58 64 } 59 65 -
orxonox/branches/gui/console/orxonox_console_log.h
r1880 r1882 16 16 GtkWidget *scrollframe; 17 17 GtkWidget *logbox; 18 GtkWidget *log; 18 GtkWidget *logView; 19 GtkTextBuffer *log; 19 20 GtkWidget *label; 21 int a; 20 22 21 23 char *logtext;
Note: See TracChangeset
for help on using the changeset viewer.