+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: For Linux Users Only

  1. #1
    richm8026 is offline x10 Sophmore richm8026 is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    138

    For Linux Users Only

    Does any Linux Users here know of a C++ Linux Window Skeleton??

    I know that in Windows, it's

    Code:
    #include <windows.h>
    
    LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
    
    static char gszClassName[]  = "darkblue";
    static HINSTANCE ghInstance = NULL;
    
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
            WNDCLASSEX WndClass;
            HWND hwnd;
            MSG Msg;
    
            ghInstance = hInstance;
    
            WndClass.cbSize        = sizeof(WNDCLASSEX);
            WndClass.style         = NULL;
            WndClass.lpfnWndProc   = WndProc;
            WndClass.cbClsExtra    = 0;
            WndClass.cbWndExtra    = 0;
            WndClass.hInstance     = ghInstance;
            WndClass.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
            WndClass.hCursor       = LoadCursor(NULL, IDC_ARROW);
            WndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
            WndClass.lpszMenuName  = NULL;
            WndClass.lpszClassName = gszClassName;
            WndClass.hIconSm       = LoadIcon(NULL, IDI_APPLICATION);
    
            if(!RegisterClassEx(&WndClass)) {
                    MessageBox(0, "Window Registration Failed!", "Error!", MB_ICONSTOP | MB_OK);
                    return 0;
            }
    
            hwnd = CreateWindowEx(
                    WS_EX_STATICEDGE,
                    gszClassName,
                    "darkblue owNz!",
                    WS_OVERLAPPEDWINDOW,
                    CW_USEDEFAULT, CW_USEDEFAULT,
                    320, 240,
                    NULL, NULL,
                    ghInstance,
                    NULL);
    
            if(hwnd == NULL) {
                    MessageBox(0, "Window Creation Failed!", "Error!", MB_ICONSTOP | MB_OK);
                    return 0;
            }
    
            ShowWindow(hwnd, nCmdShow);
            UpdateWindow(hwnd);
    
            while(GetMessage(&Msg, NULL, 0, 0)) {
                    TranslateMessage(&Msg);
                    DispatchMessage(&Msg);
            }
            return Msg.wParam;
    }
    
    I am not sure how to properly ask this question. Thanks for the help .. Even if there is a site that would be even better, I can copy a code off that and then go from there, I would like to do my own Apps from the ground up instead of using a IDE, I know that an IDE would be easier, but I really think doing it by hand would teach me a lot more than a GUI IDE will.. P.S. GUI(only), I really don't like Console Based Apps..
    Last edited by richm8026; 11-17-2008 at 12:53 AM. Reason: forgot to /code


  2. #2
    sunils's Avatar
    sunils is offline x10 Spammer sunils is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Chennai ,India
    Posts
    2,264

    Re: For Linux Users Only

    /*****************Moved to Programming Help Section************/
    Reason:- Author asks about c++ coding.
    [LEFT][B]Sunil Sankar
    -------------------------------------------------------------------------

  3. #3
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: For Linux Users Only

    are you asking about a gui? if so, then take a look at the gtk libraries. I was playing with them briefly, making alert boxes and the sort. other than that, without a gui, you're stuck at the terminal :-/

  4. #4
    richm8026 is offline x10 Sophmore richm8026 is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    138

    Re: For Linux Users Only

    Eww, no thanks, definitely not Terminals, GUI sorry, I should have been more specific..

    But, I did happen to look at FLTK, it looks pretty cool


  5. #5
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: For Linux Users Only

    as I've mentioned, take a look at GTK. they're a widely used gui, and iirc, it's used on firefox, evolution, and just about all gnome apps. kde uses QT libraries, but they didn't have a gpl license prior to 4.0. they used to be qpl, which was their own license.

    so, take a look at GTK

    taking a look at fltk's screenshots, it looks like something that would be used on openbox or something... :-/
    Last edited by xPlozion; 11-17-2008 at 11:10 AM.

  6. #6
    richm8026 is offline x10 Sophmore richm8026 is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    138

    Re: For Linux Users Only

    Thanks for the help =)


  7. #7
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: For Linux Users Only

    np ;). although i don't actually program desktop apps (just web apps), I am quite knowledgeable about it still.

    but I think that i am gonna try to learn C++ and use gtk to make some sort of backend app for my site maybe, so I don't have to be on firefox. just something for me to do i guess :D

  8. #8
    richm8026 is offline x10 Sophmore richm8026 is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    138

    Re: For Linux Users Only

    Nothing wrong with that, LOL


  9. #9
    natsuki's Avatar
    natsuki is offline x10 Sophmore natsuki is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    112

    Re: For Linux Users Only

    GTK, QT, you can even try WxWidgets, and some others (I dunno much but I know there are some other GUI platforms out there). You could use emacs for editing.

  10. #10
    richm8026 is offline x10 Sophmore richm8026 is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    138

    Re: For Linux Users Only

    Hey, does anybody know what Taskbars are made from?

    I noticed in KDE 4.1 they can be resized, they can be wider or taller, now in Gnome, they can't be either one, I'm starting to think that Taskbars are made from forms, am I right or am I wrong?


+ Reply to Thread
Page 1 of 3 123 LastLast

Similar Threads

  1. [Contest] New Users Titles
    By Starshine in forum News and Announcements
    Replies: 38
    Last Post: 06-06-2008, 06:46 PM
  2. How many users?
    By TTIOttio in forum Free Hosting
    Replies: 2
    Last Post: 01-01-2008, 07:22 AM
  3. Too many users using FTP???
    By galaxyAbstractor in forum Free Hosting
    Replies: 3
    Last Post: 11-01-2007, 11:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers