C and GUI

so i know C but all i can do are shitty command line utilities
how do i into graphical user interface?

Other urls found in this thread:

en.wikipedia.org/wiki/Ncurses
tldp.org/HOWTO/NCURSES-Programming-HOWTO/
winprog.org/tutorial/simple_window.html
msdn.microsoft.com/en-us/library/bb384843.aspx
amazon.com/Programming-Windows®-Fifth-Developer-Reference/dp/157231995X
amazon.com/Foundations-Development-Experts-Voice-Source/dp/1590597931
safe-c.org/table-en.html
en.wikipedia.org/wiki/C_Traps_and_Pitfalls
nostarch.com/tlpi
twitter.com/SFWRedditVideos

Either make calls to X or use a library.
C users usually use gtk, but if you are willing to use c++, qt is really great.

If you really knew C, you would know that you can use libraries like GTK+ to make GUI for your programs.

You can't because sepples faggots think that you can't do gui without abusing OOP and so they wrote every gui library in sepples.

Qt, gtk, wx, ide shit, cairo, win.form, cocoa, fltk, wayland, x (it'll be shit)

Start learning WinAPI or the linux equivalent.

C is depreciated, use Free Pascal with LCL

>qt
>c
get a loads of this cia nigger

>WinAPI
>Win
>Windows
yeah no

get raped m8

Probably gonna learn c++ sooner or later but I guess I should at least try GTK
is there something i should know? redpill me

...

Fuck you, your thread is shit.

...

umad?:DD:D:D:D:D

en.wikipedia.org/wiki/Ncurses

...

Use CoreFoundation, it just works.

C++ is not that hard to grasp if you have been writing a lot of C.
If you use something like qtdesigner, you can generate the xml for the design, but you can also paint it all in when launching if you want to.
Qtcreator is a good IDE that makes these things easy.

The 1 minute rundown of Qt:
You make a thread for updating the graphical interface.
Fields have callback functions which is called signals and slots.
Signals is a function Qt automatically generate.
You only declare it so the name and the variable type is declared.
The slots is the function that gets called when you emit the signal.
You connect signals to slots either in a wrapper or in the main.

I haven't worked with gtk.

GTK is deprecated by the community and only really used by GNOME and those who are unfortunately stuck with it for legacy reasons.

Qt is the way. Use it as an excuse to learn c++ together with it.

that's good.

now make an in-line chrome style embedded webm player for safari

what C programs have you written?

...

Does it support Linux? Its not listed in the drop down menu

Is there an OS agnostic way to do this, or is that Java's forte?

Well one of Qt's strong points is that, theoretically, the same code can run the three major OS's (not sure about BSD), you just need to compile it on that platform.

Can one use qt creator for a C project?

ttk, iup, libagar, libui

Ok, did not know that. Though it was a pure Linux thing.

Anyway how does it compare to HTML5 for say, app building?

I've been wondering about this, too. I know there are libraries to do this stuff but what exactly are the libraries? Is it just very advanced code in that language or is it something very low level that people set up to be able to use in a higher level language like c or c++?

it's just well thought out code (hopefully, unless the lib sucks) in that language, yes

How does it work though? Would I be able to do these things in c++ without the libraries if I knew it well enough? Are the libraries available pretty much good enough that no one needs to make new ones, essentially?

If you know C you'll be able to work with Qt even if you don't know much about c++ besides a couple functions.
I'm learning C++ on the go as I work in my Qt project.

It works and doesnt run like shit

no. i asked them about that awhile back. they said theres too many variations of the api for the different versions of linux. theres just too many to support.

Qt is C++. Just bite the bullet and go C++, C nowadays is really only used for embedded systems (which wouldn't necessarily use GUIs anyway). If you want to make it hacker-tier, use ncurses.

What I tried to say was, is OOP code a requirement for QT?

They must be wrong.only thong that matters is X server version. However, it does vary in various distros

GTK+ or IUP.

Dont listen to the QT/C++ shills

Every element of the GUI is an object including the window but I don't know much about OOP myself and I'm able to work with it, just understand that objects have properties (variables) and methods (functions).

>X
>GTK
fuck off freetard

>Would I be able to do these things in c++ without the libraries if I knew it well enough?
yes, theoretically.

>Are the libraries available pretty much good enough that no one needs to make new ones, essentially?
no

>he fell for the C meme

You shouldn't have listened to /dpt/.

If you wanted to develop the full stack to make applications that people will actually use, you can't just know C. In today's world, C is only for fast calculation libraries and hardware drivers.

C is where you go when you're ready to gitgud

>.t winfag

GNUStep

Is ncurses easier to learn?
>C nowadays is really only used for embedded systems (which wouldn't necessarily use GUIs anyway).
Well, there is a lot of C software in the Linux world. Most of the stuff I use is C, not C++.
And I use a lot of GTK software which does get updated on a regular basis.
And if I went C++, I'd probably write C with classes and objects.
What's wrong with QT?
Well, a few years ago I opened a simple C# project without knowing anything about OOP besides the general idea of classes and objects, like, father belongs to the class human, stuff like that... Surprisingly enough, I was able to get the hang of it in half an hour and rewrite the project.

if you're reading through TAOCP or TCPL and you go "oh, i genuinely understand why they made these decisions" and aren't confused, you're about to have made it.

Like what decisions?

>Well, a few years ago I opened a simple C# project without knowing anything about OOP besides the general idea of classes and objects, like, father belongs to the class human, stuff like that... Surprisingly enough, I was able to get the hang of it in half an hour and rewrite the project.

Putting memes aside, this is because OOP is actually really easy to read and work with when you're using simple polymorphism, encapsulation, and logical hierarchies of concepts. OOP gets the bad rap when people go balls to the wall with DESIGN PATTERNS and they're writing a sub-2000 LoC library or utility.

Also, not sure about your experience, but I find C# to be one of the easiest languages to read, especially when you come back to a project years later or if you're reading something someone else wrote.

everything

>What's wrong with QT?
It's complex and it's sepples. When using Qt's event system, you need to use a special compiler that emits the C++ code implementing your code because that event system is presented as a special extension to C++. Also, Qt programs' appearance and UI behaviour are configured with big XML files. A clusterfuck.

>Is ncurses easier to learn?
Ncurses is difficult, but it's worth it, if only to make your software look like the soundblaster setup screen.

>And if I went C++, I'd probably write C with classes and objects.
Then learn to write C++. Or don't, doesn't matter much.

Type hierarchies are never a good idea, and they always make the program harder to understand.

When there's no type hierarchy, you don't have to manage the type hierarchy.

Your computer time is over.
I want to you turn off your computer and start doing your homework.

I find C# one of the harder languages to read because everyone goes crazy with LINQ. Combine that with the JavaScript-esque overuse of first-class functions, and with proxy classes and whatever, and programs just become a flurry of inappropriately deep-nested confusion.

> Sandbox syndrome: Your code is tied with a framework.
> Huge piece of software: Setup ṕrocess is tedious (Rebuild everything from scratch dozens of times to target another platform)
> Horrible deploy phase: Ship dozens of DLLs for Dynamic Link for Windows or ends with a Big executable with static link
> No look and feel
> MOC
> Dont follow the C++ Stds: You must learn "QT++"
> Licensing issues (IUP is MIT licensed and executable size with static link is very small)
> QML is encouraged to mobile platforms: It adds another learning curve.

probably because most of them are javascript webdevs turned C#. not real programmers

we all know one

I like C#, too.
Hopefully .NET Core will make it possible to develop applications for Linux systems.
Would you say ncurses is more difficult than QT and GTK?

Why do so many people migrate their projects from GTK to QT, then?

>Would you say ncurses is more difficult than QT and GTK?
Stop procrastinating and see for yourself.
tldp.org/HOWTO/NCURSES-Programming-HOWTO/

Because GTK looks and feels broken and out of place on any system, and is just as unpleasant to compile and to use as Qt.

Lack of options.
Also Productivity and hype.
Most people just want "get the shit done"
They don't care about quality.

I'm not, atm I'm otherwise occupied.
What makes it look broken, in your opinion? I have the same feeling, but I've learned to put up with it somehow.

I'm not that guy, but he gave meme replies to legitimate answers to his question. So yea, shit thread. OP needs to accept few people do GUI in C and learn C++/Python and use Qt/pyqt

>Hopefully .NET Core will make it possible to develop applications for Linux systems.
wut

.NET Core is already a thing for lightweight portable libraries, and people have been using Mono to dev cross-platform for a while now.

The widgets always look wildly wrong on Windows. Qt also often looks wrong, but to a lesser extent.

Contrary to what mobile app developers think, users actually like consistency.

OP needs to try Tcl/themed Tk, iup, libui, and libagar.

>Delphi

I think I'm gonna puke.

p.s. Themed Tk manages to get native look & feel right, so I don't see why it's so hard for the big frameworks

You don't know what C is then.

Yeah I know, but it's not possible to avoid using Mono atm.

winprog.org/tutorial/simple_window.html
msdn.microsoft.com/en-us/library/bb384843.aspx
amazon.com/Programming-Windows®-Fifth-Developer-Reference/dp/157231995X

Good luck have fun.

>Themed Tk
why can't windows draw their ovals right?

literally change the formula just a little bit

kek

>all this winshit

I don't understand what you mean by "looks wrong", can you provide any example?
Usually when I can I use GTK applications, I have a nice dark GTK2/3 theme set up and everything looks consistent.
If I really have to use Qt apps I have it set up to use GTK themes by QGtkStyle.
So on my desktop everything uses the same style and looks consistent no matter if it uses GTK or Qt, which means that the only differences are: perfomance and ease of coding.

Is that even drawn and not a loaded image? Is that even Ttk?

Looks wrong -> never achieves native look & feel.

Looks okay to me.

Objects are like structs. Fields are the variables in the struct. Methods are like function pointers in the struct.

I like how Sup Forums babbies will not point OP in the right direction. No worries, Dr autism to the rescue.
amazon.com/Foundations-Development-Experts-Voice-Source/dp/1590597931

However please DO consider to learn
1. Safe C programming, so your program doesn't leak memory and people exploit the shit out of your code.
safe-c.org/table-en.html
2. Best C practices, so other people read your code without laughing.
en.wikipedia.org/wiki/C_Traps_and_Pitfalls
And lastly, for developing ANY Linux software read this book eventually.
nostarch.com/tlpi

If you have mastered all the books I just suggested, your cock will be bigger than anyone in github. (Oh learn to use shithub as well- takes a few hours).

/thread. Close your Sup Forums tab, remove bookmark, download code::blocks and get going

HOL UP

>code::blocks
L O L

>mom why won't they use my sophisticated VIM with 37 NEET plugins in 1337 mode
Get out

u mena ``cotelite''

use OpenGL

Codelite is a retarded fork of code::blocks

I'm affraid by the time he'll have read all those books he'll lose every interest in programming.

You know where you are, nigga?

bump

Is there a decent cross platform immediate mode gui toolkit for c?

IUP

Lmao faggots, just use Simple direct media layer - the most portable way of doing this stuff. Also big community, which already developed a lot of stuff on top of SDL (e.g. gui frameworks)...

GTK, Glade

Ncurses
> Ncurses
Ncurses
> Ncurses
Ncurses

also Ncurses

...

>GTK is deprecated by the animu cucks of gee

C is shit for anything resembling an application, but anyway, unlike GTK or UIP or other cancer, use libUI instead.

It's cancer for non-games, it will drain your battery since there is only a poll-based event handling in the background.

>Ncurses
>SDL
You'll be set for a while with those two.

VB6 - not even kidding

L
M
A
O