Code Monkey home page Code Monkey logo

Comments (9)

abenkovskii avatar abenkovskii commented on September 15, 2024

In addition to apps that can be runned both from OS and form other processes we need other kinds of process too. For example I think that menu and number-input are widgets rather when apps.

from akros.

akrasuski1 avatar akrasuski1 commented on September 15, 2024

You are right - but on this architecture they are all treated in the same way, so I don't want to cause confusion, and make all of them called the same. But right now, I'm considering running away from the problem and doing it like this:

lib_window_vessel_stats.ks -> job_vessel_stats.ks
open_window_vessel_stats -> run_vessel_stats
draw_window_vessel_stats -> draw_vessel_stats
update_window_vessel_stats -> update_vesel_stats

Not only the names are shorter, but also the word job is used only in the name of file. What do you think?

from akros.

abenkovskii avatar abenkovskii commented on September 15, 2024

Fine. Though apps actually have a slightly different interface: their constructor should have the same signature (the number and type of parameters).

from akros.

akrasuski1 avatar akrasuski1 commented on September 15, 2024

Yeah, but since everything in menu is launched via the program_list.ks wrapper, even proper apps don't need to have exact same constructor.
Closing issue after having applied changes.

from akros.

abenkovskii avatar abenkovskii commented on September 15, 2024

@akrasuski1 Wait. I thought that program_list is a placeholder.

from akros.

akrasuski1 avatar akrasuski1 commented on September 15, 2024

Hmm, no, not really. Why? Is this a bad design? User might want to "install" only some programs to his OS. And where such install should be specified? I thought a separate file, with list of programs is okay.

from akros.

akrasuski1 avatar akrasuski1 commented on September 15, 2024

Hmmm. Now you got me thinking - I actually can make users create a function named register_vessel_stats or so, and call it while running the library. Then it would add itself to the menu. Is that better? While the wrapper would still persist, it would be only used for system programs and such - "normal" apps would have to have a constructor consisting of only os_data, window_index.

from akros.

akrasuski1 avatar akrasuski1 commented on September 15, 2024

OK, I implemented what I've said above. Look at current version of program list. It's very edit-easy, having pretty much just the list of libraries to include. As a compromise, every widget library needs now to include these two lines on top (or bottom, doesn't matter):

parameter os_data.
register_program(os_data,"Vessel stats","run_vessel_stats",false).

This tells the OS to "install" the program - add its name to main menu and know which function to run afterwards. The last argument is almost always false - if true, it forces the program to be run in zeroth window (without user choice of window). Also, now menu-runnable programs need to follow the specific constructor:

function run_x{
    parameter
        os_data,
        window_index.
    //stuff
}

from akros.

abenkovskii avatar abenkovskii commented on September 15, 2024

Yes I was thinking about something similar. Self-registering applications (but not all jobs because there is not much use in opening dialog without parent) are the only approach I like.
All other variants I thought about:

  1. A show a menu where the user can run any program and hope that it will be a "job" - a recipe for disaster
  2. Search for files with matching certain pattern and load them - I like it very much but there are no string operations in kOS just yet
  3. Have a file that the user will edit manually - a bad idea because the user can misspell/damage something in that file

from akros.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.