How to write a text mode gui in Linux? [closed] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
When I write scripts/programs, often I would like to pop up a simple text 'gui' to prompt for input:
How would I do this? For example from Shell, Ruby, Golang or C. I don't even know what this is called and Google isn't reponding to "text thingy from scripts".
(The example is from the Debian installer).

Actually, that is not dialog, but the newt library (there are a few differences in appearance). It is used by anaconda on Red Hat systems. The whiptail program uses the library, however it has no real relationship to anaconda.
Anaconda is mostly in Python; it uses the newt shared library (written in C) from a Python binding.
For learning it... documentation is largely non-existent. You have the source code.
Further reading:
screenshots for dialog
newt.git
anaconda.git
Any examples/documentation for python-newt (discussion of newt vs documentation)
Spicing up the Console for Fun and Profit, Part 2

In the past this was known as "Dialog," though as Thomas points out (as the maintainer of Dialog!!) this is no longer the case. This is most likely the Newt library. While you could certainly write something lower level using ncurses, Newt is available in Linux pretty much universally. Dialog can also be installed under Linux. You can read some basic documentation for it here.
Choosing to use this over a curses based approach allows you to focus on what it is you're actually looking to do rather than doing all of the work to build a UI. If, however, you are really looking to build UI elements, ncurses would be the way to go.

Related

drawing circle, line, arc etc. using c [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed last year.
Improve this question
So our teacher taught us to draw circles lines using c in turboc++, and my issue is, this compiler sucks, so I wanted to use some normal compiler or code editor, and I googled it, but those programs on websites which I found, use graphics.h for drawing circle, but my compiler is showing an error named no such file or directory. The same issue is seen when I use an online compiler.
So plz someone guide me where can I find some good material related to basic computer graphics whose c code does not need turboc++. It can be a book or website or videos on youtube.
Thanks in advance.
There is no standard graphics library in C. It's all third party. So you will never be able to write graphics code that's completely portable.
If you're using Linux, it's possible to use libgraph to enable the use of graphics.h. I found a question on askubuntu that covers this: How do I use graphics.h in Ubuntu?
If you're using Windows, it seems to be possible to use WinBGIm to use graphics.h. Geeks for geeks has instructions for how to use it with CodeBlocks https://www.geeksforgeeks.org/include-graphics-h-codeblocks/
I do not know how good these two options are, but they might be worth trying out. That will at least remove the Turbo dependency.

Generator of "mind map" from files.c [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I started a while ago to learn the C language, and has spent several hours I search THE miracle software.
I am looking for software that import sources of software in C (files.c) and generates a "mind map" of the code with all files, functions, variables, etc ...
Do you know if it exists? It'll help me a lot to understand the architecture of complex software.
Thank you very much for all your answers.
Take a look at the "call graph". This sort of visualization should get you started.
As the comment suggests, Doxygen is a good open-source tool. Take a look at some output here. Doxygen is straight-forward to configure for call-graph generation under *nix. It's a little more complex for Windows. First, check out this SO post: how to get doxygen to produce call & caller graphs for c functions. Doxygen's HTML output provides a number of nice cross-referencing features (files, variables, structs, etc.) in addition to caller/callee graphs.
On the commercial side, Understand for C/C++ has first-rate visualization features. Google "c call graph diagram" for other commercial and open-source options.
Finally, there are some older SO posts, like this one Tools to get a pictorial function call graph of code. Take a look at it.
Look into the program ctags. It is an indexer of names and functions based on the structure of the programming language.
It is quite mature, and has integration with a number of other tools. I use it with an older (but very nice) text editor called vi, but it can be used independently from the command line.
It does not generate a graphical view of the connections. However, in my estimation there are probably too many connections in most C programs to display visually without creating a large amount of information overload.
This answer differs from Throwback's answer in some interesting ways. A call graph can mean a few things. One thing it can mean is the path a running program took through a section of code, and another is the combination of all paths a running program might take through the code, and another is the combination of all paths in the code (whether they can be reached or not).
Your needs will drive which tool you should use.

Looking for auto C code generation tools [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am working on embedded project that requires almost same kind of code template for each new implementation.
Instead of doing manual code, I am thinking to automate the code generation process.
So that I only need to provide input data to the tool in some format (could be any input format) and it generated C code according to it.
Open source would be the first choice but proprietary tools are also acceptable.
I already searched for Eclipse Modeling plugins Acceleo and Actifsource but didn't find them suitable for Embedded C code generation.
And I don't want to use heavy solution like MATLAB and LabVIEW just for code generation.
C code generation from UML models is possible with tools such as:
IBM Rational Rhapsody
Open source Eclipse plugin Topcased
There are many variants of C code generation:
function pointers (parent function do the same code exept a little variant)
inline functions + macro (parameters of macro could define a new functions)
systems like make, cmake, autotools (you write an input-file wich is modified at precompiling)
Tell more if you want to get more detailed answer.

Graphic API for embedded system [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I'm looking for a graphic API for embedded systems. With "graphic", I mean an API which is able to draw lines, fill areas, blit bitmaps, etc. I need something that is written in pure C (no C++).
With "embedded systems", I'm thinking of small systems where Linux is too big to run. So I would appreciate a library which is not too concerned with file systems, and OS-level access, but just exposes the graphic primitives with a C interface, and draws in memory buffers.
Any suggestion?
Swell Software, offers C/PEG.
Here's an excerpt from the C/PEG product page:
C/PEG is a complete graphics solution for embedded developers written entirely in ANSI C. C/PEG not only provides optimized graphics primitives, text and bitmap drawing; it also supports higher level graphic objects to give the developer a full tool set for rapid application development
We've used EasyGui - http://www.easygui.com/ - for the start of a project (it's currently on hold).
From the bit I've done it seems quite good. You design up the UI on a PC then generate the C code which makes it all happen.
One thing I like is that if you structure your app properly the code that runs the UI can be separate to the actual UI - ie it could be reused on a different screen resolution/colours/etc. We've made up a modular system where we can reuse bits in different projects as long as we follow the appropriate conventions for button numbers, etc

Beginners' guide for setting up Emacs with gcc/gdb? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I looked around the GNU emacs material and didn't find anything helpful.
Does anyone know of a good tutorial for setting up emacs, to basically turn it into an IDE? I'm looking for interfacing with gcc/gdb/make, etc...
Like other answers mentioned, M-x compile, M-x gdb will get you going. While debugging, I'd also suggest gdb-many-windows-mode, which makes Emacs look a bit closer to IDE when debugging.
Besides that and to get closer to "IDE-like features", you can look at:
CEDET http://cedet.sourceforge.net/ for code completion and project support. Excellent tutorial at http://xtalk.msk.su/~ott/en/writings/emacs-devenv/EmacsCedet.html .
If you don't mind using non-free software, Xrefactory (http://www.xref.sk/xrefactory/main.html) is probably the best (well, the only) refactoring tool. The C version is free, the C++ is not.
Yuval, you're probably being misled by looking for something about IDEs. All that stuff is automagically built into EMACS except for the CScope-like searching stuff.
M-x compile runs make by default, although I reset it to run Ant in java mode.
M-x gdb runs gdb
C-x ` (Ctrl-X backquote) goes to the next compile error
and so on.
Go dig about in the EMACS Wiki. Lots of good stuff. The Programming Category is where you should look.
Good Article
Look at CScope too... you just have to add two lines to your .emacs to be able to navigate through definitions and references
Even though not directly related to C/C++ i find that using a good color scheme is important. Try:
M-x color-theme-select
and you can browse around a lot of different setups if you do not want to create your own.
If you're working with version control system, you can find useful information in another my article about work with version control systems from emacs

Resources