ecc (User)
Fresh Boarder
Posts: 7
|
|
Possible to add not tiled backgrounds? 7 Months, 2 Weeks ago
|
Karma: 1
|
|
Hi,
i´m adding a little skin option to into my tool. At this point, i´ve found no way to add an image to the background eg. right aligned no-repeat. Is this possible in php-gtk2? Have you done this allready?
Btw.. if i uses png-images as background, cmd crashes. If i use gif, all work fine! Do you know this problem. I´m on windows vista!
Regards,
Andreas
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
kksou (Admin)
Admin
Posts: 254
|
|
Re:Possible to add not tiled backgrounds? 7 Months, 2 Weeks ago
|
Karma: 7
|
|
Hi Andreas,
Are you adding the background image to GtkWindow? Or some other widgets?
Regards,
/kksou
|
|
|
|
|
|
|
Last Edit: 2008/01/23 01:56 By kksou.
|
|
|
The administrator has disabled public write access.
|
ecc (User)
Fresh Boarder
Posts: 7
|
|
Re:Possible to add not tiled backgrounds? 7 Months, 2 Weeks ago
|
Karma: 1
|
I´m adding the images to the GtkWindow and some GtkEventBox.
For both, i need this feature, if possible.
Here is an screenshot, where you can see, what i do on my application. The GtkEventBox is e.g. behind the top search area.

Fullscreen: http://www.camya.com/ecc/images/20080120_newbg1024.gif
Regards,
Andreas
|
|
|
|
|
|
|
Last Edit: 2008/01/23 06:37 By ecc.
|
|
|
The administrator has disabled public write access.
|
ecc (User)
Fresh Boarder
Posts: 7
|
|
Re:Possible to add not tiled backgrounds? 7 Months, 2 Weeks ago
|
Karma: 1
|
Ok, found an solution... but this isnt 100% :-(
| Code: | $pixbuf = GdkPixbuf::new_from_file('image.gif');
$gcObject = $gtkWindow->get_style()->black_gc; # get GdkGCWin32 object
$pixbuf->render_to_drawable($gtkWindow->window, $gcObject, 0, 0, 0, 0,
$pixbuf->get_height(), $pixbuf->get_width(), GDK_RGB_DITHER_NORMAL);
# $gtkWindow->window gets gdkWindow from gtkWindow |
I´m using glade for gui creation. So, the image is not show. If i add
| Code: | $gtkWindow->show(); |
i see the image a second, and than php crash :-) Maybe you have an idea.
Btw...
GdkPixbuf::render_to_drawable() is deprecated: use GdkDrawable::draw_pixbuf()
So, maybe we can try also draw_pixbuf for that!
|
|
|
|
|
|
|
Last Edit: 2008/01/23 23:23 By ecc.
|
|
|
The administrator has disabled public write access.
|
ecc (User)
Fresh Boarder
Posts: 7
|
|
Re:Possible to add not tiled backgrounds? 7 Months, 2 Weeks ago
|
Karma: 1
|
Ok, i think, this looks 100% valid and not deprecated... but... :-)
.. the image only flashes and than is invisible. How to make it sticky?
| Code: | $pixbuf = GdkPixbuf::new_from_file('image.gif');
$gcObject = $gtkWindow->get_style()->black_gc;
$gtkWindow->window->draw_pixbuf($gcObject, $pixbuf, 0, 0, 0, 0);
|
Regards,
Andreas
http://www.camya.com/
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
ecc (User)
Fresh Boarder
Posts: 7
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
kksou (Admin)
Admin
Posts: 254
|
|
Re:Possible to add not tiled backgrounds? 7 Months, 2 Weeks ago
|
Karma: 7
|
|
Hi Andreas,
I've a couple of possible solutions. One of them is similar to what you have described above, i.e. using GdkDrawable::draw_pixbuf().
Before I come out with sample codes for this, could you please let me know a bit more of what you have in mind:
1) I saw the screen of your application. (Very nice, indeed!) So, you want to have some untiled background image in the search area of your application? It already looked quite crowded. So where do you intend to put this background image?
2) Do you want to align the image to the left, right, top or bottom of that GtkEventBox?
3) Does the size of the search area (where you want to put the background image) changes when the user stretch the window to a different size? Or does the size of that area remain fix?
Regards,
/kksou
|
|
|
|
|
|
|
Last Edit: 2008/01/24 01:32 By kksou.
|
|
|
The administrator has disabled public write access.
|
ecc (User)
Fresh Boarder
Posts: 7
|
|
Re:Possible to add not tiled backgrounds? 7 Months, 2 Weeks ago
|
Karma: 1
|
|
Hi kksou,
1. The users can simply create own themes by changing some images. So my plan is to give them the ablity to add an background for the gtkWindow and and the the left (navigation) and right pane (details). (maybe also some other widgets). Also the search area background is skinable. (ok, if i say skinable, i only mean background change)
2. That is the plan :-) If this is possible, this could be great.
3. Yes, the area changes to different size.
Regards,
Andreas
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
kksou (Admin)
Admin
Posts: 254
|
|
|
|
|
|
|
Last Edit: 2008/01/24 15:18 By kksou.
|
|
|
The administrator has disabled public write access.
|
ecc (User)
Fresh Boarder
Posts: 7
|
|
Re:Possible to add not tiled backgrounds? 7 Months, 1 Week ago
|
Karma: 1
|
|
Hi,
your examples work very good for the window. Good work. Thank you. I think, i will implement this feature soon.
Now the eventboxes :-) It seams, that there is an problem with the default background and png alpha. If the eventbox has an "visible window", the assigned background png with alpha is shown. But because of the "visible window", you cant look through the png image. You only see the eventbox background (grey box by default). Have you an idea how to asign png with alpha transperency to an eventbox without "visible window" so you can see the window background trought the png?
Thank you for you great research!
Andreas
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
|