Re: Removing Drag and Drop formatting of drop area in Python/GTK3
- From: Marco Scannadinari <m scannadinari co uk>
- To: Lukasz Grabowski <graboluk gmail com>, gtk-app-devel-list gnome org
- Subject: Re: Removing Drag and Drop formatting of drop area in Python/GTK3
- Date: Mon, 19 Oct 2015 13:06:42 +0000
border-width=0px;
This should be a colon not an equals sign
style_provider.load_from_data(bytes(css.encode()))
.encode already returns a bytes object in Python 3, what version are you
using?
On Mon, 19 Oct 2015 13:09 Lukasz Grabowski <graboluk gmail com> wrote:
When implementing drag and drop in Python and GTK3 the default
behaviour is that if I drag something towards the drop area, then the
drop area obtains a rectangular black frame. How to remove this
effect?
As per gtk3 docs, there is a style class GTK-STYLE-CLASS-DND 'dnd', so
I would think that adding
----
style_provider = Gtk.CssProvider()
css="""
.dnd {
border-width=0px;
}"""
style_provider.load_from_data(bytes(css.encode()))
Gtk.StyleContext.add_provider_for_screen(
Gdk.Screen.get_default(),
style_provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION )
----
or similar to the program should do the trick. But I had no luck with
it. I kept changing other properties within the .dnd block to see if
it has any effect at all but it doesn't (otherwise CSS works fine,
e.g. if I change .dnd to :hover then the effect is as expected).
Best, Lukasz
P.S. Just in case I'm using a wrong tool: I'm trying to implement
selecting several widgets ("calendar cells") in a Gtk.Grid via draging
the mouse across them, similar to google calendar. I'd like to have
the same formatting of all cells which are being selected (which is
why I don't want any special dnd formatting on the last cell)
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]