How do you rotate the gtk widget?

Let's say that the widget is a VBox containing a label and two buttons.

In addition, suppose that the desired degree of rotation is 90 °.

How can it be rotated? I don't think this is possible by default, but I think it is possible.

However, I have no idea how to start. Am I writing my own widget? What am I doing subclass?

+3
source share
3 answers

You can fake it like this:

label.set_angle(90)
button1.get_child().set_angle(90) # assuming it not a stock button
button2.get_child().set_angle(90)
vbox.set_orientation(gtk.ORIENTATION_HORIZONTAL)
+8
source

First, if your widget does not have its own X window (VBox does not), place it inside the EventBox.

-, , X , X-, X Xlib . , , .

... , . GTK Cairo , , ... .

0

Source: https://habr.com/ru/post/1734795/


All Articles