Re: Removing Drag and Drop formatting of drop area in Python/GTK3
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 Grabowskiwrote: > 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 > ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How ot remove the minimize and maximize button of GtkWindow
On Fri, 2014-02-21 at 09:18 +0100, David Nečas wrote: On Fri, Feb 21, 2014 at 03:29:07PM +0800, Wiky wrote: The default GtkWindow has a minimize , a maximize and a close button in the right or left top coner. But I want a window which only has a close button. How can I remove the minimize and maximize button? You can't. In my window manager the windows may have a completely different set of buttons. Or no title bar at all. Or whatever. And the window manager has the last word. You can override the decoration-button-layout style property, but you need 3.10+ and it will only work in something like GNOME 3 anyway. The meaningful thing you can do is setting the window type hint with gdk_window_get_type_hint() (and possibly other hints) to specify what the window *is* instead, and let the window manager treat it appropriately and consistently with other widows with the same role. Yeti Alternatively, you could create a GtkBox that contains a close GtkButton and a centred GtkLabel as the title, set it as the titlebar with gtk_window_set_titlebar(), then connect clicked to gtk_main_quit() or something, though its a very hacky solution, and IDK if it will handle dragging the window with the mouse. -- Marco Scannadinari m...@scannadinari.co.uk ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How to locate the 'Gtk-WARNING' line number
On Mon, 2014-02-17 at 16:44 +0800, Wiky wrote: Hi,all. I'm currently writing a program based Gtk+-3.0. When it runs, I get '(a.out:10874): Gtk-WARNING **: Failed to ...' in the terminal. I know the problem is about GtkLabel, but I really don't know which GtkLabel. Is there a way to locate the line numer that give the warning? Sorry for my english ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list If your UI is hand-coded, and in main() (not using GtkApplication), then I suppose you can run it through gdb and step through each line to see where it prints the error. Be sure to compile with -Og -g and without optimisations though -- Marco Scannadinari m...@scannadinari.co.uk ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list