Creating a widget in C++ without using a toolkit

Discussion in 'C++' started by NUPUL, Feb 23, 2007.

  1. NUPUL

    NUPUL Guest

    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
     
    NUPUL, Feb 23, 2007
    #1
    1. Advertising

  2. NUPUL

    Guest

    On Feb 23, 2:50 pm, "NUPUL" <> wrote:
    > 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, 2007
    #2
    1. Advertising

  3. NUPUL

    peter koch Guest

    On Feb 23, 10:50 am, "NUPUL" <> wrote:
    > 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
     
    peter koch, Feb 23, 2007
    #3
  4. NUPUL

    Gavin Deane Guest

    On 23 Feb, 10:36, wrote:
    > On Feb 23, 2:50 pm, "NUPUL" <> wrote:
    >
    > > 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.h> it 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
     
    Gavin Deane, Feb 23, 2007
    #4
  5. Chris Thomasson, Feb 23, 2007
    #5
  6. > 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...

    ;^(...
     
    Chris Thomasson, Feb 23, 2007
    #6
  7. NUPUL

    NUPUL Guest

    On Feb 23, 3:36 pm, 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
     
    NUPUL, Feb 23, 2007
    #7
  8. NUPUL

    Lionel B Guest

    On Fri, 23 Feb 2007 03:17:50 -0800, NUPUL wrote:

    > On Feb 23, 3:36 pm, 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
     
    Lionel B, Feb 23, 2007
    #8
  9. 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
     
    John Harrison, Feb 23, 2007
    #9
  10. "John Harrison" <> wrote in message
    news:70GDh.7194$...
    > 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...
     
    Chris Thomasson, Feb 25, 2007
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Srinath Avadhanula

    GUI toolkit selection for a text editor widget

    Srinath Avadhanula, Nov 8, 2003, in forum: Python
    Replies:
    2
    Views:
    452
    J. Random Hacker
    Nov 9, 2003
  2. Replies:
    0
    Views:
    347
  3. Frederic Rentsch
    Replies:
    0
    Views:
    266
    Frederic Rentsch
    Jul 8, 2012
  4. Terry Reedy
    Replies:
    15
    Views:
    663
    Frederic Rentsch
    Jul 16, 2012
  5. Frederic Rentsch
    Replies:
    0
    Views:
    454
    Frederic Rentsch
    Jul 9, 2012
Loading...

Share This Page