Own drag icon with same color and font settings as the default drag icon in a Gtk.TreeView

2018-09-14 Thread c.buhtz--- via gtk-app-devel-list
I have a stackoverflow question with example code open with this: https://stackoverflow.com/q/52339893/4865723 The Gtk.TreeView implements a default drag icon. It use the background color of the TreeView, it's font and the complete row-content as string. I want the same (background-color,

PyGObject: ask for system/theme colors

2018-09-14 Thread c.buhtz--- via gtk-app-devel-list
I don't want to use colors defined by myself e.g. with RGB-values. I want to use colors from the system (Windows, Linux, ...) and/or the theme. For example I need the background color of a highlighted menu or list item. Is there a way? Can I also ask for fonts like this?

Re: Cancel a Drag & Drop for some specific items in a Gtk.TreeView

2018-09-11 Thread c.buhtz--- via gtk-app-devel-list
On 2018-09-11 13:50 Yuri Khan wrote: > Reading the “GtkTreeView drag-and-drop”[1] page, I get the impression > that you’d need to implement a wrapper around GtkTreeStore, or > possibly a class derived from GtkTreeStore, that also overrides the > row_draggable method so that it returns False for

Re: "draw" icon with string

2018-09-10 Thread c.buhtz--- via gtk-app-devel-list
>     cr.set_source_rgb(0.0, 0.0, 0.0) >     cr.set_line_width(1) >     cr.rectangle(200/2-width/2, 200/2 - height/2, width, height) >         cr.stroke() > >         return surface > > win = MainWindow() > win.connect("delete-event", Gtk.

Cancel a Drag & Drop for some specific items in a Gtk.TreeView

2018-09-10 Thread c.buhtz--- via gtk-app-devel-list
I also opened this question on https://stackoverflow.com/q/51974845/4865723 I have a Gtk.TreeView here. Most but not all of the items should be able to be dragged & dropped. For example the first item should not be able to be dragged & dropped but it should be selectable. How can I realize this?

Re: "draw" icon with string

2018-09-10 Thread c.buhtz--- via gtk-app-devel-list
); > >   GtkWidget *grid = gtk_grid_new (); >   gtk_container_set_border_width (GTK_CONTAINER (grid), 10); >   gtk_grid_attach (GTK_GRID (grid), button1, 0, 0, 1, 1); > >   gtk_container_add (GTK_CONTAINER (window), grid); > >   gtk_widget_show_all (window); >   gtk_

Re: "draw" icon with string

2018-09-09 Thread c.buhtz--- via gtk-app-devel-list
On 2018-09-04 00:26 Emmanuele Bassi wrote: > this means you need to create a Cairo > surface and render on it using the Cairo API. It is unclear to me how to create a cairo.Surface instance. Also

Re: PyGObject: modify drag icon in TreeView

2018-09-09 Thread c.buhtz--- via gtk-app-devel-list
There is a problem with documentation. https://gitlab.gnome.org/GNOME/pygobject/issues/251 The answer can be found here. https://stackoverflow.com/a/52248549/4865723 ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org

Re: "draw" icon with string

2018-09-03 Thread c.buhtz--- via gtk-app-devel-list
of the second column/cell and not the complete row? On 2018-09-02 02:33 Emmanuele Bassi wrote: > On Sat, 1 Sep 2018 at 22:20, c.buhtz--- via gtk-app-devel-list < > gtk-app-devel-list@gnome.org> wrote: > > > I want to use my own drag-icon in a Gtk.TreeView where this is s

"draw" icon with string

2018-09-01 Thread c.buhtz--- via gtk-app-devel-list
I want to use my own drag-icon in a Gtk.TreeView where this is set as an instance of GdkPixbuf.Pixbuf. I can I create/draw a pixbuf and create Text, background and border color in it? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org

Re: PyGObject: modify drag icon in TreeView

2018-08-28 Thread c.buhtz--- via gtk-app-devel-list
On 2018-08-22 23:17 wrote: > I opened a stackoverflow question with a MWE for this > > https://stackoverflow.com/q/51975256/4865723 There is still no answer. Does anyone of you have a hint where I could ask such questions, too? ___ gtk-app-devel-list

PyGObject: Cancel a Drag & Drop in Gtk.TreeView

2018-08-22 Thread c.buhtz--- via gtk-app-devel-list
Here on stackoverflow I am asking how do I cancel a Drag & Drop for some specific items in a Gtk.TreeView. https://stackoverflow.com/q/51974845/4865723 ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org

Re: PyGObject: modify drag icon in TreeView

2018-08-16 Thread c.buhtz--- via gtk-app-devel-list
I can not find a "drag-begin" example on the internet. On 2018-08-14 00:02 "c.buhtz--- via gtk-app-devel-list" wrote: > I want to use the "drag-begin" event to show an individual drag-icon. > <https://lazka.github.io/pgi-docs/#Gtk-3.0/classes/Wi

PyGObject: modify drag icon in TreeView

2018-08-13 Thread c.buhtz--- via gtk-app-devel-list
I want to use the "drag-begin" event to show an individual drag-icon. But it has no effect in my Gtk.TreeView - I tested with connect() and connect_after() - the events are called (tested by

make Gtk.TreeViewColumn always visibel

2018-08-12 Thread c.buhtz--- via gtk-app-devel-list
I have a tree view with 3 columns. Sometimes the first column has a quite huge width what causes the right column (number 3) disapear. Is there a way to make such a column never disapear? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org

PyGObject: FileChooserDialog and transient parent

2018-08-12 Thread c.buhtz--- via gtk-app-devel-list
Below you see a minimal working example using Gtk.FileChooserNative as a file-open dialog. While running with Python 3.6.6 I recieve this warning message "GtkDialog mapped without a transient parent. This is discouraged." I understand the logic behind it but can not find a solution BECAUSE the

Re: [PyGObject] Drag & Drop in a TreeView

2018-07-28 Thread c.buhtz--- via gtk-app-devel-list
Dear Colomban, thanks for your great hint. > You get inserted/deleted signals for moved rows so you can know > when and how things changed if needed This signals are also emited when I manually insert and delete data in the model. How do I know if a insert/delete signal was caused by a drag and

Re: [PyGObject] Drag & Drop in a TreeView

2018-07-27 Thread c.buhtz--- via gtk-app-devel-list
Dear Reuben On 2018-07-23 08:03 Reuben Rissler wrote: > This is how I have done it in the past. Note, I do not proclaim > spectacular or Pythonic code, and would humbly accept any corrections > and/or better ways to accomplish this. It seems to me there should be > a way to let the TreeView do

Re: [PyGObject] Drag & Drop in a TreeView

2018-07-22 Thread c.buhtz--- via gtk-app-devel-list
I see attachments are removed This is the code #!/usr/bin/env python3 import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from gi.repository import Gdk class MainWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="TreeView Drag and Drop")

[PyGObject] Drag & Drop in a TreeView

2018-07-22 Thread c.buhtz--- via gtk-app-devel-list
I am totally confused about this topic. I think I miss some fundamental understanding on how PyGObject works here. I want to drag & drop items of one TreeView inside itself. Not other widgets or applications. I just want to drag item 2 and drop it between item 4 and 5. I found some resources

Re: clear() on TreeView causes select-events

2018-07-15 Thread c.buhtz--- via gtk-app-devel-list
Dear Reuben, thanks for your answer. > And after you study the MVC pattern, you will see why the whole > Treeview stack works the way it does. Google MVC and Gtk MVC. It is > worthwhile reading if you plan on constructing treeviews. It may not > make sense immediately, but eventually you may see

Re: clear() on TreeView causes select-events

2018-07-06 Thread c.buhtz--- via gtk-app-devel-list
Dear Reuben, thanks for your hint. On 2018-07-03 21:19 Reuben Rissler wrote: > I have had very similar experiences with liststore.clear() in > Python3.5 and Mint 18. To work around this I do: > > store = treeview.get_model() #may not be necessary in your code > treeview.set_model(None) >

clear() on TreeView causes select-events

2018-07-03 Thread c.buhtz--- via gtk-app-devel-list
Hello I observer an interesting behavior (PyGObject, Gtk3.0, Python3.6, Debian unstable with XFCE desktop): An item (row) in a TreeView is selected (highlighted). Then calling .clear() on the TreeView causes an select-event for each item (row) below that selected item (row). Am I right here?