Re: "draw" icon with string

2018-09-10 Thread c.buhtz--- via gtk-app-devel-list
t;Cairo") > >     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-ev

Re: "draw" icon with string

2018-09-10 Thread Chris Moller
Have you seen the recent post from Eric Cashon?   I think it's a similar example but in Python.  Sorry, but I've never used Pycairo. On 10/09/18 16:53, c.buhtz--- via gtk-app-devel-list wrote: Thanks Chris for your example code. But I am not able to map your C code to Pycairo. Even the doc of

Re: "draw" icon with string

2018-09-10 Thread c.buhtz--- via gtk-app-devel-list
Thanks Chris for your example code. But I am not able to map your C code to Pycairo. Even the doc of Pycairo is not helpfull. No examples, no class trees. I still don't know how to draw text to a cairo surface. It is also unclear to me which surface I should use. On 2018-09-09 18:22 Chris Moller

Re: "draw" icon with string

2018-09-10 Thread Eric Cashon via gtk-app-devel-list
e()     return surface win = MainWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main()    -Original Message- From: c.buhtz--- via gtk-app-devel-list To: c.buhtz--- via gtk-app-devel-list Cc: c.buhtz Sent: Sun, Sep 9, 2018 2:14 pm Subject: Re

Re: "draw" icon with string

2018-09-09 Thread Chris Moller
Here's a sample I came across some time ago.. Basically, you need to do all the drawing using cairo primitives. /*     Test drawing on a toggle button.     gcc -Wall cairobutton.c -o cairobutton `pkg-config --cflags --libs gtk+-3.0`     C. Eric Cashon */ #include gboolean draw_button1 (G

Re: "draw" icon with string

2018-09-09 Thread c.buhtz--- via gtk-app-devel-list
On 2018-09-09 23:01 "c.buhtz--- via gtk-app-devel-list" wrote: > It is unclear to me how to create a cairo.Surface instance. > And I can not see any text/string drawing methods in the surface class. _

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 help(cairo.Surface)

Re: "draw" icon with string

2018-09-03 Thread Emmanuele Bassi via gtk-app-devel-list
On Tue, 4 Sep 2018 at 00:09, c.buhtz--- via gtk-app-devel-list < gtk-app-devel-list@gnome.org> wrote: > Dear Emmanuele, > > you describe how to set a drag icon. I know how to do this. > https://stackoverflow.com/q/51975256/4865723 > > But the question is how do I create my icon? > That's what I w

Re: "draw" icon with string

2018-09-03 Thread c.buhtz--- via gtk-app-devel-list
Dear Emmanuele, you describe how to set a drag icon. I know how to do this. https://stackoverflow.com/q/51975256/4865723 But the question is how do I create my icon? e.g. TreeView create it's own one, too. It is based on the row content. I can I do the same? e.g. I only want the content of the s

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

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

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

"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