|
Sample Code 419: How to place a background image in GtkWindow - Part 4 - align bottom right - using GtkStyle? |
| Written by kksou | ||||||||
| Thursday, 24 January 2008 | ||||||||
|
Problem Suppose you want to have a single background image at the bottom right corner of a GtkWindow as shown below.
Solution
Sample Code Note: The following image file (sample6_1920_bottom_right.png) is required by the sample code below. Please save a copy of the image files and put them in the same directory where you store the sample code.
Explanation The sample code above is exactly the same as that of the article How to place a background image in GtkWindow - Part 2 - tiled background image? (The only diffference is the background image.) Pleaes refer to the article for explanations. Note
Try changing the window size. Notice that the background image stays at the same old place and does not 'stick' to the bottom right corner of the window as shown below:
So this method is only suitable if you know that your user will not change the window size, or you always run your application in full-screen mode. To make the background image stays at the bottom right corner of the window (no matter how the user changes the window size), please refer to the solution presented in How to place a background image in GtkWindow - Part 6 - align bottom right - GdkDrawable draw_pixbuf? Related Links
User reviews There are no user reviews yet. Note: You have to be a registered member to leave a comment. Free registration here. |
||||||||
| < Prev | Next > |
|---|








