Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » GTK+
  • » Displaying a pixmap as background of any control. [RSS Feed]

#1 Nov. 28, 2005 15:51:45

ahmad h.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Displaying a pixmap as background of any control.


Hi,I want to display a pixmap as a background of any control or container. Andon top of that container(hbox, vbox etc) i would have any controls.How can i achieve that using gtk+ c source code

One thing more i want the image to resize(scale) when the window is resized.

Any help would be greatly appreciated.

Thank you.

_________________________________________________________________Express yourself instantly with MSN Messenger! Download today it's FREE!http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

#2 Nov. 28, 2005 18:14:01

Jochen B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Displaying a pixmap as background of any control.


ahmad hassan wrote:Hi,I want to display a pixmap as a background of any control orcontainer. And on top of that container(hbox, vbox etc) i would haveany controls.How can i achieve that using gtk+ c source codeOne thing more i want the image to resize(scale) when the window isresized.Any help would be greatly appreciated.

Thank you.hi,

you can play with:

void
set_background (GtkWidget *widget, GdkPixmap *pixmap)
{
GtkRcStyle *rc_style;
GtkStyle *style;

style = gtk_style_copy (widget->style);
if (style->bg_pixmap)
g_object_unref (style->bg_pixmap);
style->bg_pixmap = g_object_ref (pixmap);
gtk_widget_set_style (widget, style);
g_object_unref (style);
}(hbox, vbox will probably not work, us the widget direct instead, or theparent widget)if nothing happens take look on this bug:http://bugzilla.gnome.org/show_bug.cgi?id=318074cu jochen






_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

  • Root
  • » GTK+
  • » Displaying a pixmap as background of any control. [RSS Feed]

Board footer

Moderator control

Enjoy the 23rd of April
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support