Author Topic: Designing GUI's?  (Read 8909 times)

DarkDepths

  • Guest
Designing GUI's?
« on: April 17, 2007, 06:26:36 am »
Hello. I have a bit of a problem. I would really like to get started with designing some graphical programs, because console apps get a little boring.

I have looked at the win32 API, but I can't understand it nor can I find any decent resources/tutorials.

I tried to use wxwidgets, but I ran into two problems:

1. I couldn't get mingw to install properly. And just so nobody asks, I'll tell the reason right now. I have two drives, C: has only about 4 gigabytes left on it. So I put it on D:, now the D: drive formats every few days...

2. I thought I might be able to build wx through C::B, but I couldn't figure it out.


So then I started looking around for others, but as far as I can tell, the only other ones out there draw their own graphics instead of the operating systems, which is a bit annoying I think.


Here is my question. Actually, it's a couple questions, but if any can be answered then the rest likely won't need to be!

1. Can anybody recommend any decent resource materials for Win 32?

2. Can somebody tell me if it's possible to build wx through C::B, and if it is, perhaps I could get a little support there?

3. Can somebody recommend anything to make designing a GUI a fairly simple process that uses the OS's native graphics?

Thanks in advance! :shock:

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Designing GUI's?
« Reply #1 on: April 17, 2007, 02:24:38 pm »
1. I couldn't get mingw to install properly. And just so nobody asks, I'll tell the reason right now. I have two drives, C: has only about 4 gigabytes left on it. So I put it on D:, now the D: drive formats every few days...
Wha? "Formats every few days"? What do you mean by that?

Quote
2. I thought I might be able to build wx through C::B, but I couldn't figure it out.
Nope, it's so easy that you don't even need Code::Blocks. Just open up a command prompt and enter the following two lines (assuming that you extracted wxWidgets to C:\wxMSW-2.8.3):
Code
cd C:\wxMSW-2.8.3\build\msw
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1
10 minutes or so later, depending on how fast your PC is, wxWidgets will be built. If you're using Visual C++ instead of MinGW, then you just use the special Visual Studio command shell and replace "mingw32-make -f makefile.gcc" with "nmake -f makefile.vc".

Quote
So then I started looking around for others, but as far as I can tell, the only other ones out there draw their own graphics instead of the operating systems, which is a bit annoying I think.
I agree; at least, pretty much the only other usable ones are that way. Some of them are in fact more usable than wxWidgets, but I prefer wxWidgets precisely because it uses native widgets (doesn't draw its own graphics).

Quote
1. Can anybody recommend any decent resource materials for Win 32?
Only the MSDN Library. I started with a couple of the Win32 sample and skeleton apps floating around in there and worked up from there. I don't really recommend learning Win32 as your API of choice; it's very outdated.

Quote
2. Can somebody tell me if it's possible to build wx through C::B, and if it is, perhaps I could get a little support there?
See above. :)

Quote
3. Can somebody recommend anything to make designing a GUI a fairly simple process that uses the OS's native graphics?
Well, I certainly do recommend wxWidgets. Once you get a basic wx app going, you can figure out how to load XRC files and then use a tool like wxSmith (which comes with Code::Blocks) or wxFormBuilder to design dialogs, menus, and such visually. (I'd love to be able to recommend wxSmith as my first choice, but wxFormBuilder at this point is quite a bit easier to use.) Just make sure to learn about sizers, because you can't make GUIs in wxSmith OR wxFormBuilder without them.

Cheers,
JohnE / TDM
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline rjmyst3

  • Multiple posting newcomer
  • *
  • Posts: 117
    • wxFormBuilder
Re: Designing GUI's?
« Reply #2 on: April 17, 2007, 02:34:28 pm »
If you'd rather not worry about having to correctly compile wxWidgets yourself, get wxPack.

DarkDepths

  • Guest
Re: Designing GUI's?
« Reply #3 on: April 18, 2007, 05:45:55 am »
Well... I mean that my D drive is pretty unstable. Every now and again, when I turn on the computer, D has been emptied. I will look at wxPack, but I fear the file will be too large, (dial-up).

Thanks for the help though!

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Designing GUI's?
« Reply #4 on: April 18, 2007, 03:15:35 pm »
You mentioned that your other drive had about 4GB of free space left; a full MinGW install takes up only about 80MB. You have plenty of room for it there. In other news, 80GB hard drives can be had for as little as $43US plus shipping from sites like NewEgg.com -- so if you live in the US and own a PC, there's little excuse for being low on hard drive space.

wxPack is an extremely large download for dial-up users. Building wxWidgets yourself is a better alternative, and (as evidenced above) is not too difficult. Understanding what the build options get you and how to use the resulting build is the hard(er) part. Make sure to read INSTALL-MSW.txt, and of course the documentation. (wxWidgets 2.8 series doesn't come with the MS HTML Help docs, which are in my opinion the most usable; you can get them separately on the download page.)
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

dr snuggles

  • Guest
Re: Designing GUI's?
« Reply #5 on: April 18, 2007, 03:29:41 pm »
I tried the above recepies to start building GUI's. Compiling wxWidgets takes more than an hour, so I aborted it. The wxPack seems to work. However, every time I open and build my GUI project, it also recompiles wxWidgets, so that sucks too.

Is there by any chance a user-friendly way of starting to design multi-platform GUI's? Or should I get used to searching, trying programs and reading howto's for several hours before actually starting to design the GUI?

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Designing GUI's?
« Reply #6 on: April 18, 2007, 04:10:30 pm »
Compiling wxWidgets takes more than an hour, so I aborted it.
Good things come to those who wait. :) (Or to those with faster PCs...)
At any rate, one of the things you can do to shorten the compilation time for wxWidgets is redirecting the output. If you redirect stderr and stdout into nullspace, no text needs to be displayed (and constantly scrolled), so the CPU has more time to devote to the build. Append "1>nul 2>nul" to the make command to send the output nowhere.

Quote
The wxPack seems to work. However, every time I open and build my GUI project, it also recompiles wxWidgets, so that sucks too.
I really have no idea what you mean by "recompiles wxWidgets", and I suspect it's something other than you think. Perhaps you could give an example of what you mean.

Quote
Is there by any chance a user-friendly way of starting to design multi-platform GUI's?
Yes.

Quote
Or should I get used to searching, trying programs and reading howto's for several hours before actually starting to design the GUI?
Yes.

The concept of a modern GUI is a complex one in and of itself. On top of that, wxWidgets is an attempt to provide a basis for describing the common features of several modern GUI platforms that were not, for the most part, intentionally designed to have anything in common. Any intermediary library has to find a balance between ease of use and power/flexibility, but all these conflicting requirements make wxWidgets' balance harder to find, and for the most part it falls on the "power/flexibility" side. This means that a fair amount of advance learning is necessary.

But as far as C++-based cross-platform GUI libraries go, I'd call wxWidgets user-friendly. This older thread, recently resurrected, gives a decent overview of some of the other options. I call wxWidgets a good choice because it is mature and compiles on top of the native GUI API to create native "widgets", rather than drawing its own. However, other options do exist.

https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

DarkDepths

  • Guest
Re: Designing GUI's?
« Reply #7 on: April 18, 2007, 04:45:02 pm »
First, thank you for you're replies. I looked at wxPack but as you mentioned, its about 240mb. I just spent the last three nights downloading a file only 50mb large!

Also, about the Hard Drive issue. I am going to look into a removable one. And just BTW, I live in Canada! I can always try compiling wxWidgets first, but, as I am pretty sure I mentioned, I have been unable to install MinGW, so I think it  might be pretty hard...

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Designing GUI's?
« Reply #8 on: April 18, 2007, 10:41:31 pm »
... I have been unable to install MinGW, ...
You did mention that, but did not elaborate on why that was so. Really, the hardest part is determining what you need to download, and then finding it on the MinGW download page (not exactly a picnic for the non-Unix-hacker type).
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline Vampyre_Dark

  • Regular
  • ***
  • Posts: 255
  • Hello!
    • Somewhere Over The Rainbow...
Re: Designing GUI's?
« Reply #9 on: April 18, 2007, 10:59:44 pm »
Windows GUI programming is not that hard once you get the hang of it. You just have to learn how it works. Every widget is a window that gets it's own procedure, which is basically a big switch statement that reacts to different messages that are sent to it.

You can get a free resource editor here: http://www.radasm.com/projects/projects.html Look for the file called ResEd.

The MSDN library is where you will get all your Win32 GUI info.

Clicky

WinProg.org has some simple Windows tutorials.

Go to your library, and borrow a copy of "Programing Windows xx by Charles Petzold". This will explain everything better, and it will all make sense.
C::B Wishlist
~BOYCOTT THE EVIL YELLOW BOXES~

DarkDepths

  • Guest
Re: Designing GUI's?
« Reply #10 on: April 19, 2007, 05:57:10 am »
Perhaps then, I shall look at resed. I have a basic understanding of win32 API, but I never really got too far with it!

 Actually, the reason I couldn't install MinGW was because I downloaded to D:, which then formatted and I decided I didn't want to wait that long again for it.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Designing GUI's?
« Reply #11 on: April 19, 2007, 08:16:02 am »
However, every time I open and build my GUI project, it also recompiles wxWidgets, so that sucks too.

There is some problem in your project settings. Otherwise why it would recompile wx??? :shock:

... I have been unable to install MinGW, so I think it  might be pretty hard...

No, it's absolutely simple. Download the following files.

Extract them to C:\MinGW folder and add C:\MinGW to PATH. Your MinGW installation is ready to use. :)
Be a part of the solution, not a part of the problem.

wxLearner

  • Guest
Re: Designing GUI's?
« Reply #12 on: April 19, 2007, 09:39:58 am »
Downloading the GNU debugger is recommendable also:

DarkDepths

  • Guest
Re: Designing GUI's?
« Reply #13 on: April 19, 2007, 04:06:16 pm »
Thanks guys, I will try it out when I get some time!

DarkDepths

  • Guest
Re: Designing GUI's?
« Reply #14 on: April 25, 2007, 03:21:44 am »
So I was playing around and came up with a bit of an idea for just a small application that I could make... just so I can say I made something! The problem is that what I want to make involves something that I have no clue about. If you go to your task manager and go to processes, you will see four headers "Image name, user name, cpu, and memory," I think. I cannot figure out how to group these together so that as one is scaled, the one right beside it is as well.

I think maybe this is not the best place to ask, but I decided to ask anyways.