Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions

  




 

 

Gtk+/Gnome Application Development
Prev Home Next

Finishing Touches

Really polished application windows behave well on small screens, and set hints so the window manager can keep track of them.

Adapting to Screen Size

The functions in Figure 12 allow you to query the size of the screen in pixels. You can use this information to adjust the layout of your application window; for example, if you know your usual application window is too large for a 640 by 480 display, you could provide an alternative widget layout for small screens. Applications that automatically adapt to the screen size are very impressive.

Of course, you should leave control in the hands of the user; users with large screens might want the small version of your application anyway, and you should always try to respond sensibly if the user resizes the window. Use the screen size to select the best default from among your application's possible configurations.

#include <gdk/gdk.h>

gint gdk_screen_width(void);

gint gdk_screen_height(void);

Figure 12. Querying Screen Size

Gtk+/Gnome Application Development
Prev Home Next

 
 
  Published under free license. Design by Interspire