Changeset 3161 in orxonox.OLD for orxonox/trunk/gui/orxonox_gui_gtk.cc
- Timestamp:
- Dec 13, 2004, 2:10:38 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/gui/orxonox_gui_gtk.cc
r3160 r3161 188 188 { 189 189 down = NULL; 190 this->setGroupName ("");190 groupName = NULL; 191 191 192 192 … … 201 201 void Packer::setGroupName (char* name) 202 202 { 203 groupName = name; 203 if (groupName) 204 delete groupName; 205 groupName = new char [strlen(name)+1]; 206 strcpy(groupName, name); 204 207 } 205 208 … … 398 401 { 399 402 if (exec->shouldsave()) 400 exec->writeToFile ( orxonoxGUI);403 exec->writeToFile (Window::mainWindow); 401 404 402 405 gtk_main_quit(); … … 902 905 } 903 906 904 OptionLabel::OptionLabel(char* text)907 OptionLabel::OptionLabel(char* label, char* value) 905 908 { 906 909 init(); 907 setTitle(text); 910 setTitle(label); 911 setValue(value); 908 912 } 909 913 910 914 void OptionLabel::init(void) 911 915 { 912 isOption = 4;913 914 916 static_cast<Option*>(this)->init(); 917 isOption = 5; 918 cValue = NULL; 915 919 916 920 widget = gtk_label_new (""); 917 921 } 922 void OptionLabel::setValue(char* newValue) 923 { 924 if (cValue) 925 delete cValue; 926 cValue = new char [strlen(newValue)+1]; 927 strcpy(cValue, newValue); 928 gtk_label_set_text (GTK_LABEL (widget), cValue); 929 } 918 930 919 931 void OptionLabel::setTitle(char* title) 920 932 { 933 if (label) 934 delete label; 935 label = new char [strlen(title)+1]; 936 strcpy(label, title); 921 937 gtk_label_set_text (GTK_LABEL (widget), title); 922 938 }
Note: See TracChangeset
for help on using the changeset viewer.