GraphWidget with background image

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GraphWidget with background image

Paulo Nascimento
Hello Tiago,

I finished implementing the background image in GraphWidget. I attached the files so you can see the result. You just need to run the file named test_window.py within an environment with graph-tool installed. I think that it only works with PNG image files, because I used the method
cairo.ImageSurface.create_from_png()
During this development I have found some difficult to use the key press events when the GraphWidget is inside a Gtk container. I was trying to set a GraphWidget inside the Gtk.Overlay, which is set inside a Gtk.Notebook page. In this configuration all the events with scroll and control key worked perfectly, but when I press the keys 'a', 's' or 'r' nothing happens. Do you have any idea why this occurs?

I had another problem related with the docker image when I was developing the GUI. All the text outside the GraphWidget was shown as a undefined character, like small squares. I thought that happened because the Arch Linux is messing with the fonts. So I created a new Dockerfile using Ubuntu 16.04 and compiled with graph-tool. This way I had no problem with the font.

I hope this help in some way. :)

Regards,
Paulo Nascimento



_______________________________________________
graph-tool mailing list
[hidden email]
https://lists.skewed.de/mailman/listinfo/graph-tool

dados_animais.txt (258 bytes) Download Attachment
gtk_graph_draw.py (71K) Download Attachment
terrain.png (94K) Download Attachment
test_window.py (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GraphWidget with background image

Tiago Peixoto
Administrator
On 17.10.2017 23:51, Paulo Nascimento wrote:
> During this development I have found some difficult to use the key press
> events when the GraphWidget is inside a Gtk container. I was trying to set a
> GraphWidget inside the Gtk.Overlay, which is set inside a Gtk.Notebook page.
> In this configuration all the events with scroll and control key worked
> perfectly, but when I press the keys 'a', 's' or 'r' nothing happens. Do you
> have any idea why this occurs?

The events are probably caught by the parent widget, so maybe you have to
handle it there, or just configure it to propagate it forward.

> I had another problem related with the docker image when I was developing
> the GUI. All the text outside the GraphWidget was shown as a undefined
> character, like small squares. I thought that happened because the Arch
> Linux is messing with the fonts. So I created a new Dockerfile using Ubuntu
> 16.04 and compiled with graph-tool. This way I had no problem with the font.

If that is the case, you can just install the fonts from Arch, there is no
need to start from scratch just for that. I will investigate and add the
fonts if necessary.

Best,
Tiago

--
Tiago de Paula Peixoto <[hidden email]>


_______________________________________________
graph-tool mailing list
[hidden email]
https://lists.skewed.de/mailman/listinfo/graph-tool

signature.asc (849 bytes) Download Attachment
--
Tiago de Paula Peixoto <tiago@skewed.de>