Re: [Vala] Getting semi-transparent window



This makes transparent window...

    // Application window
    [GtkTemplate(ui = "/example_prj/window.glade")]
    public class ApplicationWindow : Gtk.ApplicationWindow
    {
        public ApplicationWindow(Gtk.Application application)
        {
            Object(application: application);
set_visual(Gdk.Screen.get_default().get_rgba_visual());
            app_paintable = true;
        }

        public override bool draw (Cairo.Context cr)
        {
            cr.set_source_rgb (0, 0, 0);
            cr.paint_with_alpha (0.5);
            return base.draw(cr);
        }
    }


Am 08.04.19 um 19:16 schrieb Wolfgang Mauer:
Maybe something more like this...
https://wiki.gnome.org/Projects/Vala/CairoSample


Am 08.04.19 um 17:51 schrieb wolfgang mauer kabelmail de:
Welcome...

Well of corse I use valaDevelop...
I'm not shure if i understand, but maybe Window.Opacity is what's youre looking for...

Nice Day
Wolfgang


Von: Mark Messer via vala-list <vala-list gnome org>
Gesendet: 08.04.2019 13:09
An: <vala-list gnome org>
Betreff: [Vala] Getting semi-transparent window
Hi All,

My question is maybe a trivial one, but two days ago I knew nothing about Vala. I found it pretty useful though and easy to understand (I wrote for Gtk in C and Python, I have some experience with Cpp and C#). All in all -
I actually like it.
But to the point. I started from getting GtkBuilder as it provides an
automated (semi) build chain on meson. It imposes a certain structure of
projects, with main application loop separated and the rest in a namespace.
So far so good. As I last wrote something for Gtk some time ago I had to
switch from colormap to visual when it comes to transparency. But with
namespace and a little odd main loop devoid of any control common with
standard approach I have no idea where should I (and whether should I) put
Cairo on repaint.
Are there any resources or examples aimed at semi-transparent main windows?
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list

_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list

_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]