GUI and non gui difference - user-interface

as i know we have gui and non gui application today. but remember back in the old days there were many application thats kinda like half gui half not .
the applications are text based and it has no GUI like what we have now if we were to use java swing library or etc.
but you could pretty much select the area that you want using keyboard shortcut . pretty much looks like vim with more features.
basically it is text based but not fully gui
so my question is how did they do this ? to make the text output persistent and process the data as being inputed non sequentially (non gui typically inputs data non sequentially)

One popular way to do this is to use ncurses and/or its parent, curses. (The n in ncurses is for "new", as in "new curses".)

I think you're looking for something like the curses library.

You mean like ncurses interfaces?

Related

I want the user to enter text in a text box, how can i do this?

I want the user to enter text in a text box (such as a login text box on some site).
I tried to search in text() bibliography and other similar functions.
This guy seems to have figured it out: http://www.sojamo.de/libraries/controlP5/. Look for the textArea control.
If you don't like this, I read that the g4p library had something like an inputbox. Otherwise you will have to draw it yourself (which would be a nice exercise) using keyboard inputs and the like.
What you're describing is called a graphical user interface, or GUI. There are many ways to approach this problem:
Code it yourself. Use something like the rect() function to draw a text box, and the keyPressed() function to detect key presses.
Use a library. The Processing libraries page lists several GUI libraries. Try each of them out and see which one you like best.
Use a more general GUI library. If you're deploying as Java, then you might use Swing or JavaFX. If you're deploying as JavaScript, then you might use HTML elements.
Any of the above might work, and which approach you choose depends more on you, your context, and your preferences. We can't tell you which is best, because it's all up to what you prefer.

Drawing popups in X11

I would like to draw a popup in X11. Something like the slider that appears in KDE and GNOME when you press volume or brightness control buttons. This is what it looks like in GNOME:
What library should I use to create such popups (unlike normal windows they should be without borders, etc. and possibly with some transparency)? Would be nice if there were bindings for Python.
This is done in GTK+. The easiest thing may be to find the code that creates that and copy what it does (my system has a different volume notifier, I'm not easily finding the code for that one).
Roughly what you'd do is create a GtkWindow, set_decorated(FALSE), set_position(GTK_WIN_POS_CENTER), something along those lines.
I'm not sure of the best set_type_hint(). Maybe TYPE_HINT_NOTIFICATION or TYPE_HINT_SPLASHSCREEN. If you do set the type hint, it may not be necessary to set_decorated or set_position since the type hint may imply those with many window managers.

How Imitate a [Ctrl+Left mouse click] on the center of the form or open another program and type in a word?

Babylon dictionary and a couple of other dictionaries allow to click on any word in any windows program
and automatically recognize the word under the cursor, and at once open the dictionary window while searching for that word in installed dictionaries.
You can on the other hand open your dictionary, type in your word and press Enter, the result will be the same.
There's a Delphi form, containing a text label, for example with the word "Automaton".
My question is:
How to send a word from my Delphi application right into the dictionary window, as if you typed it manually and pressed Enter?
The best solution is to send some message through the Windows mechanism, but if it is too complicated, there's another solution, and so the second answer: as I described, we need to model a [Ctrl+left mouse] click on a form where this word is displayed on a form [ a visual label on the screen of my Delphi application], to be exact, on some central pixel of this label.
Could you kindly give an advice how to do one thing or another in Delphi ?
** edit:
The problem with AppActivate is this: Babylon dict has a daemon part that seats in the tray.
In the task manager a real window where the text should be input also is named 'Babylon'.
So AppActivate('Babylon') tries to bring to front the non-visual part of the application.
Do you have any suggestion how to determine the windows handle or something of a real visual part of the application? In the task manager, I repeat both visual and non-visual parts are named 'Babylon'.
I cannot offer an answer so much as some insight and advice...
There are certain applications which "intercept" keyboard and mouse instructions, and essentially "nullify" them if they are being immitated by software. Generally-speaking, you'd only see this in proper AntiVirus software such as Kaspersky by design... however:
The way some (not many, but some) programs hook keyboard and mouse inputs, as a side-effect, behave the same way. If you have attempted all of the advice given as comments above, and cannot get Babylon to trigger an action as a result, it is likely Babylon behaves as I have described.
If what I suspect is true, then the method you are attempting is simply not possible (at least, not using any simple Pascal code on its own... ASM might be able to do it but that's beyond my knowledge).
A better solution may be to do a little research to see if any of the following options are available to you:
1) Does Babylon have a Pipeline or API you can use to interface your application(s) with it?
2) Is the particular functionality you require of Babylon accessible through one (or more) DLL files distributed as part of Babylon?
3) Is there an alternative to using Babylon for your needs?
I know it's not an answer as such (certainly not one you'd want to hear), but it may point you in a better direction.

Interactive TextArea (collapsible bullet points)

I don't work with Graphical interfaces very much, most of my experience has been with Java. I realize the operating system provides some "native" controls that allow you to do things. What if I want to do things that are a little more fancy but feel like the native control?
What I'm thinking is having the simplicity of editing in a TextArea while provide the ability to collapse lists just like a tree. I would also like to be able to display text between lines that the user could click, it should be aligned under the right most text and be smaller.
I'm not thinking in terms of any language or GUI library. Just wondering how to go about creating something like this. Would I overlay some drawing onto the TextArea which would scroll with it? Would I use something like Cairo and build my own text field losing built in copy and paste...
What do other text editors use that allow them to fold code?
There is no universal solution to this. It varies depending on GUI. Every GUI has a different way of responding to user events such as mouse clicks, keyboard shortcuts, etc. There is no universal approach to this.

Find out which keyboard layout is used, using ruby

How can I find out, which keyboard layout the user of my ruby application is using?
My aim is to have a game, where you can move the player on a map. To go one step down and one step left you press "Y" on a german keyboard. On an American keyboard, you would press "Z". We optimized the game for windows and mac, so I would like a solution for both platforms (and we don't use any command/shift/control-keys).
For Windows, you probably have to use the Windows API GetKeyboardLayout(), unless Ruby provides a wrapper for that.
There are a lot of useful I18n resources for Windows on the MSDN web site.
It might be easier to simply allow them to configure it themselves as a preference if you don't have a good portable way of detecting it.
I think it'll be much easier and naturally to allow users to define keys themselves.
As Alexander recommended, let the user define the keys themselves.
But, if you really want to recognize the layout, you could always ask the user to press keys in certain positions, particular to some layouts.
"Press the second key to the left of the return key. If your return key is two rows high, press the lower one"
[presses รค]
"Looks like you have a scandinavian keyboard"
That, however, is a horrible cludge, and, in the game context, would recommend the custom keymapping method

Resources