Semi-Transparent Window-Background with Gtk(mm) and Cairo



Hi!
I am trying to get a semi-transparent (not fully transparent and not fully
white/grey/etc) window background using this as a structure:

# Gtk::Window
      -> Gtk::Fixed
                -> several buttons

what i am doing atm is setting the app_paintable (
window->set_app_paintable(true); ) flag and drawing to the
window/fixed-layout background before calling present() on it


   1. cairo_t *cr = gdk_cairo_create(fix->get_window()->gobj());
   2.
   3. cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.4); /* transparent */
   4. cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
   5. cairo_paint (cr);
   6. cairo_destroy(cr);


this code doesnt give me any visual change (also tried with changed the
layout variable (fix) to the window variable => also doesnt work)

any idea how i can fix that?

gtk version is gtkmm-3.0


-------------------------
Patrick Bichler



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