1

I'm using Clutter to compose an interactive/animate UI.
I'm using two box containers (ClutterBox) with an integrated FixedLayout, and I want to be able to rearrange those boxes onto screen using an hard-coded layout during (gtk-)window resizing. Searching in some gtk3 examples, I find out this can be achieved connecting the signal "size-allocate" of the GtkWindow.
What I still unable to accomplish is to get width and height of the Embed ClutterStage.

I used gtk_widget_get_preferred_size passing the ClutterStage widget, but it gives back to me only the preferred size, and not the current, resized value.

Does anyone have a clue?

Archedius
  • 2,887
  • 3
  • 20
  • 24

2 Answers2

2

Try gtk_widget_get_allocation().

ptomato
  • 56,175
  • 13
  • 112
  • 165
2

calling clutter_actor_get_size() on the stage returned by a GtkClutterEmbed widget is enough to get the size of the stage: the GtkClutterEmbed widget that owns the embedded stage resizes the stage every time GTK+ negotiates the geometry of the widgets of a window.

you can also use a ClutterBindConstraint object to bind the size of an actor to the size of the stage, or a ClutterSnapConstraint or a ClutterAlignConstraint objects to resize or align actors to the stage.

ebassi
  • 8,648
  • 27
  • 29