Re: Help with Clutter::Scriptable
- From: Murray Cumming <murrayc murrayc com>
- To: Chris Kühl <blixtra gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: Help with Clutter::Scriptable
- Date: Sat, 26 Feb 2011 08:41:39 +0100
On Sat, 2011-02-26 at 02:14 +0100, Chris Kühl wrote:
> In case you haven't figured it out, here is some code that seems to work.
[snip]
Well done.
> // This must be called first to initialize type.
> Glib::RefPtr<MyRect> myRect = MyRect::create();
We really should find a way to avoid that.
[snip]
> // Get the stage by name, casting it to the correct C++-type.
> const Glib::RefPtr<Clutter::Stage> stage =
> Glib::RefPtr<Clutter::Stage>::cast_static(script->get_object("stage"));
A cast_dyanmic<>, with an if() check, would be generally safer. That's
what we generally use with Gtk::Builder::get_widget() too.
In fact, a get_object("stage", stage) method might be nicest, analogous
to Gtk::Builder::get_widget("widgetname", widget).
[snip]
--
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]