Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Wanna learn native GUI programming in UNIX - Linux ? Post 303040558 by Sennenmut on Thursday 31st of October 2019 01:46:10 PM
Old 10-31-2019
GUI Programming. Code works.

Hi ,
wanna learn native GUI programming in Unix-Linux instead of Gtk and Qt.
No problem. You don't need a cross platform Gui toolkit like Gtk and Qt.
And the code and syntax is also not more or less than others.
Check out this code for a simple mainwindow for your application that is openend in the middle of the screen.
Save code as mainwin.c file.
Go in the folder with terminal and compile with the command :
Code:
clang -o newone  mainwin.c  -lXm -lXt -lX11

When it is ready then write in the same folder terminal :
Code:
chmod 777 newone

Start the executable file from normal file browser with a double klick.
You see a main window GUI in the middle of your screen.
Thats it.
All works propertly. Since 30 Years. Only cross compile applications need a different toolkit.
Change the size of the window simple by other dimension data.
Of course you should have installed 'clang' compiler and 'motif' toolkit with your
synaptic package manager programm that is on your UNIX machine.

Code:
 #include <Xm/Form.h>
#include <Xm/Label.h>
#include <Xm/PushB.h>


int main ( int argc, char ** argv )
{
    Widget              shell, form, label, button;
    XtAppContext app;
    int  i;


    shell = XtAppInitialize ( &app, "Formtest", NULL, 0,
                          &argc, argv, NULL, NULL, 0 );

    Screen * s = XtScreen(shell);

    int dw = WidthOfScreen(s);
    int dh = HeightOfScreen( s );

    Dimension px = (dw-500)/2;
    Dimension py = (dh-300)/2;

    XtVaSetValues ( shell,
              XmNwidth, 500,
              XmNheight, 300,
              XmNx, px,
              XmNy, py,
              NULL );


    form = XtCreateManagedWidget ( "form", xmFormWidgetClass,
                                shell, NULL, 0 );

    label = XtVaCreateManagedWidget ( "label", xmLabelWidgetClass,
                                form, NULL, 0 );

    button = XtVaCreateManagedWidget ( "button", xmPushButtonWidgetClass,
                                form,
                                XmNbottomAttachment,       XmATTACH_FORM,
                                 0 );
    XtVaSetValues ( button,
              XmNwidth, 100,
              XmNheight, 50,
              NULL );


    XtRealizeWidget ( shell );
    XtAppMainLoop ( app );

}


Last edited by Sennenmut; 10-31-2019 at 03:44 PM.. Reason: more description
 

10 More Discussions You Might Find Interesting

1. Programming

Want To Learn Network Programming

I want to learn Network Programming with C,but I don't know how to start. Thank you. (2 Replies)
Discussion started by: hubin330
2 Replies

2. UNIX for Dummies Questions & Answers

total windows cripple wanna learn unix well

hello, I finally installed a unix port (NetBSD) on my workpad z50 and now I'm trying to configure it and well right about now I know 2 commands and I can start one program Vi is the program and I can navagate with cd and ls those are the two commands wait I know 3 date I also know but I can't even... (3 Replies)
Discussion started by: terramir
3 Replies

3. UNIX Desktop Questions & Answers

Running MS-windows GUI from unix/linux

Hi i need some help , i would like to run a GUI application on windows from unix i dont need to see the gui just to activate it from remote . it shoud be from CLI on the unix . thanks GUY (1 Reply)
Discussion started by: koreng
1 Replies

4. Programming

How to modify this c code to get full GUI interface for Unix Linux ?

Hi, the following code comes from Unix Linux dialog utility project. Unfortunately, this project is no more actively maintained. Unix Linux dialog utility is made of widget boxes. One of them is mixedgauge.c In the following example I would like to get rid of flickering when run in... (0 Replies)
Discussion started by: jack2
0 Replies

5. Fedora

Is it better to learn Linux before unix?

I want to learn (unix solaris), but someone advised me to learn (Linux fedora) before trying (unix solaris) and that they are almost the same.. So shall I go with his advise or is it better to start learning unix directly? (1 Reply)
Discussion started by: proud
1 Replies

6. Shell Programming and Scripting

Best way to learn UNIX and shell Programming

Guys, What do you think is the best way to learn UNIX and shell scripting? ** I keep on searching tutorials online, where I loose most of my time :( Let me know the way you learnt the UNIX concepts, your replies might help me learn more. Thanks a ton:b: (2 Replies)
Discussion started by: dnam9917
2 Replies

7. UNIX for Dummies Questions & Answers

I have to learn UNIX/LINUX/VIM/EMACS

I need some advice from people who use command line frequently and know how to use both VIM and EMACS pretty well for their daily tasks. Please no opinion on which one better etc..., I got enough at that from the Internet. A little about my professional background: I have been a firmware... (2 Replies)
Discussion started by: gspec
2 Replies

8. UNIX for Dummies Questions & Answers

Open-source projects to learn concurrency-managed network programming in Unix?

Hi, I am a mid-career programmer with extensive experience in object-oriented design and development in C, C++, and C#. I've written a number of multi-threaded server applications and background services, although my grasp of networking protocols is a bit weak: my current job drifted away from... (2 Replies)
Discussion started by: TheTaoOfPhil
2 Replies

9. Fedora

Which flavor of UNIX or Linux to learn?

Hi all, Noob here. I have been dabbling with Linux for years, basically installing different types of distros and becoming familiar with the default gui that came along with it. At this point, I find myself wanting to learn alot more. It would be great if that knowledge helped me move forward... (2 Replies)
Discussion started by: Petros_K
2 Replies

10. Fedora

Which is the better platform to learn UNIX/Linux (Kali Linux Vs. Red Hat or other)?

I just started a new semester and I started my UNIX class yesterday. I've already decided to use python along with my learning process but what I really want to use with it is Kali as my UNIX/Linux platform to learn off of since I already wanted to learn Cyber Sec. anyways. I just wanted to know if... (12 Replies)
Discussion started by: ApacheOmega
12 Replies
GIT-GUI(1)                                                          Git Manual                                                          GIT-GUI(1)

NAME
git-gui - A portable graphical interface to Git SYNOPSIS
git gui [<command>] [arguments] DESCRIPTION
A Tcl/Tk based graphical user interface to Git. git gui focuses on allowing users to make changes to their repository by making new commits, amending existing ones, creating branches, performing local merges, and fetching/pushing to remote repositories. Unlike gitk, git gui focuses on commit generation and single file annotation and does not show project history. It does however supply menu actions to start a gitk session from within git gui. git gui is known to work on all popular UNIX systems, Mac OS X, and Windows (under both Cygwin and MSYS). To the extent possible OS specific user interface guidelines are followed, making git gui a fairly native interface for users. COMMANDS
blame Start a blame viewer on the specified file on the given version (or working directory if not specified). browser Start a tree browser showing all files in the specified commit (or HEAD by default). Files selected through the browser are opened in the blame viewer. citool Start git gui and arrange to make exactly one commit before exiting and returning to the shell. The interface is limited to only commit actions, slightly reducing the application's startup time and simplifying the menubar. version Display the currently running version of git gui. EXAMPLES
git gui blame Makefile Show the contents of the file Makefile in the current working directory, and provide annotations for both the original author of each line, and who moved the line to its current location. The uncommitted file is annotated, and uncommitted changes (if any) are explicitly attributed to Not Yet Committed. git gui blame v0.99.8 Makefile Show the contents of Makefile in revision v0.99.8 and provide annotations for each line. Unlike the above example the file is read from the object database and not the working directory. git gui blame --line=100 Makefile Loads annotations as described above and automatically scrolls the view to center on line 100. git gui citool Make one commit and return to the shell when it is complete. This command returns a non-zero exit code if the window was closed in any way other than by making a commit. git gui citool --amend Automatically enter the Amend Last Commit mode of the interface. git gui citool --nocommit Behave as normal citool, but instead of making a commit simply terminate with a zero exit code. It still checks that the index does not contain any unmerged entries, so you can use it as a GUI version of git-mergetool(1) git citool Same as git gui citool (above). git gui browser maint Show a browser for the tree of the maint branch. Files selected in the browser can be viewed with the internal blame viewer. SEE ALSO
gitk(1) The git repository browser. Shows branches, commit history and file differences. gitk is the utility started by git gui's Repository Visualize actions. OTHER
git gui is actually maintained as an independent project, but stable versions are distributed as part of the Git suite for the convenience of end users. A git gui development repository can be obtained from: git clone git://repo.or.cz/git-gui.git or git clone http://repo.or.cz/r/git-gui.git or browsed online at http://repo.or.cz/w/git-gui.git/. GIT
Part of the git(1) suite Git 1.7.10.4 11/24/2012 GIT-GUI(1)
All times are GMT -4. The time now is 09:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy