Xcode C++ window application [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm studying at university. My classmates working in Visual Studio but I have Mac and I want to work in xCode. The programming language is C++.
I need to create a window application with a button and text label. When I click on the button the text in label must change.
Can you help me? How I can create window applications in Xcode in C++ and work with UI? Thank you.

Use QT on Mac instead. Applications created using XCode can only run on OSX and iOS. Also, to create UI in XCode you need to use Interface Builder in XCode. Google Interface builder tutorial.

In general, GUI development is platform specific (Cocoa for OS X,.Net for Windows, GTK+ for Linux).
If your classes are doing GUI development, you should use whatever they are. If they are using Windows, then you need to use whatever tools and libraries they are using. If they aren't doing GUI development, then do whatever you like - but remember that GUI development is generally platform specific.
The exception to that generality is cross-platform suites like Qt (which isn't really completely cross-platform). But, like Java, that portability comes at the cost of having a massive infrastructure and unique build system. There's nothing wrong with wanting to learn and develop in it...just don't do it by ignoring your classes.
Qt does have a free open-source licensed version. You can look into it more on the Qt-project site:https://qt-project.org

Related

Running c or c++ code in standalone Xcode playground [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I would like to create a standalone playground and just drop a bunch of swift code into the Sources folder. I also have dependency on c/c++ code, so I also dropped those, and added a Bridging Header.
These bunch of files compiled together in an Xcode project. However, i can't get them to work as a standalone Playground. Note that I aint trying to write c in the playground, but Swift code that in terms are wrapper for that C.
Any idea how thats done? if possible.
Note: Not sure why my Q is voted down. It is legit. Again, I plan to write Swift code in playground, but need a 3rd party library that has C files in it.
Playgrounds are Swift only.
What I do when I'm experimenting with language subtleties is to use a Mac command-line tool. It doesn't have a UI, and doesn't have the overhead of launching the simulator. Command line tools can be in any combination of supported languages.
Obviously this wouldn't help if the code you are working on is iOS specific, but there's actually quite a bit of overlap in the Foundation and Core Foundation frameworks.
Edit:
If what you have is a third party library, you should be able to build it into a Cocoa framework and include that in your playground. See this link for more (somewhat out of date) information: https://pardel.dev/2018/08/10/3rd-party-frameworks-in-xcode-playgrounds/

Graphics and windows programming in 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 7 years ago.
Improve this question
Friends I read that many windows applications like Firefox browser are written in C++. So I decided to learn C++and learnt many concepts of object oriented programming. But all I can do now is simply make console program that runs in a command prompt screen with white text in black background. How can I create graphics and gui for my software. Also I see in installation directory that program fines has many different files. How can I work with many files and create a real life windows software (hey I'm not asking you how to code Microsoft office or so... Just some simple application)
Could you give me an idea how a program like Google chrome is made
You need a framework, because you need to communicate with the operating system. This also means your application will be platform dependent.
IMHO the best start is to skip learning (the ugly) Windows API and learn some multiplatform framework like Qt.
With Qt the start is easy. Just download Qt with Qt Creator, click "Wellcome/Examples", select any example, compile and you're just running your first graphic app!
The list of examples can be also found here http://doc.qt.io/qt-5/qtexamplesandtutorials.html which should give you an idea what you can do.

How to build native C++ apps with HTML/CSS UI? [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 6 months ago.
The community reviewed whether to reopen this question 3 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
Is it possible to develop a C++ program while using HTML and CSS for the user interface? I know about programming with Javascript using a Webkit container, but I am really interested in C++ development.
I felt in love with C# WPF when I developed under Windows, but now I moved to Linux and I haven't found a good tool for using markup for interfaces. For this, I would like to mix HTML and CSS, which are very lightweight and easy to use, with C++ code, with something like WPF.
Oh, one more thing: I'm looking for desktop development, not web.
Yes, it is possible. What you want is a C++ web framework. You could start by looking at CppCMS—a Free High Performance Web Development Framework (not a CMS) aimed for Rapid Web Application Development.
Edit: After the question has been clarified, I think Awesomium would be a good fit for your needs.
You can achieve the same functionality by embedding WebKit (or Gecko) but as far as I know that is exactly what Awesomium does behind the scenes.
An alternative is librocket—a C++ interface middleware package designed for game applications. As you can guess from the description it is a good fit for games or real-time applications.
Sciter is exactly that - embeddable HTML/CSS engine with C/C++ API. Compact and multi-platform.
And check this article.
Sciter has the same feature set as WPF but uses HTML/CSS instead of XAML and uses native API.
Features out of the box:
HTML, CSS, SVG, aPNG (animated PNGs), image sprites,
<plaintext> - editor with syntax highlighting,
<htmlarea> - WYSIWYG HTML editor,
<frame type=pager> - print preview and HTML/CSS print,
animations,
HTTP client, REST/JSON client, WebSocket's, DataSockets,
etc.
The same application with Sciter UI running on Windows, MacOS and Linux from the same sources:
Disclaimer: I am an author of Sciter Engine.
2021 update: you can also use Sciter.JS that is version of Sciter that uses standard JavaScript (ES2020) script engine.
I think Electron would be a nice addition to the other answers.
It uses NodeJS to run a Webkit Window. Electron itself is only html/css/js, but you can use any Node Module within your Electron App - including custom, natively compiled C++ code. A possible Module to embed your C++ code would be node-gyp.
Be aware, however, that this workflow may include a little bit more JS than you would have with the other answers.
My favourite text editor, Atom, was made with Electron.
You can use Chromium Embedded Framework to embed HTML5 content in your app.
You'll get might and speed of Chromium and ability to build GUI apps the same way you develop web applications.
I suggest checking out Ultralight HTML UI Engine
Not Open Source, Available for C++. OpenGL and DirectX rendering supported.
Ultralight is the lighter, faster option to integrate HTML UI in your
C++ app.
It's made by the creator of Awesomium, who unfortunately decided to delete Awesomium.
If you need something more heavy weight I recommend taking a look at CEF. It’s a very powerful (and open source) tool.
I would suggest RmlUI
Its an active fork of librocket with more features. Its very modular, you can handle rendering, event handling and user input yourself (or copy one from provided examples).
Note: RmlUI doesn't support full HTML5/CSS3 specifications, but only a subset of it. Animations are supported tho.

Looking to develop my own small C++ browser that basically will display HTML, Javascript, and Flash, where to start? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm looking to start developing a browser (operating system isn't an issue, but preferring Linux or Windows). I'm just trying to figure out where to start. I know Visual Studio lets you drop a lightweight IE component into it, but I don't want IE's issues. I was hoping to start with a very basic mozilla build, but I cant seem to find one anywhere.
Does anyone know where I can find a good open source starting point OR how to start this on my own?
If you're not opposed to using Qt, then Qt's Webkit implementation could be a fairly clean start for cross-platform work:
http://doc.qt.nokia.com/4.7-snapshot/examples-webkit.html
Note in particular the "Fancy Browser" sample:
http://doc.qt.nokia.com/4.7-snapshot/webkit-fancybrowser.html
There are many customizations possible and ways of hooking the engine. There's also support for Flash, though I've not tried that:
http://www.qtcentre.org/threads/31547-Flash-support-for-QT-Webkit-4-6
Although you can use Qt with other compilers/IDEs, the quickest way to get started is with Qt Creator. After installing it there should only be a few clicks needed to get the QtWebkit examples building, on either Windows or Linux:
http://qt.nokia.com/products/developer-tools

Using Google Chromium's Views Project as an Application Framework in C++ [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have had contact with Google Chromium Code and that’s terrific for building applications with. The problem now lies that no-one has tried to use it outside Google Chromium Project. What I have in mind is to develop an open source project which may be used for this purpose. The fundamental goals would be:
Guarantee Linux-Windows support for the same code.
Take advantage of all resources available like thread control, stats, unit test…
Make it clearer how to use Skia for graphic effects and customizations.
Present a useful application doing the most of this.
Integrate C++ and JavaScript code using V8
Use Webkit for rendering html content
There’s a chance of it get off the paper. What do YOU think?
Claudio M. Souza Junior
Developer.
see https://github.com/lianliuwei/chromium_base
I create it for the same reason like you.
chromium is great project. It's code could be useful to using in other project. but It need time to extract it. I see one project to extract the ui part, but it change too many for noreason for example it change the .cc to .cpp. my project extract the base, ui, view part for the origin project, rm the ICU (it's so big) and gurl(you can add it quick) keep the gyp, gclient, grit-i18n, gtest, gmock... change the code little. and keep the extract history. I add a new type of messageloop for using it in the MFC(for company project :( ) now it can only work on Windows but it's no so hard to make it work on linux.(google do it all)
for use the browser in you project you can see the http://code.google.com/p/chromium/ for help.
It's great this project help you a litte. I at first think it's a no one care project.
I'm assuming you have looked at the extensively documented and developed QtWebkit and know why you don't want to use that?
I'm sure it will be easier to use V8 in a QtWebkit application than to somehow tear out Chromium's "View project".
Qt has the bonus that as long as you operate within the framework, everything will work on a lot of different platforms (more than Chomium now supports I think).