By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,332 Members | 1,404 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,332 IT Pros & Developers. It's quick & easy.

Creating a widget in C++ without using a toolkit

P: n/a
Hi,

The Qt toolkit claims to be completely written in C++. What I would
like to know is how do I draw a window with a button (or any widget
for that matter) using C++, without using the Qt library? i.e. do I
need to use some specific C++ library for such graphical programs? If
so, which one and where can I get more information about it? Or does
one have to link with the OS-specific APIs for the same?

I presume it would be a taxing task, but I still would like to know.

Thanks.

Nupul

Feb 23 '07 #1
Share this Question
Share on Google+
9 Replies


P: n/a
On Feb 23, 2:50 pm, "NUPUL" <nupul.kukr...@gmail.comwrote:
Hi,

The Qt toolkit claims to be completely written in C++. What I would
like to know is how do I draw a window with a button (or any widget
for that matter) using C++, without using the Qt library? i.e. do I
need to use some specific C++ library for such graphical programs? If
so, which one and where can I get more information about it? Or does
one have to link with the OS-specific APIs for the same?

I presume it would be a taxing task, but I still would like to know.

Thanks.

Nupul
You can certainly make windows in c++ without using any toolkit. Aa
far as i remember there used to be a include file named <graphics.h>
which has very basic elements with which you can make sophisticated
windows and visual effects. However the task is really paintaking and
time consuming.

Feb 23 '07 #2

P: n/a
On Feb 23, 10:50 am, "NUPUL" <nupul.kukr...@gmail.comwrote:
Hi,

The Qt toolkit claims to be completely written in C++. What I would
like to know is how do I draw a window with a button (or any widget
for that matter) using C++, without using the Qt library? i.e. do I
need to use some specific C++ library for such graphical programs? If
so, which one and where can I get more information about it? Or does
one have to link with the OS-specific APIs for the same?
Unless you want to write it all from scratch (and today, noone does
that), you will need to write your code against some API. The Qt is
one such API, and e.g. Windows and Linux have other, lower level APIs
to do the same stuff.
All of this is off-topic here, however, so I would suggest your ask
your question in a newsgroup where this would be on topic. For
microsoft the groups could be microsoft.public.*. Search and you will
find.

/Peter

Feb 23 '07 #3

P: n/a
On 23 Feb, 10:36, qasim.m...@gmail.com wrote:
On Feb 23, 2:50 pm, "NUPUL" <nupul.kukr...@gmail.comwrote:
Hi,
The Qt toolkit claims to be completely written in C++. What I would
like to know is how do I draw a window with a button (or any widget
for that matter) using C++, without using the Qt library? i.e. do I
need to use some specific C++ library for such graphical programs? If
so, which one and where can I get more information about it? Or does
one have to link with the OS-specific APIs for the same?
I presume it would be a taxing task, but I still would like to know.
Thanks.
Nupul

You can certainly make windows in c++ without using any toolkit.
But not without using non-standard extensions specific to your OS.
Aa
far as i remember there used to be a include file named <graphics.h>
which has very basic elements with which you can make sophisticated
windows and visual effects. However the task is really paintaking and
time consuming.
Wherever you found <graphics.hit was not part of C++. It was part of
some 3rd party library.

To the OP: You cannot do what you want in standard C++, which knows
nothing about graphics or windows. As you suspected, you need to use
OS-specific features (which will be different for a different OS). You
should be able to find a newsgroup dedicated to programming on your
particular OS, where you will be able to get help on using those
features.

Gavin Deane

Feb 23 '07 #4

P: n/a
"NUPUL" <nu***********@gmail.comwrote in message
news:11**********************@v33g2000cwv.googlegr oups.com...
Hi,

The Qt toolkit claims to be completely written in C++. What I would
like to know is how do I draw a window with a button (or any widget
for that matter) using C++, without using the Qt library?
http://msdn2.microsoft.com

http://msdn.microsoft.com/library/de...eatewindow.asp
The work involved in creating a very clean, nice AND neat C++ wrapper for
the Windows C API is fairly trivial. IMHO at least!

:O
Feb 23 '07 #5

P: n/a
The work involved in creating a very clean, nice AND neat C++ wrapper for
the Windows C API is fairly trivial.
Well, one of my prior jobs depended on me being able to create robust GUI
out of "vanilla" win32 C API's... May not be trivial for everybody, but for
me, sadly, it is...

;^(...
Feb 23 '07 #6

P: n/a
On Feb 23, 3:36 pm, qasim.m...@gmail.com wrote:
You can certainly make windows in c++ without using any toolkit. Aa
far as i remember there used to be a include file named <graphics.h>
which has very basic elements with which you can make sophisticated
windows and visual effects. However the task is really paintaking and
time consuming.
AFAIR graphics.h is a part of the C library (and that too that of
turbo C), right? Please correct me if i am wrong. Because I remember
using such a header in the days of turbo c, but have never come across
one for C++.

Regards,

Nupul

Feb 23 '07 #7

P: n/a
On Fri, 23 Feb 2007 03:17:50 -0800, NUPUL wrote:
On Feb 23, 3:36 pm, qasim.m...@gmail.com wrote:
>You can certainly make windows in c++ without using any toolkit. Aa
far as i remember there used to be a include file named <graphics.h>
which has very basic elements with which you can make sophisticated
windows and visual effects. However the task is really paintaking and
time consuming.

AFAIR graphics.h is a part of the C library (and that too that of
turbo C), right? Please correct me if i am wrong.
It's not part of the standard C library.
Because I remember
using such a header in the days of turbo c, but have never come across
one for C++.
Nor is it part of the standard C++ library.

--
Lionel B
Feb 23 '07 #8

P: n/a
Chris Thomasson wrote:
>>The work involved in creating a very clean, nice AND neat C++ wrapper for
the Windows C API is fairly trivial.


Well, one of my prior jobs depended on me being able to create robust GUI
out of "vanilla" win32 C API's... May not be trivial for everybody, but for
me, sadly, it is...

;^(...

Wasn't trivial for Microsoft. They tried and came up with MFC!

I guess you're a genius and a hard worker to boot but I think it's
actually quite a lot of work, and the Win32 API doesn't make it easy.

john
Feb 23 '07 #9

P: n/a
"John Harrison" <jo*************@hotmail.comwrote in message
news:70*****************@newsfe5-win.ntli.net...
Chris Thomasson wrote:
>>>The work involved in creating a very clean, nice AND neat C++ wrapper for
the Windows C API is fairly trivial.
Well, one of my prior jobs depended on me being able to create robust GUI
out of "vanilla" win32 C API's... May not be trivial for everybody, but
for me, sadly, it is...
;^(...
Wasn't trivial for Microsoft. They tried and came up with MFC!
MFC == crap... Yup.. Well, shoot, I guess that's a good point!

:O
I guess you're a genius and a hard worker to boot but I think it's
I don't claim to be a so-called "genius"... Anyway, nobody has to be a
"genius" to program the win32 api...
and the Win32 API doesn't make it easy.
The thread synchronization API's can be improved upon, however, the GUI
stuff, IMHO, is fairly straightforward...
Feb 25 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.