Re: [gtkmm] ImageLoader
- From: Claude Vaillancourt <clauva videotron ca>
- To: Gtkmm list <gtkmm-list gnome org>
- Subject: Re: [gtkmm] ImageLoader
- Date: Wed, 25 Dec 2002 21:31:33 -0500
On Wed, 2002-12-25 at 20:11, Mortella wrote:
> >
> > >
> >
> > Take a look at Gdk::Pixmap::create_from_xpm() family of methods.
> >
>
> yep...i know that function for a long long time but...
>
> Why it doesnt fits:
> Gdk::Pixmap *pmap = create_from_xpm(NULL,NULL,etc, filename);
> //former (gtk 1.2 ) NULLs were allowed to sign 'dont care' or default ...
> (Do you mind to write a simple example pls. )
>
Assuming you're inside a Gtk::Widget derived class
(from the wheelbarrow.cc example in the gtkmm/examples/window directory)
{
const std::string &fname = "picture.xpm";
const Glib::RefPtr<const Gdk::Drawable> drawable = get_window();
const Gdk::Color transparent =
Gtk::Widget::get_default_style()->get_bg(Gtk::STATE_NORMAL);
Glib::RefPtr<Gdk::Bitmap> mask;
const Glib::RefPtr<Gdk::Pixmap> pixmap =
Gdk::Pixmap::create_from_xpm(drawable, mask, transparent, fname);
}
> Other question: it always waits const std:string& does this mean I can not dynamically set a file's name ?
> Am not totally lamer just new in gtkmm.
>
You can certainly pass a regular std::string, this 'const' only means
that the method will not modify it.
> thx
> morti
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]