Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-01-2008, 11:01 PM   PM User | #1
flynch01
Regular Coder

 
Join Date: Mar 2007
Location: England
Posts: 357
Thanks: 46
Thanked 22 Times in 21 Posts
flynch01 is on a distinguished road
Lightbulb Graphical User Interfaces

Google hasn't been very handy, and searching here didn't find anything related to what I was looking for.

I'm looking to find out how GUI's generally work. I don't mean message loops, calls and such. I mean literally, what steps are taken to draw them. It's just something I want to learn about. Just to clarify, I want to know what for example happens when you do CreateWindow, how buttons are drawn. Not the EXACT workings, like how it's done. But more like /what/ is done. Like, once the call is done the X is asked to do X, X then passes this X on. Etc

Sorry if I'm being vague or demanding
flynch01 is offline   Reply With Quote
Old 10-01-2008, 11:25 PM   PM User | #2
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,043
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
Well it depends on the platform, are you wanting to know about how it works on Win32?
__________________
OracleGuy
oracleguy is offline   Reply With Quote
Old 10-01-2008, 11:34 PM   PM User | #3
flynch01
Regular Coder

 
Join Date: Mar 2007
Location: England
Posts: 357
Thanks: 46
Thanked 22 Times in 21 Posts
flynch01 is on a distinguished road
Anywhere to start would do fine. But surely the way in which a GUI is drawn isn't specific to windows. I mean, engines for example. They follow the same idea. They may use different methods but they all compress and ignite petrol.
flynch01 is offline   Reply With Quote
Old 10-01-2008, 11:36 PM   PM User | #4
primefalcon
Regular Coder

 
primefalcon's Avatar
 
Join Date: Aug 2008
Location: /home/primefalcon/
Posts: 679
Thanks: 8
Thanked 39 Times in 39 Posts
primefalcon is an unknown quantity at this point
wxwidgets is pretty good for making true cross plateform gui's
primefalcon is offline   Reply With Quote
Old 10-01-2008, 11:58 PM   PM User | #5
flynch01
Regular Coder

 
Join Date: Mar 2007
Location: England
Posts: 357
Thanks: 46
Thanked 22 Times in 21 Posts
flynch01 is on a distinguished road
Appreciate the reply prime, wxwidgets GTK QT etc, I'm not looking for something to use. I'm looking to learn the idea of how GUI in general works.

Edit: (Sorry) Not loops and such, but I mean. The actual graphical drawing part, what is done to achieve it. Pixel by pixel from what? Etc.
flynch01 is offline   Reply With Quote
Old 10-02-2008, 12:22 AM   PM User | #6
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
Quote:
Originally Posted by flynch01 View Post
Appreciate the reply prime, wxwidgets GTK QT etc, I'm not looking for something to use. I'm looking to learn the idea of how GUI in general works.

Edit: (Sorry) Not loops and such, but I mean. The actual graphical drawing part, what is done to achieve it. Pixel by pixel from what? Etc.
probably that was the idea, to get the source for wxwidgets or else and look inside,
From my point of view the best way is to find a book about xlib, tcl/tk or msn visual studio.
tcl/tk could be strange and probably very hard to understand at first step, so is probably ok to avoid it but in my opinion is the best way to do such things.

best regards
oesxyl is offline   Reply With Quote
Users who have thanked oesxyl for this post:
flynch01 (10-02-2008)
Old 10-02-2008, 12:59 AM   PM User | #7
flynch01
Regular Coder

 
Join Date: Mar 2007
Location: England
Posts: 357
Thanks: 46
Thanked 22 Times in 21 Posts
flynch01 is on a distinguished road
Thanks. Xlib is as good an answer as I could ask for. Will get a book on it. Already tried looking in the source of wxwidgets by the way. And I'm sorry but I'm not going through 700 files rofl. I just wanted to know the basic idea of it. Not the exact way.

Thanks man.
flynch01 is offline   Reply With Quote
Old 10-02-2008, 01:03 AM   PM User | #8
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
Quote:
Originally Posted by flynch01 View Post
Thanks. Xlib is as good an answer as I could ask for. Will get a book on it. Already tried looking in the source of wxwidgets by the way. And I'm sorry but I'm not going through 700 files rofl. I just wanted to know the basic idea of it. Not the exact way.

Thanks man.
I hope this is ok:

http://2020ok.com/books/80/xlib-prog...nual-20980.htm

best regards
oesxyl is offline   Reply With Quote
Users who have thanked oesxyl for this post:
flynch01 (10-02-2008)
Old 10-02-2008, 03:14 AM   PM User | #9
flynch01
Regular Coder

 
Join Date: Mar 2007
Location: England
Posts: 357
Thanks: 46
Thanked 22 Times in 21 Posts
flynch01 is on a distinguished road
Thanks a bunch!
flynch01 is offline   Reply With Quote
Old 10-02-2008, 04:16 AM   PM User | #10
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,043
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
Quote:
Originally Posted by flynch01 View Post
Anywhere to start would do fine. But surely the way in which a GUI is drawn isn't specific to windows. I mean, engines for example. They follow the same idea. They may use different methods but they all compress and ignite petrol.
That analogy isn't really applicable. At a more low level hardware level, yes they all work they same in the sense that they draw pixels to the screen. At a more functional level different platforms handle managing windows differently. Even within Windows now Vista's Aero has changed some of the rules on how GUIs work in the Windows.

Previously in Windows if a window is off the screen or being partially or completely covered by another window, the window area not visible isn't stored in memory. When the area comes back into view the OS sends a WM_PAINT message to the window with the region of the window that needs to be drawn.

However in Vista to implement alt tabbing where you can see what each window looks like or that fancy different windows-tab key combination (I think that's it) where it cycles through all the windows with a bunch of flare; all the windows need to keep the data representing the window in memory. I've actually played around with this. WM_PAINT messages that normally would have been generated aren't because the OS still keeps the entire window in memory even when it can't be seen.

There is a Microsoft utility called Spy++ that lets you watch all the messages being sent to a specific window that is open.
__________________
OracleGuy
oracleguy is offline   Reply With Quote
Old 10-02-2008, 05:11 AM   PM User | #11
flynch01
Regular Coder

 
Join Date: Mar 2007
Location: England
Posts: 357
Thanks: 46
Thanked 22 Times in 21 Posts
flynch01 is on a distinguished road
Quote:
At a more low level hardware level, yes they all work they same in the sense that they draw pixels to the screen.
This is what I wanted to know though. How it decides what pixels to draw to the screen. And how the pixels are 'decided', generated from image files, from maps of pixels, from sprites, how certain sections are decided. Etc etc. But I'm guessing that's exactly what reading about Xlib is going to tell me. I already understand the basic idea of how they work in a higher level. Receiving messages and constantly looping and performing actions based on the messages.

Last edited by flynch01; 10-02-2008 at 05:14 AM..
flynch01 is offline   Reply With Quote
Reply

Bookmarks

Tags
directx, graphical user interface, gui, windows

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:38 PM.


Advertisement
Log in to turn off these ads.