GraphWidget with background image
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
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 <tiago@skewed.de>
participants (2)
-
Paulo Nascimento -
Tiago de Paula Peixoto