Changeset 4323 in orxonox.OLD for orxonox/branches
- Timestamp:
- May 27, 2005, 1:53:40 AM (20 years ago)
- Location:
- orxonox/branches/physics/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/lib/gui/gui/gui_gtk.h
r4319 r4323 61 61 62 62 virtual void setTitle(const char* title); //!< An abstract Function, that sets the title of Widgets. 63 virtual const char* getTitle(void) const { return this->title; }; 63 64 64 65 Widget* findWidgetByName(char* name, unsigned int depth); -
orxonox/branches/physics/src/subprojects/particles/framework.cc
r4317 r4323 358 358 } 359 359 360 int changeOption(GtkWidget* nonInterest, void* widget) 361 { 362 Option* option = (Option*) widget; 363 const char* name = option->getTitle(); 364 char* valueC = option->save(); 365 float value = atof(valueC); 366 delete valueC; 367 368 printf("%s, %f\n", name, value); 369 370 ParticleEmitter* tmpEmit = ParticleEngine::getInstance()->getEmitterByNumber(1); 371 if (tmpEmit) 372 { 373 if (!strcmp(name, "EmissionRate")) 374 { 375 tmpEmit->setEmissionRate(value); 376 PRINT(3)("emissionRate set to %f\n", tmpEmit->getEmissionRate()); 377 } 378 } 379 380 381 } 382 360 383 361 384 void* Framework::initGui(void* argv) … … 369 392 Box* windowBox = new Box('v'); 370 393 { 394 Slider* emissionRate = new Slider("EmissionRate", 0, 1000); 395 emissionRate->connectSignal("value_changed", (void*)emissionRate, changeOption ); 396 windowBox->fill(emissionRate); 397 371 398 Button* quitButton = new Button("quit"); 399 400 372 401 windowBox->fill(quitButton); 373 402 }
Note: See TracChangeset
for help on using the changeset viewer.