Pregunta

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?

¿Fue útil?

Solución

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.

Otros consejos

Try gtk_widget_get_allocation().

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top