DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   Where to get C++ GUI prgramming tutorials? (http://www.daniweb.com/forums/thread78590.html)

ongxizhe May 17th, 2007 12:36 pm
Where to get C++ GUI prgramming tutorials?
 
Hey all. Does anyone knows where to get some good tutorials of programming C++ Graphical User Interface? If so, please kindly send a PM and include your contact or reply here. Your help willl be appreciated. Thank you.

Xizhe

~s.o.s~ May 17th, 2007 1:00 pm
Re: Where to get C++ GUI prgramming tutorials?
 
Use third party API's if you want your application to be platform independent or use the Win32 API if programming under windows. If using Windows, using C# would be more like it if there is no compulsion on using Win32 API or MFC.

Here is one of those third party API.

ongxizhe May 18th, 2007 6:37 am
Re: Where to get C++ GUI prgramming tutorials?
 
What do you mean?

linux May 18th, 2007 9:48 pm
Re: Where to get C++ GUI prgramming tutorials?
 
If you are using Windows, then you can use the Windows API to complete your task. Otherwise, for cross platform GUI Programming (for Linux/UNIX/Mac) use something else like Tcl/Tk or Qt4.

ongxizhe May 19th, 2007 12:12 pm
Re: Where to get C++ GUI prgramming tutorials?
 
Okay. Thanks.

linux May 19th, 2007 3:36 pm
Re: Where to get C++ GUI prgramming tutorials?
 
No problem. I hope you become good at GUI C++ programming. We need more C++ programmers...

Sturm May 19th, 2007 4:26 pm
Re: Where to get C++ GUI prgramming tutorials?
 
why do you want to become a gui or graphical programmer? Its really not as fun as it initially sounds..

mariocatch May 19th, 2007 11:05 pm
Re: Where to get C++ GUI prgramming tutorials?
 
in c++, yeah it sucks

in c# it's rewarding, and useful in the real world.

ongxizhe May 20th, 2007 8:22 am
Re: Where to get C++ GUI prgramming tutorials?
 
Well, I'm still a novice in IT programming world. If you say so, I would like to try that out. But people says C++ is more useful. Anymore suggestion? Maybe I should learn both. Now I'm currently learning C++ console programming, but I still haven't got the basis of it.

~s.o.s~ May 20th, 2007 1:19 pm
Re: Where to get C++ GUI prgramming tutorials?
 
IMHO, C++ is not exactly an ideal language for someone starting out with programming. Starting out with Python would be more like it. Once you start getting a hang of how things work, jumping on to C/C++ would be more rewarding. Not to mention Python makes it easier for one to develop GUI applications -- easier than C++.

Sturm May 20th, 2007 1:56 pm
Re: Where to get C++ GUI prgramming tutorials?
 
in my opinion gui programming is waste of time. Its not exactly easy to do it in c++. With gui programming you find yourself spending more time designing the gui then actually developing your programming.

~s.o.s~ May 20th, 2007 2:00 pm
Re: Where to get C++ GUI prgramming tutorials?
 
You are under the misconception that GUI programming implies placement of various graphical components. Its not that simple. For placing Graphical components, you can always use IDE's which offer the feature of drag and drop. GUI programming brings with it concepts like events, multi threading and what not.

And the ones you are referring to are called GUI designers, not GUI programmers.

Sturm May 20th, 2007 2:03 pm
Re: Where to get C++ GUI prgramming tutorials?
 
oh..never realized there was drag and drop gui development. The same applies to graphical programming in general, such as SDL or ALLEGRO.

~s.o.s~ May 20th, 2007 2:07 pm
Re: Where to get C++ GUI prgramming tutorials?
 
Again you are getting confused. The last time I checked, Allegro and SDL were more used for game development and are called game programming libraries / game programming API's, not to be confused with GUI libraries. They don't have the concept of 'drag and drop' as such.

The programmer uses those libraries since it provides a easy wrapper around the core DirectX / OpenGL API calls.

Sturm May 20th, 2007 2:14 pm
Re: Where to get C++ GUI prgramming tutorials?
 
yeah, but people also make gui applications with xlib. Allegro and SDL could be used for gui development.

Basically what I am saying is that non-console programming, whether it be gui or game development is not particularly fun or interesting as it seems at first.

~s.o.s~ May 20th, 2007 3:30 pm
Re: Where to get C++ GUI prgramming tutorials?
 
Game development is not fun !! You have got to be joking. And BTW, 'fun' doesn't fetch you revenue, if you must know that...

Sturm May 20th, 2007 4:02 pm
Re: Where to get C++ GUI prgramming tutorials?
 
I did not say game development was not fun.. I said graphical game development is not fun. Programming text based MUDs and nethack like games are extremely fun. After you have finished the text based base, then you can do you start the boring and tedious process of writing a front end for the game.

ongxizhe May 22nd, 2007 8:34 am
Re: Where to get C++ GUI prgramming tutorials?
 
Well, I'm still learning C++ console. Just planning to learn GUI after console. Maybe I'll try C# out. Beside, people says python isn't that useful. What's your opinion?

Sturm May 22nd, 2007 9:30 am
Re: Where to get C++ GUI prgramming tutorials?
 
python is soooo... easy compared to c/c++. I hacked this python application wifi-radar without any previous knowledge of python! You can do amazing games with python in a very short amount of time. Supposedly this kid from my local linux group made this pretty sweet galaga clone after learning python a month before! Try doing that with c++. But then again, pythons a bit slow....(though its nice not to have to compile)

ongxizhe May 22nd, 2007 9:47 am
Re: Where to get C++ GUI prgramming tutorials?
 
Do you mind to introduce python?

ongxizhe May 22nd, 2007 9:48 am
Re: Where to get C++ GUI prgramming tutorials?
 
I mean more specifically.

Sturm May 22nd, 2007 10:28 am
Re: Where to get C++ GUI prgramming tutorials?
 
I dont really know it python.......but it looks like this:
    def run( self ):
        self.dialog.show_all()
        return self.dialog.run()

    def destroy( self ):
        self.dialog.destroy()
        del self.dialog

    def toggle_use_dhcp( self, widget, data = None ):
        expanded = self.dhcp_expander.get_expanded()
        if expanded:
            self.dhcp_expander.set_label( USE_IP_LABEL )
        else:
            self.dhcp_expander.set_label( USE_DHCP_LABEL )

    def toggle_use_wpa( self, widget, data = None ):
        expanded = self.wpa_expander.get_expanded()
        if expanded:
            self.wpa_expander.set_label( USE_WPA_LABEL )
        else:
            self.wpa_expander.set_label( NO_WPA_LABEL )

    def get_profile( self ):
        profile                    = {}
        profile['ssid']            = self.ssid.get_text().strip()
        profile['key']            = self.key.get_text().strip()
        profile['mode']            = self.get_array_item( self.mode.get_active(), WIFI_MODES )
        profile['security']        = self.get_array_item( self.security.get_active(), WIFI_SECURITY )
        profile['channel']        = self.get_array_item( self.channel.get_active(), WIFI_CHANNELS )
        profile['protocol']        = 'b'
        profile['signal']        = '0'
        profile['prescript']    = self.prescript.get_text().strip()
        profile['postscript']    = self.postscript.get_text().strip()
        # wpa
        use_wpa                = ( self.wpa_expander.get_expanded() == False )
        if use_wpa:
            profile['use_wpa'] = False
        else:
            profile['use_wpa'] = True
            profile['wpa_driver']= self.wpa_driver.get_text().strip()
        # dhcp
        use_dhcp                = ( self.dhcp_expander.get_expanded() == False )
        if use_dhcp:
            profile['use_dhcp'] = True
        else:
            profile['use_dhcp'] = False
            profile['ip']        = self.ip.get_text().strip()
            profile['netmask']    = self.netmask.get_text().strip()
            profile['gateway']    = self.gw.get_text().strip()
            profile['domain']    = self.domain.get_text().strip()
            profile['dns1']        = self.dns1.get_text().strip()
            profile['dns2']        = self.dns2.get_text().strip()
        return profile

    def set_profile( self, profile, known ):
        if __debug__:
            print profile
        self.ssid.set_text( profile['ssid'] )
        if known:
            self.ssid.set_editable( False )
            self.dialog.set_title( "WiFi Profile for %s" % profile['ssid'] )
        self.key.set_text( profile['key'] )
        self.mode.set_active( self.get_array_index( profile['mode'], WIFI_MODES ) )
        self.channel.set_active( self.get_array_index( profile['channel'], WIFI_CHANNELS ) )
        self.security.set_active( self.get_array_index( profile['security'], WIFI_SECURITY ) )
        #self.protocol.set_text( profile['protocol'] )
        self.prescript.set_text( profile['prescript'] )
        self.postscript.set_text( profile['postscript'] )
        # wpa
        if profile['use_wpa'] == True:
            self.wpa_expander.set_expanded( True )
            self.wpa_driver.set_text( profile['wpa_driver'] )
        else:
            self.wpa_expander.set_expanded( False )
        # dhcp
        if profile['use_dhcp'] == True:
            self.dhcp_expander.set_expanded( False)
        else:
            self.dhcp_expander.set_expanded( True )
            self.ip.set_text( profile['ip'] )
            self.netmask.set_text( profile['netmask']    )
            self.gw.set_text( profile['gateway'] )
            self.domain.set_text( profile['domain'] )
            self.dns1.set_text( profile['dns1'] )
            self.dns2.set_text( profile['dns2'] )

    def get_array_index( self, item, array ):
        try:
            return array.index( item.strip() )
        except:
            pass
        return 0

    def get_array_item( self, index, array ):
        try:
            return array[ index ]
        except:
            pass
        return ''
thats a code snippet from wifi-radar.

ongxizhe May 22nd, 2007 10:59 am
Re: Where to get C++ GUI prgramming tutorials?
 
And what did you mean by "It's nice not to have to compile it"? Did you mean something like after typing codes and straight away save as type executable file format? Or other type of "compilation"?

~s.o.s~ May 22nd, 2007 1:24 pm
Re: Where to get C++ GUI prgramming tutorials?
 
Yes something like that. Python is basically a scripting language which means it is an interpreted language. You don't need to compile the program. Just type and run it !! Thats why Python is used for quick prototyping of small projects.

Sturm May 22nd, 2007 6:49 pm
Re: Where to get C++ GUI prgramming tutorials?
 
its kind of nice. With big projects compiling can take a while. But with python your ready to go! But alas, like all scripting languages is not what you would call a "high performance langauge." At least its portable ;-)

~s.o.s~ May 22nd, 2007 10:21 pm
Re: Where to get C++ GUI prgramming tutorials?
 
Its a misconception among many people. They always talk about performance without knowing the actually implications of what they are saying considering 80% of the people who cry about performance run no real test or profile their code.

Come on, I mean there has to be some difference between C and Python. But think of it this way, I would rather write a small text based RPG game in Python in one week and have 95% performance than spend 3 weeks writing it in C and have 100% performance benefits.

With the kind of benefits Python offers over its fast counterparts, its kind of acceptable. I mean, you can't have everything, can you ? ;-)

ongxizhe May 23rd, 2007 4:46 am
Re: Where to get C++ GUI prgramming tutorials?
 
Well, thanks. Any suggestion about some must-know or must-do or must-learn before starting python?

Sturm May 23rd, 2007 9:17 am
Re: Where to get C++ GUI prgramming tutorials?
 
Quote:

Originally Posted by s.o.s

Come on, I mean there has to be some difference between C and Python. But think of it this way, I would rather write a small text based RPG game in Python in one week and have 95% performance than spend 3 weeks writing it in C and have 100% performance benefits

Yeah in that example I would use python too.(unless I was programming the RPG to improve my c/c++ skills) But even so performance matters! For example: I do some programming for the ARM (at least I think it is) based gp2x, and performace is the only thing that matters.

Quote:

Originally Posted by ongxizhe
Well, thanks. Any suggestion about some must-know or must-do or must-learn before starting python?

I know this may seem odd but some programmers just do not respect python, ruby, perl, and even java to some extent.
They see "c/c++" as the hardcore programming language and anything other language short of assembly and maybe lisp noobish.

ongxizhe May 23rd, 2007 10:59 am
Re: Where to get C++ GUI prgramming tutorials?
 
Well, lots of people say that C/C++ is more useful. That's why I am learning.

Sturm May 23rd, 2007 11:08 am
Re: Where to get C++ GUI prgramming tutorials?
 
it is in the "real world"

~s.o.s~ May 23rd, 2007 1:07 pm
Re: Where to get C++ GUI prgramming tutorials?
 
> Well, lots of people say that C/C++ is more useful. That's why I am learning.
All languages are useful in real world. Think of them as tools for achieving a given task. Want to do embedded programming, dig up on C. Need quick GUI's, look up Python, Java, C#, VB .NET and the likes. Interested in AI development, look up Lisp. Interested in the field of Mathematics, learn up Haskell.

Knowing a host of languages is what differentiates a programmer from a good programmer, though the language with which you start is an important decision.

Python, Perl, Java are the few languages which are known to be good language for beginners.

Sturm May 23rd, 2007 2:13 pm
Re: Where to get C++ GUI prgramming tutorials?
 
I would not recommend java! Its syntax is much like c++ except that it is slow. heres a good quote:
Quote:

Java is a high performance language, by high performance we mean adequate, by adequate we mean slow
How bout lisp? It will impress people.....

~s.o.s~ May 23rd, 2007 2:40 pm
Re: Where to get C++ GUI prgramming tutorials?
 
Not to mention it would blow away the brains of a first timer... ;-) Writing the whole code in Cambridge prefix notation is not a pretty sight. I still vote for Python or Java.

vijayan121 May 23rd, 2007 2:49 pm
Re: Where to get C++ GUI prgramming tutorials?
 
Quote:

Originally Posted by ~s.o.s~ (Post 371983)
... I still vote for Python or Java.

glad to note that you dropped perl from the list. a 'write once, read never' language is probably not good for anyone.
smalltalk would rank very high among good languages for beginners; it is arguably the best language for beginners.

Sturm May 23rd, 2007 2:56 pm
Re: Where to get C++ GUI prgramming tutorials?
 
Quote:

Originally Posted by s.o.s
Not to mention it would blow away the brains of a first timer... ;-) Writing the whole code in Cambridge prefix notation is not a pretty sight.

Aww...I think lisp is the most beautiful language ever made.

ongxizhe May 24th, 2007 8:26 am
Re: Where to get C++ GUI prgramming tutorials?
 
Well, it's true that every programming languages are useful. But many people always say that C/C++ is more common and more like "multi-functioned", something like it gives access to most parts of the computer. My friend who is studying in NUS (National University of Singapore) also suggested to me to learn Java first and he also said that there'll be some problems if I'm starting with C++ but he said that if I want to learn C++ first wouldn't be imposible, what I mean is he said that I must really put effort on it if starting with C++. Do you all have any other opinion for this?

~s.o.s~ May 24th, 2007 12:30 pm
Re: Where to get C++ GUI prgramming tutorials?
 
C++ is not a good option to start with. Like I said in my previous posts, Python and Java would be better choices. Plus you have got nothing to lose since both of them are mainstream, commercially hyped and used languages.

ongxizhe May 25th, 2007 4:29 am
Re: Where to get C++ GUI prgramming tutorials?
 
Well, if I wanna change to learn Java, what should I know first? And which tutorial's the best?

~s.o.s~ May 25th, 2007 1:39 pm
Re: Where to get C++ GUI prgramming tutorials?
 
You need to get your hands on J2SDK (preferably 1.5 or 1.6) and a decent text editor which provides at least auto indentation and syntax highlighting.

Get the latest SDK here. For a decent text editor you can see this and this.

You can get the Sun Tutorials here.

ongxizhe May 26th, 2007 1:42 am
Re: Where to get C++ GUI prgramming tutorials?
 
Thanks ya!


All times are GMT -4. The time now is 8:03 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC