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?

Re: Link Gtk.ListStore to the real data

2018-06-02 Thread c.buhtz
On 2018-06-02 20:07 '-' wrote: > Can you make the data_list a field on your class? It's a list > with indices, right? Then, on the iter you get from your selection, > use gtk_tree_model_get_path and gtk_tree_path_get_indices. Finally > get the item from your data_list by that index. You mean e.

Re: Link Gtk.ListStore to the real data

2018-06-02 Thread c.buhtz
Does no one has an idea? Am I the only one facing such problems? https://stackoverflow.com/q/50643938/4865723 On 2018-05-31 23:59 wrote: > I am looking for an elegant and pythonic way to connect the model of a > Gtk.ListStore (the content container for a Gtk.TreeView) to the real > data. > >

Link Gtk.ListStore to the real data

2018-05-31 Thread c.buhtz
I am looking for an elegant and pythonic way to connect the model of a Gtk.ListStore (the content container for a Gtk.TreeView) to the real data. Thinking the C-way I would store a pointer as a hidden column linking to the data structure in each entry of Gtk.ListStore. But I don't see a way to do

Re: PyGObject Maybe bug with alternate row colors in a Gt.TreeView

2018-05-15 Thread c.buhtz
Thank you for the link. On 2018-05-15 15:01 Emmanuele Bassi wrote: > - the CSS "regions" were problematic for the whole theming system, > so they were removed before we made the CSS selectors stable > - GtkTreeView does not use widgets, so CSS selectors do not > typically

Re: PyGObject Maybe bug with alternate row colors in a Gt.TreeView

2018-05-15 Thread c.buhtz
Does know one of you have an idea about it or more detailed informations. I also don't know if it is a bug or if I am doing something wrong. My problem is I don't know to much about CSS. On 2018-05-11 22:57 wrote: > Please see this StackOverflow question. >

PyGObject Maybe bug with alternate row colors in a Gt.TreeView

2018-05-11 Thread c.buhtz
Please see this StackOverflow question. https://stackoverflow.com/q/50281987/4865723 Is there an official bug about setup alternate (even & odd) row colors with CSS in a Gtk.TreeView? Can someone give a link to the bug ticket? ___ gtk-app-devel-list

Re: PyGObject: cell_data_func or own Renderer for date column?

2018-05-11 Thread c.buhtz
>     do_render(self, cr, widget, bg_area, cell_area, flags): >     # implement your own rendering here How do I "render"? I have no idea about it. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org

Re: PyGObject: Which types accepted in a Gtk.ListStore

2018-05-11 Thread c.buhtz
> However, if I remember correctly, in the bindings several native > python types like int, float and str are mapped to GObject types > automatically. What exactly is "mapped" to GObject here? ___ gtk-app-devel-list mailing list

PyGObject: remove a renderer from a TreeViewColumn

2018-05-10 Thread c.buhtz
I add multiple Gtk.CellRenderer to one Gtk.TreeViewColumn with its pack_start() method. But how can I remove one of the renderers? Currently I do Gtk.TreeViewColumn.clear() and rebuild the column again with all renderers except the one I want to be removed. But this is a workaround.

PyGObject: cell_data_func or own Renderer for date column?

2018-05-09 Thread c.buhtz
I want to have a date column in a Gtk.ListView. The field in the model is a real "datetime.date". Based on that the content of the column could display this: "2018-05-07" "2 days ago" "this week" "7th May" "7. Mai '18" This is all based on the same "datetime.date" instance. The user

PyGObject: Which types accepted in a Gtk.ListStore

2018-05-09 Thread c.buhtz
>From the api-reference here it is unclear for me what types are accepted for the columns. The parameter "*column_types" is not explained. ___ gtk-app-devel-list mailing

Re: PyGObject: Spinner as content of a TreeView cell

2018-05-09 Thread c.buhtz
On 2018-05-09 22:52 wrote: > Does anyone see a way to draw/insert a Gtk.Spinner (or any other > Gtk.Widget) in a cell of a Gtk.TreeView? Oh, there is a CellRendererSpinner for it! :) An example can be found here

PyGObject: Spinner as content of a TreeView cell

2018-05-09 Thread c.buhtz
Does anyone see a way to draw/insert a Gtk.Spinner (or any other Gtk.Widget) in a cell of a Gtk.TreeView? I want to use a Spinner to indicate to the user that currently there is work (e. g. ongoing download) or activity with a specific item. ___

Re: [PyGObject] TreeView: Empty integer field or right aligned string

2018-05-08 Thread c.buhtz
On 2018-05-08 14:20 Luca Bacci wrote: >- Use Cell Data Func for ultimate flexibility That is the signature Gtk.TreeCellDataFunc(tree_column, cell, tree_model, iter, data) But how do I know which cell (row and column) is affected? I can extrat the row with

[PyGObject] TreeView: Empty integer field or right aligned string

2018-05-06 Thread c.buhtz
X-Post: https://stackoverflow.com/q/50194505/4865723 I want to have in a Gtk.TreeView - empty cells in a "int row" of a TreeView - or (as a workaround) a right aligned "string row" There is a screenshot and example code in the StackOverflow question linked in the first line of this

Re: Using Gtk.Builder to create a menubar.

2018-04-26 Thread c.buhtz
On 2018-04-26 18:10 Luca Bacci wrote: > Hi, I did test it out, here's a working version: I used your code to create an answer to my StackOverflow question https://stackoverflow.com/a/50051155/4865723 ___ gtk-app-devel-list

Re: Using Gtk.Builder to create a menubar.

2018-04-26 Thread c.buhtz
Thank you very much. Your example works for me but I don't understand why. ;) > win.bar > action_bar = Gio.SimpleAction.new('bar', None) The name of the action in the XML and the code is different. Why? What is the system behind it?

Re: Using Gtk.Builder to create a menubar.

2018-04-25 Thread c.buhtz
Dear Eric, thank you for your quick reply. > There is a basic setup for the Gtk Application in Python here > https://developer.gnome.org/gnome-devel-demos/stable/hello-world.py.html.en Nice to know. Very helpful. > For C you can check >

Using Gtk.Builder to create a menubar.

2018-04-25 Thread c.buhtz
X-Post: I was redirected from https://mail.gnome.org/archives/python-hackers-list/2018-April/msg4.html to here. I try to use Gtk.Builder to create a menubar. It is not working because the documentation is not clear for me. There is no exmple for a IMO usual thing like a menubar. To improve