Re: "draw" icon with string

2018-09-01 Thread Emmanuele Bassi via gtk-app-devel-list
On Sun, 2 Sep 2018 at 02:02, Chris Moller  wrote:

> You probably can't do that--GTK has gotten just about impossible to
> customise--but if you can do it at all, you'll probably have to use CSS.
>

Please, avoid this kind of unhelpful reply in the future.

Ciao,
 Emmanuele.

On 01/09/18 17:20, c.buhtz--- via gtk-app-devel-list wrote:
> > 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
> > 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
>


-- 
https://www.bassi.io
[@] ebassi [@gmail.com]
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: "draw" icon with string

2018-09-01 Thread Emmanuele Bassi via gtk-app-devel-list
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 set as
> an instance of GdkPixbuf.Pixbuf.
>
> I can I create/draw a pixbuf and create Text, background and border
> color in it?
>

Typically, GtkTreeView will call gtk_tree_view_create_row_drag_icon() for
the default drag surface — a box with the contents of the row.

https://developer.gnome.org/gtk3/stable/GtkTreeView.html#gtk-tree-view-create-row-drag-icon

If you want to override that, you should call gtk_drag_set_icon_surface(),
using a Cairo surface you created:

https://developer.gnome.org/gtk3/stable/gtk3-Drag-and-Drop.html#gtk-drag-set-icon-surface

The GtkTreeView uses the default handler of the GtkWidget::drag-begin
signal to set the drag icon; you want your own handler to be called after
that, so you can override the drag icon with your own. To do that, you can:

 - call gtk_tree_view_unset_model_drag_source() or
gtk_tree_view_unset_model_drag_dest() and implement your own drag and drop
handling
 - call g_signal_stop_emission_by_name() in your drag-begin callback to
stop the signal emission chain, and prevent the default handler from running
 - use g_signal_connect_after() to connect your callback, and have your
handler run after the default one
 - subclass GtkTreeView and override the drag_begin() virtual function
without chaining up, to implement your own handler

Ciao,
 Emmanuele.

-- 
https://www.bassi.io
[@] ebassi [@gmail.com]
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: "draw" icon with string

2018-09-01 Thread Chris Moller
You probably can't do that--GTK has gotten just about impossible to 
customise--but if you can do it at all, you'll probably have to use CSS.


On 01/09/18 17:20, c.buhtz--- via gtk-app-devel-list wrote:

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
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


"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
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list