[cairo] graphics problem

Roman Goldov goldov1 at yandex.ru
Wed Oct 14 07:39:51 PDT 2015


little note - some of (pure) gtk+ codes are compiled and work only using the following line - 

gcc `pkg-config --cflags gtk+-2.0` -o file13.exe file13.c `pkg-config --libs gtk+-2.0`

instead of 

gcc -Wall -g helloworld.c -o helloworld `gtk-config --cflags`  `gtk-config --libs`


Dear All, i am a new user of gtk+, cairo and their libraries - that is why my be i am doing
anything wrong - i would appreciate detailed answers and few (2-3) graphics examples of incorporating
cairo into gtk+ codes.

Thank you.
Roman Goldov




14.10.2015, 14:58, "Roman Goldov" <goldov1 at yandex.ru>:
> Hello, thank you for the answer. many apologies for not providing full information about a C-example file and a version of gtk+-devel and cairo-devel in the previous e-mail. below i send you a version of gtk+-devel and cairo-devel - as a i understand the version of gtk+ is "1.2" and of cairo-devel is "1.12" (in my OS - CentOS 7):
>
> [root at localhost ...]# yum install cairo-devel
> Loaded plugins: fastestmirror, langpacks
> Loading mirror speeds from cached hostfile
>  * base: centos-mirror.rbc.ru
>  * epel: epel.besthosting.ua
>  * extras: centos-mirror.rbc.ru
>  * updates: centos-mirror.rbc.ru
> Package cairo-devel-1.12.14-6.el7.x86_64 already installed and latest version
> Nothing to do
>
> [root at localhost ...]# yum install gtk+-*
> Loaded plugins: fastestmirror, langpacks
> Loading mirror speeds from cached hostfile
>  * base: centos-mirror.rbc.ru
>  * epel: epel.besthosting.ua
>  * extras: centos-mirror.rbc.ru
>  * updates: centos-mirror.rbc.ru
> Package 1:gtk+-devel-1.2.10-77.el7.x86_64 already installed and latest version
> Package 1:gtk+-1.2.10-77.el7.x86_64 already installed and latest version
> Nothing to do
>
> i would appreciate if someone could send me a few examples (of full working C-files) of how one could incorporate
> cairo into gtk+-1.2. - at the moment i looked through examples at the web-site "http://cairographics.org/examples/",
> howevere i could not understand how one could use cairo functions to draw/insert lines, color rectangles and other color (or b/w) pictures in a window created by gtk+.
>
> Thank you.
> Roman Goldov
>
> 13.10.2015, 19:55, "Stefan Salewski" <mail at ssalewski.de>:
>>  On Tue, 2015-10-13 at 15:54 +0300, Roman Goldov wrote:
>>>   Hello, i installed CentOS 7 and gtk-devel libaries. I learn GTK+ and
>>>   Cairo. I downloaded (copied) from Internet an exmple of cairo file
>>>   (file9.c that is attached) where i tried to draw lines (graphics) on
>>>   the window. However, the window is opened and it is empty, and also
>>>   theer is warning message in the terminal:
>>>
>>>   [... at localhost ~]$ gcc -Wall -g file9.c -o file9.exe `pkg-config -
>>>   -cflags gtk+-2.0` `pkg-config --libs gtk+-2.0`
>>>   [... at localhost ~]$ ./file9.exe
>>>
>>>   (file9.exe:9678): GLib-GObject-WARNING **: gsignal.c:2462: signal
>>>   'draw' is invalid for instance '0x968440' of type 'GtkDrawingArea'
>>>
>>>   I would appreciate help in solving the problem. A detailed answer
>>>   would be appreciated because i am a new user of Linux.
>>>   Thank you.
>>>   Roman Goldov
>>>   --
>>
>>  You took that example from zcode.com -- so why do you not tell us?
>>  That example is for GTK3 now. It will not work in its current state with
>>  GTK2. You may asks the author if he still has the very old GTK2 version.
>>  Or you may use other examples which have not been ported to GTK3 jet, I
>>  guess there will exists some in internet. Or, you you may port that
>>  example back to GTK2, I think there is not very much to modify, but I do
>>  not know exactly what, because I am using GTK3 for years now.
>>
>>  Is there no GTK3 available for your OS, or have you a good reason for
>>  using old GTK2?
>>
>>  If you really need a GTK2 example and can not find one, let us know, I
>>  may provide one in the next few days...
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list