drawingarea

GTK# Widget in front of another widget

。_饼干妹妹 提交于 2019-12-11 14:46:33
问题 How to bring a widget to the front of another widget? I want to put the timeLeft Label in front of the box DrawingArea My Code : box.SetSizeRequest((int)Math.Floor(size*2.5), size); box.ExposeEvent += boxExpose; theMainWindow.winFix.Put(box, x, y); box.Show(); Pango.FontDescription fontdesc = Pango.FontDescription.FromString("Lucida Console " + (size - 6)); timeLeft.ModifyFont(fontdesc); timeLeft.SetSizeRequest((int)Math.Floor(size*2.5)-6, size-6); theMainWindow.winFix.Put(timeLeft, x+3, y+3)

Gtk.DrawingArea blank when attached to Gtk.Grid

Deadly 提交于 2019-12-11 09:11:30
问题 (This is my first post, sorry if I do something wrong...) I am writing a program in Vala with which one can design a classroom. I have decided to use GTK for the GUI (Vala integrates well with this), and Cairo to draw the classroom diagram (GTK comes with this by default). I have created a 'classroom' class (a subclass of Gtk.DrawingArea), which currently should just display a square: public class Classroom : DrawingArea { private delegate void DrawMethod(); public Classroom() { this.draw

Failing to draw on a Gtk.DrawingArea

ぃ、小莉子 提交于 2019-12-11 08:38:39
问题 I'm not able to draw, i've already read tutorials, i can't find the problem. I simply have a correct UI drawed by Glade. Then i want to draw, for example 50 drawing areas. So i create a Grid with 50 cells; for each cell there is a vertical box (with a drawing area and a label inside each one). But i can't seen anything drawed. class collega_GUI: def __init__(self): try: self.__builder = Gtk.Builder() self.__builder.add_from_file('UI2.glade') self.__Grid = Gtk.Grid() self.__Grid.set_margin

GTK drawable area transparent background color

陌路散爱 提交于 2019-12-08 10:43:59
问题 I have a GTK drawing area and I want to have an image display as the background for it, while other things can be drawn over it. My first attempt at this involved me simply taking the image, putting it into a pixmap, and drawing it before I draw other objects. This resulted in the objects backgrounds completely covering my background image. Now I am thinking I need to change the object's pixmap's gtk.gdk.GC so the background color it has is transparent. Here is where I am having problems. I