Inside Sprog::new() 

$factory->inject(   # set default classes if not already defined
  '/app/preferences'    => 'Sprog::Preferences',
  '/app/geardb'         => 'Sprog::GearMetadata',
  '/app/machine'        => 'Sprog::Machine',
  '/app/help_parser'    => 'Sprog::HelpParser',
  '/app/make_cmnd_gear' => 'Sprog::MakeCmndGear',
);

if($opt->{nogui}) {
  $factory->inject(
    '/app/view'         => 'Sprog::TextView',
    '/app/eventloop'    => 'Sprog::GlibEventLoop',
  );
}
else {
  $factory->inject(
    '/app/view'         => 'Sprog::GtkView',
    '/app/eventloop'    => 'Sprog::GtkEventLoop',
  );
}