Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8561401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:29:41+00:00 2026-06-11T16:29:41+00:00

I am developing a program for a performance artist who needs a backdrop that

  • 0

I am developing a program for a performance artist who needs a backdrop that is running various programs via openFrameworks. He needs a way to be able to easily switch between them somehow. Is there some way of creating a master shell which loads or unloads other openframeworks files?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:29:42+00:00Added an answer on June 11, 2026 at 4:29 pm

    If you have a way to terminate RunApp() from the clientside (via a quit button), you can wrap the call in a scripting language via tcl or python. You’ll end up with an interactive shell where you can run different apps and set parameters.

    For sake of simplicity i’ll leave out some details and assume we do the language binding with boost::python. A more detailed read about this is in this article, the boost::python documentation is here.

    The main idea is to create a domain specific language/set of wrappers for OF, which can be used to create OF objects and access their methods either interactively via a shell or through a script.

    Boost object bindings work roughly like this (quote from 1):

    First define the class in C++

    struct World
    {
        void set(std::string msg) { this->msg = msg; }
        std::string greet() { return msg; }
        std::string msg;
    };
    

    Then, expose it as a python-module

    #include <boost/python.hpp>
    BOOST_PYTHON_MODULE(hello)
    {
        class_<World>("World")
          .def("greet", &World::greet)
          .def("set", &World::set)
        ;
    }
    

    Which looks like this in use in an interactive python session:

    >>> import hello
    >>> planet = hello.World()
    >>> planet.set('howdy')
    >>> planet.greet()
    'howdy'
    

    Now since one can wrap any class or method there are many possibilities on how to actually tap into OF. The one i was referring to in this answer would be to have f.e. two Apps, App1, App2 implemented in C++/OF, then link to that implementation in python.

    The interactive session would look something like this:

    >>> import myofapps
    >>> a1 = myofapps.App1()
    >>> a2 = myofapps.App2()
    >>> a1.run() # blocked here, until the app terminates
    >>> a2.run() # then start next app .. and so forth
    >>> a1.run()
    

    I’m not an OF hacker but another (easier) possibility might be to interactively change the content of f.e. ofApp::draw() in an App (running in a thread). This could be done by embedding a custom object parametrizable from within the python interpreter:

    /// custom configurator class
    
    class MyObj {
       private int colorRed;
    
       // getter
       int getRed () {
          return colorRed;
       }
    
       // setter
       void setRed(int r) {
          colorRed = r;
       }
    
       /// more getters/setters code
       ...
    };
    
    /// the boost wrapping code (see top of post)
    ...
    
    /// OF code here
    
    void testApp::draw() {
    
        // grab a reference to MyObj (there are multiple ways to do that)
        // let's assume there's a singleton which holds the reference to it
        MyObj o = singleton.getMyObj();
    
        // grab values
        int red = o.getRed ();
    
        // configure color
        ofSetColor(red,0,0,100);
    
        // other OF drawing code here...
    }
    

    Which once the OF app runs, could be used to change color interactively from within your interpreter:

    >>> import myofapps
    >>> a1 = myofapps.App1()
    >>> c1 = myofapps.MyObj();
    >>> a1.run() # this call would have to be made non-blocking by running the 
    >>>          # app in a thread and returning right away
    >>> c1.setRed(100);
    
    ... after a minute set color to a different value
    
    >>>> c1.setRed(200);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a program that makes some floating points calculations. Is there any way
I'm developing a program that needs to parse the file name into a TTextField
I'm developing a program that needs to load and save data in external files,
I am developing a program that will bootstrap another program, so as a result
I am currently developing a program that uses C#'s Dictionary container (specifically, SortedDictionary). This
I'm developing a program that would require huge amount of memory, and I want
Currently am developing a program that solves (if possible) any given labyrinth of dimensions
I developing a program that draws in elements of the list (QListView). How do
I'm developing a program for a uC that reads in a 40 byte bit
I am developing a program in VB.NET. I have an enum called PriceType that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.