Re: Why the code is not compatible?

2015-08-16 Thread Jean Brefort
Hi Igor,

The code fallbacks to a default icon size (24x24) if you pass a wrong
argument. You should also get a warning in the console if I read the
source correctly.

Le dimanche 16 août 2015 à 09:06 -0400, Igor Korot a écrit :
> Hi, Jean,
> 
> On Sun, Aug 16, 2015 at 8:59 AM, Jean Brefort
>  wrote:
> > GtkIconSize is an enum. Acceptable values are 1 to 6, 6 being
> > GTK_ICON_SIZE_DIALOG. (0 means invalid). 48 is undefined.
> 
> But then why it works if I just use gtk_image_new_from_icon_name()?
> Am I losing the size, converting from GdkPixbuf and it becomes 0?
> 
> Thank you.
> 
> > 
> > Le dimanche 16 août 2015 à 14:24 +0200, Stefan Salewski a écrit :
> > > On Sat, 2015-08-15 at 19:16 -0400, Igor Korot wrote:
> > > > However, if
> > > > I explicitely put 48 instead of GTK_ICON_SIZE_DIALOG in  the 
> > > > call
> > > > to
> > > > gtk_icon_theme_load_icon() or
> > > > use gtk_image_new_from_icon_name() instead of the whole block 
> > > > the
> > > > icon
> > > > appears properly sized.
> > > 
> > > https://developer.gnome.org/gtk3/3.16/gtk3-Themeable-Stock
> > > -Images.html#GtkIconSize
> > > 
> > > I think GtkIconSize is an enum, so using value 48 should be 
> > > wrong.
> > > 
> > > For such kind of problems it is really useful to provide a 
> > > complete
> > > minimal example, preferable in plain C. I can not guess what your
> > > problem may be, maybe the real experts can. But unfortunately we 
> > > have
> > > not many experts still on this list, and they may be busy.
> > > 
> > > ___
> > > gtk-list mailing list
> > > gtk-list@gnome.org
> > > https://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Why the code is not compatible?

2015-08-16 Thread Jean Brefort
GtkIconSize is an enum. Acceptable values are 1 to 6, 6 being
GTK_ICON_SIZE_DIALOG. (0 means invalid). 48 is undefined.

Le dimanche 16 août 2015 à 14:24 +0200, Stefan Salewski a écrit :
> On Sat, 2015-08-15 at 19:16 -0400, Igor Korot wrote:
> > However, if
> > I explicitely put 48 instead of GTK_ICON_SIZE_DIALOG in  the call 
> > to
> > gtk_icon_theme_load_icon() or
> > use gtk_image_new_from_icon_name() instead of the whole block the 
> > icon
> > appears properly sized.
> 
> https://developer.gnome.org/gtk3/3.16/gtk3-Themeable-Stock
> -Images.html#GtkIconSize
> 
> I think GtkIconSize is an enum, so using value 48 should be wrong.
> 
> For such kind of problems it is really useful to provide a complete
> minimal example, preferable in plain C. I can not guess what your
> problem may be, maybe the real experts can. But unfortunately we have
> not many experts still on this list, and they may be busy.
> 
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: charts on gtk+

2015-02-06 Thread Jean Brefort
libgoffice has support for charts. It can be used outside of gnumeric
and uses cairo for rendering.

Regards,
Jean

Le vendredi 06 février 2015 à 16:27 -0600, zeta a écrit :
> Hi there I am new on the community, I am a bachelor student at BUAP, I
> love gome since I meet it, and know I want to contribute in something,
> I was writing an application with gtk and when I want to create some
> cool charts I see that there isn't a library for do it, or I don't
> find one that has native integration with gtk, so I decide to write
> one, but first I want to know If anyone is doing one, or if someone
> can guide me where to start, I think that I should do with the gtk
> draw area widget and cairo, but I'm not sure. Regards Miguel Angel
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list

___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


About GtkBuilder, GMenu, and GAction (was Re: Deprecation of GtkImageMenuItem)

2014-10-23 Thread Jean Brefort
Le jeudi 23 octobre 2014 à 10:31 +0100, Emmanuele Bassi a écrit :
> another recommendation is to *not* use GtkMenu and friends directly,
> but to use GtkBuilder, GAction, and GMenu — follow the "How Do I"
> document here: https://developer.gnome.org/GMenu/ — to describe your
> menus with XML, which also lets you specify icons for specific menu
> items.

Hi Emmanuele,

I read that documentation, but I'm unsure about how I might use
placeholders with this (not so) new API, as I could do when using
GtkUIManager. Is it possible? or not?

Best regards,
Jean

___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: The issue "ionice: execvp failed: No such file or directory" once more.

2012-11-07 Thread Jean Brefort
ionice is part of util-linux-ng. Check your installation.
Regards,
Jean

Le mardi 06 novembre 2012 à 15:56 +0800, Hongyi Zhao a écrit :
> Hi all,
> 
> I've post a message on this type of issue.  Now, I meet it again, sigh;-(
> 
> See the following code:
> 
> --
> werner@debian-asus:~$ jhbuild -f jhbuildrc-gnome3 build -a --nodeps yelp-xsl
> ---
> 
> Then I meet the following errors:
> 
> -
> [snipped]
> *** Configuring yelp-xsl *** [7/7]
> ./autogen.sh --prefix /opt/jhbuild/gnome --libdir 
> '/opt/jhbuild/gnome/lib64'  --disable-maintainer-mode --disable-static 
> --disable-gtk-doc
> ionice: execvp failed: No such file or directory
> *** Error during phase configure of yelp-xsl: ## Error running 
> ./autogen.sh --prefix /opt/jhbuild/gnome --libdir 
> '/opt/jhbuild/gnome/lib64'  --disable-maintainer-mode --disable-static 
> --disable-gtk-doc  *** [7/7]
> 
>[1] Rerun phase configure
>[2] Ignore error and continue to build
>[3] Give up on module
>[4] Start shell
>[5] Reload configuration
>[6] Go to phase "wipe directory and start over"
>[7] Go to phase "clean"
>[8] Go to phase "distclean"
> choice: ^CInterrupted
> -
> 
> Below is the content of the config file jhbuildrc-gnome3:
> 
> ---
> # -*- mode: python -*-
> # -*- coding: utf-8 -*-
> import os
> import sys
> 
> checkoutroot = os.path.expanduser('/opt/jhbuild/checkout/gnome')
> prefix = os.path.expanduser('/opt/jhbuild/gnome')
> 
> autogenargs='--disable-maintainer-mode --disable-static --disable-gtk-doc'
> 
> addpath('PKG_CONFIG_PATH', '/usr/lib/pkgconfig')
> addpath('PKG_CONFIG_PATH', '/usr/share/pkgconfig')
> -
> 
> Any hints on this issue?  Thanks in advance.
> 
> Regards
> 


___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: The issue "ionice: execvp failed: No such file or directory" once more.

2012-11-06 Thread Jean Brefort
Debian squeeze is shipped with util-linux-2.17.2 which
contains /usr/bin/ionice, so it should be already on your system.
Installing a newer version might be not a so good idea. Just check that
util-linux is installed (it should). If /usr/bin/ionice does not exists,
reinstall that package, your system is most probably broken.

Le mardi 06 novembre 2012 à 20:36 +0800, Hongyi Zhao a écrit :
> On 11/06/2012 05:39 PM, Jean Brefort wrote:
> > ionice is part of util-linux-ng. Check your installation.
> > Regards,
> > Jean
> According to your above advice, I do the following thing:
> 
> $ git clone git://gitorious.org/util-linux-ng/util-linux-ng.git
> werner@debian-asus:~/util-linux-ng$ ./autogen.sh
> werner@debian-asus:~/util-linux-ng$ ./configure --prefix=/usr/local && 
> make && sudo make install
> 
> Then, I put the following line into my config file  jhbuildrc-gnome3 for 
> jhbuild:
> 
> addpath('PKG_CONFIG_PATH', '/usr/local/lib/pkgconfig')
> 
> Now, I rerun the jhbuild with the following command but failed again, 
> see the following for detail:
> 
> 
> -
> $ jhbuild -f jhbuildrc-gnome3 buildone yelp-xsl
> *** Checking out yelp-xsl *** [1/1]
> git remote set-url origin git://git.gnome.org/yelp-xsl
> git remote update origin
> Fetching origin
> *** Configuring yelp-xsl *** [1/1]
> ./autogen.sh --prefix /opt/jhbuild/gnome --libdir 
> '/opt/jhbuild/gnome/lib64'  --disable-maintainer-mode --disable-static 
> --disable-gtk-doc
> ionice: executing ./autogen.sh failed: No such file or directory
> *** Error during phase configure of yelp-xsl: ## Error running 
> ./autogen.sh --prefix /opt/jhbuild/gnome --libdir 
> '/opt/jhbuild/gnome/lib64'  --disable-maintainer-mode --disable-static 
> --disable-gtk-doc  *** [1/1]
> 
>[1] Rerun phase configure
>[2] Ignore error and continue to build
>[3] Give up on module
>[4] Start shell
>[5] Reload configuration
>[6] Go to phase "wipe directory and start over"
>[7] Go to phase "clean"
>[8] Go to phase "distclean"
> choice:
> -
> 
> As you can see, this time, I meet the error as "ionice: executing 
> ./autogen.sh failed: No such file or directory"
> 
> Any hints on this issue?
> 
> Regards
> 
> >
> > Le mardi 06 novembre 2012 à 15:56 +0800, Hongyi Zhao a écrit :
> >> Hi all,
> >>
> >> I've post a message on this type of issue.  Now, I meet it again, sigh;-(
> >>
> >> See the following code:
> >>
> >> --
> >> werner@debian-asus:~$ jhbuild -f jhbuildrc-gnome3 build -a --nodeps 
> >> yelp-xsl
> >> ---
> >>
> >> Then I meet the following errors:
> >>
> >> -
> >> [snipped]
> >> *** Configuring yelp-xsl *** [7/7]
> >> ./autogen.sh --prefix /opt/jhbuild/gnome --libdir
> >> '/opt/jhbuild/gnome/lib64'  --disable-maintainer-mode --disable-static
> >> --disable-gtk-doc
> >> ionice: execvp failed: No such file or directory
> >> *** Error during phase configure of yelp-xsl: ## Error running
> >> ./autogen.sh --prefix /opt/jhbuild/gnome --libdir
> >> '/opt/jhbuild/gnome/lib64'  --disable-maintainer-mode --disable-static
> >> --disable-gtk-doc  *** [7/7]
> >>
> >> [1] Rerun phase configure
> >> [2] Ignore error and continue to build
> >> [3] Give up on module
> >> [4] Start shell
> >> [5] Reload configuration
> >> [6] Go to phase "wipe directory and start over"
> >> [7] Go to phase "clean"
> >> [8] Go to phase "distclean"
> >> choice: ^CInterrupted
> >> -
> >>
> >> Below is the content of the config file jhbuildrc-gnome3:
> >>
> >> ---
> >> # -*- mode: python -*-
> >> # -*- coding: utf-8 -*-
> >> import os
> >> import sys
> >>
> >> checkoutroot = os.path.expanduser('/opt/jhbuild/checkout/gnome')
> >> prefix = os.path.expanduser('/opt/jhbuild/gnome')
> >>
> >> autogenargs='--disable-maintainer-mode --disable-static --disable-gtk-doc'
> >>
> >> addpath('PKG_CONFIG_PATH', '/usr/lib/pkgconfig')
> >> addpath('PKG_CONFIG_PATH', '/usr/share/pkgconfig')
> >> -
> >>
> >> Any hints on this issue?  Thanks in advance.
> >>
> >> Regards
> >>
> >
> >
> 
> 


___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: drawing on offscreen surface

2012-08-10 Thread Jean Brefort
It is not the sme thing. With your latest code, you create surface each
time the widget needs redraw. configure events only occur when the
widget changes size.
Otherwise, you are leaking surface and off_cr.

Le vendredi 10 août 2012 à 16:41 +0530, Prasanta Sadhukhan a écrit :
> Thanks for the code and the explanation. Now, it's quite clear.
> Last thing I wanted to know is, do I need to always have
> "configure_event" handler to create the offscreen surface. 
> Can't we create the offscreen surface in "expose_event" handler
> itself?
> I tried with this (after commenting "configure_event" callback) which
> also seems to do the same thing as your code.
> 
> static gboolean
> draw_cb (GtkWidget  *widget,
>  GdkEventExpose *event,
>  gpointerdata)
> {
>   cairo_t *off_cr, *cr;
> 
>   g_print("draw event\n");
> 
>   surface = gdk_window_create_similar_surface (event->window,
>CAIRO_CONTENT_COLOR,
>event->area.width,
>event->area.height);
> 
>   off_cr = cairo_create(surface);
>   cairo_set_source_rgb(off_cr, 1, 0, 0);
>   cairo_paint (off_cr);
> 
>   cairo_move_to (off_cr, 100, 100);
>   cairo_set_source_rgb (off_cr, 0, 0, 0);
>   cairo_set_font_size (off_cr, 20);
>   cairo_show_text (off_cr, "Offscreen buffer is red");
> 
> 
>   cr = gdk_cairo_create (event->window);
>   cairo_set_source_surface(cr, surface, 0, 0);
>   cairo_paint(cr);
> 
>   cairo_move_to (cr, 200, 200);
>   cairo_set_source_rgb (cr, 0, 1, 0);
>   cairo_set_font_size (cr, 20);
>   cairo_show_text (cr, "This text is not blitted");
> 
>   cairo_destroy (cr);
> 
>   return TRUE;
> }
> 
> Regards
> Prasanta
> On Fri, Aug 10, 2012 at 4:14 PM, Tadej Borovšak 
> wrote:
> Hello.
> 
> Have a look at this code (targeted at GTK+-2.x):
> 
> #include 
> 
> static cairo_surface_t *surface = NULL;
> 
> static gboolean
> configure_event_cb (GtkWidget *widget,
> GdkEventConfigure *event,
> gpointer   data)
> {
>   cairo_t *cr;
> 
>   g_print("configure event: %d, %d\n", event->width,
> event->height);
> 
>   if (surface)
> cairo_surface_destroy (surface);
> 
>   surface = gdk_window_create_similar_surface (event->window,
> 
>  CAIRO_CONTENT_COLOR,
>event->width,
>event->height);
> 
>   cr = cairo_create(surface);
> 
>   cairo_set_source_rgb(cr, 1, 0, 0);
>   cairo_paint (cr);
> 
> 
>   cairo_move_to (cr, 100, 100);
>   cairo_set_source_rgb (cr, 0, 0, 0);
>   cairo_set_font_size (cr, 20);
>   cairo_show_text (cr, "Offscreen buffer is red");
> 
>   cairo_destroy(cr);
> 
>   return FALSE;
> }
> 
> static gboolean
> draw_cb (GtkWidget  *widget,
> 
>  GdkEventExpose *event,
>  gpointerdata)
> {
>   cairo_t *cr;
> 
>   g_print("draw event\n");
> 
>   cr = gdk_cairo_create (event->window);
> 
>   cairo_set_source_surface(cr, surface, 0, 0);
>   cairo_paint(cr);
> 
> 
>   cairo_move_to (cr, 200, 200);
>   cairo_set_source_rgb (cr, 0, 1, 0);
>   cairo_set_font_size (cr, 20);
>   cairo_show_text (cr, "This text is not blitted");
> 
>   cairo_destroy (cr);
> 
>   return TRUE;
> }
> 
> int
> main(intargc,
>  char **argv)
> {
>   GtkWidget *window,
> *area;
> 
>   gtk_init(&argc, &argv);
> 
>   window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
>   gtk_window_set_default_size (GTK_WINDOW (window), 1200,
> 800);
>   g_signal_connect (window, "destroy", gtk_main_quit, NULL);
> 
>   area = gtk_drawing_area_new();
>   g_signal_connect (area, "expose-event",
> 
> G_CALLBACK (draw_cb), NULL);
>   g_signal_connect (area, "configure-event",
> G_CALLBACK(configure_event_cb), NULL);
>   gtk_container_add (GTK_CONTAINER (window), area);
> 
>   gtk_widget_show_all(window);
>   gtk_main();
> 
>   return 0;
> }
> 
> 
> 
> surface is your offscreen buffer and contains red background
> and black
> text. This is then blitted during expose-event and to finish
> off, some
> 

Re: drawing on offscreen surface

2012-08-10 Thread Jean Brefort
The code in expose_event_offscr actually draws on screen. Actually your
widget might use double buffering.
surface is the offscreen scene.
Or may be I just not understand your point.

Le vendredi 10 août 2012 à 14:58 +0530, Prasanta Sadhukhan a écrit :
> I have added the drawing of green rectangle in configure_event_cb()
> code where I am creating the surface.
> Now, when I run this I get BOTH the green rectangle and blue rectangle
> on the main window.
> I assume since I am not calling   cairo_set_source_surface() in
> configure_event_cb() that means the green rectangle is being drawn on
> main window and NOT on offscreen surface, whereas
> in expose_event(), since I am calling cairo_set_source_surface() and
> drawing blue rectangle on that surface, it is getting drawn on
> offscreen.
> Please confirm and second my understanding.
> 
> Thank you all for your help.
> 
> #include 
> 
> static cairo_surface_t *surface = NULL;
> 
> static gboolean
> configure_event_cb (GtkWidget *widget, GdkEventConfigure *event,
> gpointer data)
> {
> cairo_t *cr;
> g_print("configure event: %d, %d\n", event->width, event->height);
> 
> if (surface)
>cairo_surface_destroy(surface);
> 
> surface = gdk_window_create_similar_surface (event->window, 
>  CAIRO_CONTENT_COLOR,
>  event->width,
>  event->height);
> cr = cairo_create(surface);
> cairo_set_source_rgb(cr, 0, 0, 0);
> cairo_paint(cr);
> 
>   cairo_set_source_rgb(cr, 0, 1, 0);
>   cairo_rectangle(cr, 100, 100, 200, 200);
>   cairo_stroke(cr);
> 
> return FALSE;
> }
> 
> static gboolean
> expose_event_offscr (GtkWidget *widget,GdkEventExpose *event, gpointer
> data)
> {
>   g_print("draw event offscr\n");
> 
>   cairo_t *cr = gdk_cairo_create(widget->window);
>   cairo_set_source_surface(cr, surface, 0, 0);
>   cairo_paint(cr);
> 
>   cairo_set_source_rgb(cr, 0, 0, 1);
>   cairo_rectangle(cr, 300, 300, 200, 200);
>   cairo_stroke(cr);
>   return TRUE;
> }
> 
> 
> int
> main(intargc,
>  char **argv)
> {
>   GtkWidget *window,
> *area;
> 
>   gtk_init(&argc, &argv);
> 
>   window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
>   gtk_window_set_default_size (GTK_WINDOW (window), 1200, 800);
>   g_signal_connect (window, "destroy", gtk_main_quit, NULL);
> 
>   area = gtk_drawing_area_new();
>   g_signal_connect (area, "expose-event",
> G_CALLBACK (expose_event_offscr), NULL);
>   g_signal_connect (area, "configure-event",
> G_CALLBACK(configure_event_cb), NULL);
>   gtk_container_add (GTK_CONTAINER (window), area);
> 
>   gtk_widget_show_all(window);
>   gtk_main();
> 
>   return 0;
> }
> 
> 
> On Fri, Aug 10, 2012 at 2:38 PM, Jean Brefort
>  wrote:
> I suppose that surface is the offscreen scene. In that case,
> ther bule
> rectangle should not be drawn during the expose event
> callback, but when
> you build surface. Then you can use the code in my previous
> message,
> replacing the blue color by green color.
> 
> Hope this helps.
> 
> Le vendredi 10 août 2012 à 14:34 +0530, Prasanta Sadhukhan a
> écrit :
> > Thanks for your code. This draws a blue rectangle on a black
> > background and the offscreen surface contents is rendered on
> main
> > window.
> > But I also would like to draw green rectangle in main window
> so after
> > final rendering of offscreen contents (the blue rectangle)
>     on main
> > window, I would get both blue and green rectangles on main
> window.
> > Can you please clarify how can I achieve that (both
> offscreen & main
> > window contents being shown on main window)?
> >
> > Thanks in advance!!
> >
> > Regards
> > Prasanta
> >
> > On Fri, Aug 10, 2012 at 2:22 PM, Jean Brefort
> >  wrote:
> > You should use something like:
> >
> > cairo_set_source_surface(cr, surface, 0, 0);
> > cairo_paint(cr).
> > cairo_set_source_rgb(cr, 0, 0, 1);
> > cairo_rectangle(cr, 300,300, 200, 200);
> > cairo_stroke(cr);
> >
> >
>   

Re: drawing on offscreen surface

2012-08-10 Thread Jean Brefort
I suppose that surface is the offscreen scene. In that case, ther bule
rectangle should not be drawn during the expose event callback, but when
you build surface. Then you can use the code in my previous message,
replacing the blue color by green color.

Hope this helps.

Le vendredi 10 août 2012 à 14:34 +0530, Prasanta Sadhukhan a écrit :
> Thanks for your code. This draws a blue rectangle on a black
> background and the offscreen surface contents is rendered on main
> window.
> But I also would like to draw green rectangle in main window so after
> final rendering of offscreen contents (the blue rectangle) on main
> window, I would get both blue and green rectangles on main window.
> Can you please clarify how can I achieve that (both offscreen & main
> window contents being shown on main window)?
> 
> Thanks in advance!!
> 
> Regards
> Prasanta
> 
> On Fri, Aug 10, 2012 at 2:22 PM, Jean Brefort
>  wrote:
> You should use something like:
> 
> cairo_set_source_surface(cr, surface, 0, 0);
> cairo_paint(cr).
> cairo_set_source_rgb(cr, 0, 0, 1);
> cairo_rectangle(cr, 300,300, 200, 200);
> cairo_stroke(cr);
> 
> 
> This will paint the window with surface as source and then
> draw a blue
> rectangle.
> 
> Le vendredi 10 août 2012 à 14:09 +0530, Prasanta Sadhukhan a
> écrit :
> >
> >
> > On Fri, Aug 10, 2012 at 1:22 PM, Jean Brefort
> >  wrote:
> > This code is quite strange. Your call to
> > cairo_set_source_surface() is
> > not useful since you use cairo_set_source_rgb() just
> after.
> > You should
> > call cairo_paint() just after
> cairo_set_source_surface() if
> > you want it
> > to have any effect.
> >
> > If I do not call cairo_set_source_rgb(cr, 0, 0, 1); how
> will get a
> > blue rectangle?
> > Just having   these is giving me a window with black
> background.
> > cairo_set_source_surface(cr, surface, 0, 0);
> > cairo_rectangle(cr, 300,300, 200, 200);
> > cairo_stroke(cr);
> > cairo_paint(cr).
> >
> > Can you please clarify?
> > As I told, I would like to get a blue rectangle in offscreen
> surface
> > and a green rectangle in main visible surface so after final
> rendering
> > of offscreen contents on main window, I would get both
> rectangles on
> > main window.
> >
> > Regards
> > Prasanta
> >
> > Hope it helps,
> > Jean
> >
> > Le vendredi 10 août 2012 à 13:07 +0530, Prasanta
> Sadhukhan a
> > écrit :
> > > expose_event (GtkWidget *widget,GdkEventExpose
> *event,
> > gpointer
> > > data)
> > > {
> > >   g_print("draw event main\n");
> > >
> > >   cairo_t *cr = gdk_cairo_create(widget->window);
> > > // draw blue rectangle into offscreen
> > >   cairo_set_source_surface(cr, surface, 0, 0);
> > >   cairo_set_source_rgb(cr, 0, 0, 1);
> > >   cairo_rectangle(cr, 300, 300, 200, 200);
> > >   cairo_stroke(cr);
> > >   cairo_paint(cr);
> > >
> > > //draw green rectangle onto main window
> > > cairo_set_source_rgb(cr, 0, 1, 0);
> > >   cairo_rectangle(cr, 100, 100, 200, 200);
> > >cairo_stroke(cr)
> > > }
> > >
> > >
> > >
> >
> >
> > ___
> > gtk-list mailing list
> > gtk-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/gtk-list
> >
> 
> 
> 
> 


___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: drawing on offscreen surface

2012-08-10 Thread Jean Brefort
You should use something like:

cairo_set_source_surface(cr, surface, 0, 0);
cairo_paint(cr).
cairo_set_source_rgb(cr, 0, 0, 1);
cairo_rectangle(cr, 300,300, 200, 200);
cairo_stroke(cr);

This will paint the window with surface as source and then draw a blue
rectangle.

Le vendredi 10 août 2012 à 14:09 +0530, Prasanta Sadhukhan a écrit :
> 
> 
> On Fri, Aug 10, 2012 at 1:22 PM, Jean Brefort
>  wrote:
> This code is quite strange. Your call to
> cairo_set_source_surface() is
> not useful since you use cairo_set_source_rgb() just after.
> You should
> call cairo_paint() just after cairo_set_source_surface() if
> you want it
> to have any effect.
> 
> If I do not call cairo_set_source_rgb(cr, 0, 0, 1); how will get a
> blue rectangle? 
> Just having   these is giving me a window with black background.
> cairo_set_source_surface(cr, surface, 0, 0);
> cairo_rectangle(cr, 300,300, 200, 200);
> cairo_stroke(cr);
> cairo_paint(cr).
> 
> Can you please clarify? 
> As I told, I would like to get a blue rectangle in offscreen surface
> and a green rectangle in main visible surface so after final rendering
> of offscreen contents on main window, I would get both rectangles on
> main window.
> 
> Regards
> Prasanta
> 
> Hope it helps,
> Jean
> 
> Le vendredi 10 août 2012 à 13:07 +0530, Prasanta Sadhukhan a
> écrit :
> > expose_event (GtkWidget *widget,GdkEventExpose *event,
> gpointer
> > data)
> > {
> >   g_print("draw event main\n");
> >
> >   cairo_t *cr = gdk_cairo_create(widget->window);
> > // draw blue rectangle into offscreen
> >   cairo_set_source_surface(cr, surface, 0, 0);
> >   cairo_set_source_rgb(cr, 0, 0, 1);
> >   cairo_rectangle(cr, 300, 300, 200, 200);
> >   cairo_stroke(cr);
> >   cairo_paint(cr);
> >
> > //draw green rectangle onto main window
> > cairo_set_source_rgb(cr, 0, 1, 0);
> >   cairo_rectangle(cr, 100, 100, 200, 200);
> >cairo_stroke(cr)
> > }
> >
> >
> >
> 
> 
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
> 


___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: drawing on offscreen surface

2012-08-10 Thread Jean Brefort
This code is quite strange. Your call to cairo_set_source_surface() is
not useful since you use cairo_set_source_rgb() just after. You should
call cairo_paint() just after cairo_set_source_surface() if you want it
to have any effect.

Hope it helps,
Jean

Le vendredi 10 août 2012 à 13:07 +0530, Prasanta Sadhukhan a écrit :
> expose_event (GtkWidget *widget,GdkEventExpose *event, gpointer
> data)
> {
>   g_print("draw event main\n");
> 
>   cairo_t *cr = gdk_cairo_create(widget->window);
> // draw blue rectangle into offscreen
>   cairo_set_source_surface(cr, surface, 0, 0);
>   cairo_set_source_rgb(cr, 0, 0, 1);
>   cairo_rectangle(cr, 300, 300, 200, 200);
>   cairo_stroke(cr);
>   cairo_paint(cr);
> 
> //draw green rectangle onto main window
> cairo_set_source_rgb(cr, 0, 1, 0);
>   cairo_rectangle(cr, 100, 100, 200, 200);
>cairo_stroke(cr)
> }
> 
> 
> 

___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Custom widget background color

2012-05-17 Thread Jean Brefort
Hi,

I wrote a custom widget for which some regions should appear selected.
I'm using Ubuntu 12.04, and the theme contains the following:

@define-color bg_color #f2f1f0;
@define-color selected_bg_color #f07746;
@define-color selected_fg_color #ff;

* {
/* inherit the color from parent by default */
color: inherit;
background-color: @bg_color;
}

*:selected,
*:selected:focused {
background-color: alpha (@selected_bg_color, 0.9);

color: @selected_fg_color;
}


Using:
gtk_style_context_get_background_color(ctxt, GTK_STATE_FLAG_SELECTED, &color);
returns white, not the expected f07746. What am I missing?

Thanks,
Jean

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


RE: Change background color in GTK 3

2012-02-14 Thread Jean Brefort
This is https://bugzilla.gnome.org/show_bug.cgi?id=656461

Regards,
Jean

Le mardi 14 février 2012 à 10:00 +0100, Victor henri a écrit :
> Well I had the issue on ubuntu 11.10. On another machine using ubuntu
> 11.04 it works... 
> Is it related to theme? Anyway should't
> gtk_widget_override_background_color override theme?
> 
> Victor
> 
> > Date: Mon, 13 Feb 2012 16:39:02 -0800
> > From: nada...@hotmail.com
> > To: gtk-list@gnome.org
> > Subject: Change background color in GTK 3
> > 
> > 
> > Hello
> > 
> > I would like to change the background of a button in GTK3
> > 
> > In GTK2, I was doing :
> > 
> > GdkColor color;
> > gdk_color_parse ("gold",&color);
> > gtk_widget_modify_bg(GTK_WIDGET(widget), GTK_STATE_NORMAL, &color);
> > 
> > and it was working perfectly.
> > 
> > In GTK3, I am doing :
> > 
> > GdkRGBA color;
> > gdk_rgba_parse (&color, "orange");
> > gtk_widget_override_background_color(GTK_WIDGET(widget),
> > GTK_STATE_FLAG_NORMAL, &color);
> > 
> > and it doesn't work. I don't understand what I have missed
> > 
> > Thank you
> > 
> > -- 
> > View this message in context:
> http://old.nabble.com/Change-background-color-in-GTK-3-tp33319146p33319146.html
> > Sent from the Gtk+ - General mailing list archive at Nabble.com.
> > 
> > ___
> > gtk-list mailing list
> > gtk-list@gnome.org
> > http://mail.gnome.org/mailman/listinfo/gtk-list
> 
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-list


___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: New to GTK, need help

2012-01-22 Thread Jean Brefort
GTK_OBJECT and GTK_SIGNAL_FUNC are obsolete, use G_OBJECT and G_CALLBACK
instead.

Regards,
Jean

Le vendredi 20 janvier 2012 à 22:50 +0700, Siravich Khongrod a écrit :
> Not sure if I am in the right section, but I am new to the GTK+ and I
> have got the following problems
> 
> 
> [folk@ASUS GUI]
> $ gcc `pkg-config --cflags --libs gtk+-3.0` PlainWin.c
> PlainWin.c: In function ‘main’:
> PlainWin.c:19:2: warning: passing argument 1 of
> ‘g_signal_connect_data’ makes pointer from integer without a cast
> [enabled by default]
> /usr/include/glib-2.0/gobject/gsignal.h:353:9: note: expected
> ‘gpointer’ but argument is of type ‘int’
> PlainWin.c:19:2: warning: passing argument 3 of
> ‘g_signal_connect_data’ makes pointer from integer without a cast
> [enabled by default]
> /usr/include/glib-2.0/gobject/gsignal.h:353:9: note: expected
> ‘GCallback’ but argument is of type ‘int’
> /tmp/ccwGupob.o: In function `main':
> PlainWin.c:(.text+0x9c): undefined reference to `GTK_SIGNAL_FUNC'
> PlainWin.c:(.text+0xaa): undefined reference to `GTK_OBJECT'
> 
> 
> Here is the program:
> 
> 
> #include 
> #include 
> 
> 
> static int count = 0;
> void button_clicked (GtkWidget *button, gpointer data)
> {
> printf("%s pressed %d time(s) \n", (char *) data, ++count);
> }
> 
> 
> int main (int argc, char *argv[])
> {
> GtkWidget *window;
> GtkWidget *button;
> gtk_init(&argc, &argv);
> window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
> button = gtk_button_new_with_label("Hello World!");
> gtk_container_add(GTK_CONTAINER(window), button);
> g_signal_connect(GTK_OBJECT (button),
> "clicked",GTK_SIGNAL_FUNC(button_clicked),"Button 1");
> gtk_widget_show(button);
> gtk_widget_show(window);
> gtk_main ();
> return 0;
> }
> 
> 
> Sorry for my english
> Thank you
> 
> 
> Siravich
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-list


___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Some questions about g_object_new, gtk_type_window and so on

2011-07-24 Thread Jean Brefort
Hi,

Each type has an associated GType value which can be retrieved using the
appropriate *_get_type() function. For a GtkButton, the function is:
GType gtk_button_get_type(void);

and GTK_TYPE_BUTTON is an equivalent macro:
#define GTK_TYPE_BUTTON gtk_button_get_type()

These are not described in the documentation since they all strictly
follow the same conventions.

Hope this helps,
Jean

Le lundi 25 juillet 2011 à 12:12 +0800, 丁少衡 a écrit :
> Hello, all.
> I wish I choose the right list to post my question and this would not
> bothering you.
> 
> I am learning gtk+ programming these days, on a debian squeeze
> platform. Almost all the document I have found teaches me that I
> should create a widget with gtk__new(). However, any
> properties of a widget can be set by g_object_set(). So, I suppose
> that any widgets can be created by g_object_new(), since gtk+ is an OO
> development tool kit.
> 
> Finally, I find that a window can be created with
> g_object_new(GTK_TYPE_WINDOW, NULL), a button can be created with
> g_object_new(GTK_TYPE_BUTTON, NULL). But I cannot find out what the
> GTK_TYPE_* mean. I have searched the API documentation, but cannot
> find GTK_TYPE_WINDOW or GTK_TYPE_BUTTON etc.
> 
> Is that right using g_object_new(GTK_TYPE_WINDOW, NULL) to create a
> window? Is that an old way to create window and should not be used in
> newly written code?
> 
> If I can use that method to create widgets, where can I find documents
> about all the GTK_TYPE_*?
> 
> Thanks.
> 
> dingshaoheng
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-list


___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: compile gtk 3 error

2011-07-22 Thread Jean Brefort
Looks like pango uses /usr/lib/cairo. Did you build pango before cairo?

Le vendredi 22 juillet 2011 à 17:14 +0400, Dmitry Shkirmanov a écrit :
> > Strange, which cairo version do you have? You need at least 1.10.0. May
> > be you have several cairo versions and it does not link to the correct
> > one. Try make V=1 to check which is used.
> >   
> Actually, i have two cairo version. One version is installed from
> repository and second one is 1.10.2.
> Version 1.10.2 is installed from source with
> prefix=/home/ya/mylibs/gtk3
> 
> I wrote PKG_CONFIG_PATH, LD_LIBRARY_PATH, CPPFLAGS, LDFLAGS :
> 
> ya@debian:~/mylibs/source/gtk+-3.0.11$ echo $PKG_CONFIG_PATH
> /home/ya/mylibs/gtk3/lib/pkgconfig
> 
> echo $LD_LIBRARY_PATH
> /home/ya/mylibs/gtk3/lib
> 
> ya@debian:~/mylibs/source/gtk+-3.0.11$ echo $CPPFLAGS
> -I/home/ya/mylibs/gtk3/include
> 
> ya@debian:~/mylibs/source/gtk+-3.0.11$ echo $LDFLAGS
> -L/home/ya/mylibs/gtk3/lib
> 
> This is output ofls -l /home/ya/mylibs/gtk3/lib/libcairo.so
> ya@debian:~/mylibs/source/gtk+-3.0.11$ ls
> -l /home/ya/mylibs/gtk3/lib/libcairo.so
> lrwxrwxrwx 1 root root 21 Июл 22
> 15:35 /home/ya/mylibs/gtk3/lib/libcairo.so -> libcairo.so.2.11000.2
> 
> This is output of make V=1, looks like both versions of libcairo.so
> are used.
> 
> Making all in tests
> make[4]: Entering directory `/home/ya/mylibs/source/gtk
> +-3.0.11/gdk/tests'
> gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../..  -pthread
> -I/home/ya/mylibs/gtk3/include/glib-2.0
> -I/home/ya/mylibs/gtk3/lib/glib-2.0/include
> -I/home/ya/mylibs/gtk3/include/pango-1.0
> -I/home/ya/mylibs/gtk3/include/cairo
> -I/home/ya/mylibs/gtk3/include/pixman-1
> -I/home/ya/mylibs/gtk3/include/gio-unix-2.0/
> -I/home/ya/mylibs/gtk3/include/gdk-pixbuf-2.0 -I/usr/include/freetype2
> -I/usr/include/libpng12-I../.. -I../../gdk
> -I/home/ya/mylibs/gtk3/include -DG_DISABLE_SINGLE_INCLUDES
> -DATK_DISABLE_SINGLE_INCLUDES-DGDK_PIXBUF_DISABLE_DEPRECATED
> -DG_DISABLE_DEPRECATED -g -O2 -Wall -MT gdk-color.o -MD -MP
> -MF .deps/gdk-color.Tpo -c -o gdk-color.o gdk-color.c
> mv -f .deps/gdk-color.Tpo .deps/gdk-color.Po
> /bin/bash ../../libtool  --tag=CC   --mode=link gcc -std=gnu99
> -DGDK_PIXBUF_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -g -O2 -Wall
> -L/home/ya/mylibs/gtk3/lib -o gdk-color gdk-color.o -pthread
> -L/home/ya/mylibs/gtk3/lib -lpangocairo-1.0 -lpango-1.0 -lgio-2.0
> -lfontconfig -lXext -lXinerama -lXi -lXrandr -lXcursor -lXcomposite
> -lXdamage -lXfixes -lgdk_pixbuf-2.0 -lm -lgmodule-2.0 -lpng12 -lX11
> -lcairo-gobject -lcairo -lgobject-2.0 -lgthread-2.0 -lrt
> -lglib-2.0 ../../gdk/libgdk-3.la  
> libtool: link: gcc -std=gnu99 -DGDK_PIXBUF_DISABLE_DEPRECATED
> -DG_DISABLE_DEPRECATED -g -O2 -Wall -o .libs/gdk-color gdk-color.o
> -pthread
> -L/home/ya/mylibs/gtk3/lib ../../gdk/.libs/libgdk-3.so 
> /home/ya/mylibs/gtk3/lib/libpangocairo-1.0.so /usr/lib/libcairo.so 
> /home/ya/mylibs/gtk3/lib/libpangoft2-1.0.so 
> /home/ya/mylibs/gtk3/lib/libpango-1.0.so -lXext -lXinerama -lXi -lXrandr 
> -lXcursor -lXcomposite -lXdamage -lXfixes 
> /home/ya/mylibs/gtk3/lib/libgdk_pixbuf-2.0.so 
> /home/ya/mylibs/gtk3/lib/libgio-2.0.so -lresolv 
> /home/ya/mylibs/gtk3/lib/libgmodule-2.0.so -ldl 
> /home/ya/mylibs/gtk3/lib/libcairo-gobject.so 
> /home/ya/mylibs/gtk3/lib/libcairo.so /home/ya/mylibs/gtk3/lib/libpixman-1.so 
> -lfontconfig /usr/lib/libfreetype.so -lpng12 -lXrender -lX11 -lz -lm 
> /home/ya/mylibs/gtk3/lib/libgobject-2.0.so 
> /home/ya/mylibs/gtk3/lib/libgthread-2.0.so -lpthread 
> /home/ya/mylibs/gtk3/lib/libglib-2.0.so -lrt -pthread -Wl,-rpath 
> -Wl,/home/ya/mylibs/gtk3/lib
> ../../gdk/.libs/libgdk-3.so: undefined reference to
> `cairo_region_destroy'
> ../../gdk/.libs/libgdk-3.so: undefined reference to
> `cairo_region_get_extents'
> ../../gdk/.libs/libgdk-3.so: undefined reference to
> `cairo_region_contains_point'
> /home/ya/mylibs/gtk3/lib/libcairo-gobject.so: undefined reference to
> `cairo_region_reference'
> ../../gdk/.libs/libgdk-3.so: undefined reference to
> `cairo_region_is_empty'
> ../../gdk/.libs/libgdk-3.so: undefined reference to
> `cairo_region_get_rectangle'
> ../../gdk/.libs/libgdk-3.so: undefined reference to
> `cairo_region_num_rectangles'
> ../../gdk/.libs/libgdk-3.so: undefined reference to
> `cairo_region_create_rectangles'
> /home/ya/mylibs/gtk3/lib/libcairo-gobject.so: undefined reference to
> `cairo_device_destroy'
> ../../gdk/.libs/libgdk-3.so: undefined reference to
> `cairo_region_translate'
> ../../gdk/.libs/libgdk-3.so: undefined reference to
> `cairo_region_subtract_rectangle'
> ../../gdk/.libs/libgdk-3.so: undefined reference to
> `cairo_region_contains_rectangle'
> ../../gdk/.libs/libgdk-3.so: undefined reference to
> `cairo_region_intersect'
> ../../gdk/.libs/libgdk-3.so: undefined reference to
> `cairo_region_subtract'
> ../../gdk/.libs/libgdk-3.so: undefined reference to
> `cairo_region_union'
> ../../gdk/.libs/libgdk-3.so: undefined reference to
> `cairo_region_create'
> ../../gdk/.libs/libgdk-3.s

Re: compile gtk 3 error

2011-07-22 Thread Jean Brefort
Strange, which cairo version do you have? You need at least 1.10.0. May
be you have several cairo versions and it does not link to the correct
one. Try make V=1 to check which is used.

Hope this helps,
Jan

Le vendredi 22 juillet 2011 à 15:59 +0400, Dmitry Shkirmanov a écrit :
> Hello, list, i am trying to compile gtk3 on debian squeeze. I followed 
> instructions at http://developer.gnome.org/gtk3/3.0/gtk-building.html . 
> All needed packages are installed, configure finished without errors. 
> But make gives:
> 
> 
> CC gdkwindowimpl.lo
>CC gdkenumtypes.lo
>CC gdkmarshalers.lo
>CCLD   libgdk-3.la
> make[4]: Leaving directory `/home/ya/mylibs/source/gtk+-3.0.11/gdk'
> Making all in tests
> make[4]: Entering directory `/home/ya/mylibs/source/gtk+-3.0.11/gdk/tests'
>CC gdk-color.o
>CCLD   gdk-color
> ../../gdk/.libs/libgdk-3.so: undefined reference to `cairo_region_destroy'
> ../../gdk/.libs/libgdk-3.so: undefined reference to 
> `cairo_region_get_extents'
> ../../gdk/.libs/libgdk-3.so: undefined reference to 
> `cairo_region_contains_point'
> /home/ya/mylibs/gtk3/lib/libcairo-gobject.so: undefined reference to 
> `cairo_region_reference'
> ../../gdk/.libs/libgdk-3.so: undefined reference to `cairo_region_is_empty'
> ../../gdk/.libs/libgdk-3.so: undefined reference to 
> `cairo_region_get_rectangle'
> ../../gdk/.libs/libgdk-3.so: undefined reference to 
> `cairo_region_num_rectangles'
> ../../gdk/.libs/libgdk-3.so: undefined reference to 
> `cairo_region_create_rectangles'
> /home/ya/mylibs/gtk3/lib/libcairo-gobject.so: undefined reference to 
> `cairo_device_destroy'
> ../../gdk/.libs/libgdk-3.so: undefined reference to `cairo_region_translate'
> ../../gdk/.libs/libgdk-3.so: undefined reference to 
> `cairo_region_subtract_rectangle'
> ../../gdk/.libs/libgdk-3.so: undefined reference to 
> `cairo_region_contains_rectangle'
> ../../gdk/.libs/libgdk-3.so: undefined reference to `cairo_region_intersect'
> ../../gdk/.libs/libgdk-3.so: undefined reference to `cairo_region_subtract'
> ../../gdk/.libs/libgdk-3.so: undefined reference to `cairo_region_union'
> ../../gdk/.libs/libgdk-3.so: undefined reference to `cairo_region_create'
> ../../gdk/.libs/libgdk-3.so: undefined reference to 
> `cairo_region_union_rectangle'
> /home/ya/mylibs/gtk3/lib/libcairo-gobject.so: undefined reference to 
> `cairo_device_reference'
> ../../gdk/.libs/libgdk-3.so: undefined reference to `cairo_region_copy'
> ../../gdk/.libs/libgdk-3.so: undefined reference to 
> `cairo_region_create_rectangle'
> ../../gdk/.libs/libgdk-3.so: undefined reference to 
> `cairo_surface_create_for_rectangle'
> ../../gdk/.libs/libgdk-3.so: undefined reference to 
> `cairo_region_intersect_rectangle'
> ../../gdk/.libs/libgdk-3.so: undefined reference to `cairo_region_equal'
> collect2: ld returned 1 exit status
> make[4]: *** [gdk-color] Error 1
> make[4]: Leaving directory `/home/ya/mylibs/source/gtk+-3.0.11/gdk/tests'
> make[3]: *** [all-recursive] Error 1
> make[3]: Leaving directory `/home/ya/mylibs/source/gtk+-3.0.11/gdk'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory `/home/ya/mylibs/source/gtk+-3.0.11/gdk'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/ya/mylibs/source/gtk+-3.0.11'
> make: *** [all] Error 2
> 
> 
> Is it possible to fix it?
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-list


___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Makefile for GTK2 programs?

2010-08-18 Thread Jean Brefort
Le mercredi 18 août 2010 à 10:26 +0300, Juhana Sadeharju a écrit :
> What CFLAGS and LIBS I should use in Makefiles?
> I installed GTK2 to home directory, and thus I won't use lddconfig.
> My programs should take all from ~/gtk2/, and nothing from
> /usr/include/gtk-1.2/ and nothing gtk-related from /usr/lib/.
> 
> GTK2 does not have gtk-config program. It made things easier
> in gtk1.2:
> 
>   CC=gcc -O2 -Wall
>   CFLAGS = `gtk-config --cflags`
>   LIBS= `gtk-config --libs` -lm -ljpeg -lpng
> 
> Is there away to get all CFLAGS and LIBS by checking the pkgconfig file?
>   ~/gtk2/lib/pkgconfig/gtk+-2.0.pc

CFLAGS=`PKG_CONFIG_PATH=~/gtk2/lib/pkgconfig:$PKG_CONFIG_PATH pkg-config 
--cflags gtk+-2.0`
LIBS=`PKG_CONFIG_PATH=~/gtk2/lib/pkgconfig:$PKG_CONFIG_PATH pkg-config --libs 
gtk+-2.0`

(you might have to replace ~ by the real path)

hope this helps,
regards,
Jean

> 
> I have now the following in Makefile. Very messy. It does not work;
> I get errors: undefined reference to `gtk_text_view_new' and the like.
> 
>   CC=gcc -O2 -Wall
>   CFLAGS= -I/home/juhana/gtk2/include/glib-2.0 
> -I/home/juhana/gtk2/include/gtk-2.0 -I/home/juhana/gtk2/lib/glib-2.0/include 
> -I/home/juhana/gtk2/include/cairo -I/home/juhana/gtk2/include/pango-1.0 
> -I/home/juhana/gtk2/lib/gtk-2.0/include -I/home/juhana/gtk2/include/atk-1.0
>   LIBS= -L/home/juhana/gtk2/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl 
> -lXi -lXext -lX11 -lm -ljpeg -lpng
> 
>   O_ESPBROWSER=mylib/filesdirs.o mylib/buffer.o mylib/image.o 
> mylib/gsl_taus.o mylib/clock.o mylib/mmapfile.o mylib/sprint.o mylib/arrays.o 
> espbrowser.o
> 
>   all:: espbrowser
> 
>   espbrowser: $(O_ESPBROWSER)
>   $(CC) $(CFLAGS) -o espbrowser $(O_ESPBROWSER) $(LIBS)
> 
> 
> I use this include command in the C code:
>   #include "/home/juhana/gtk2/include/gtk-2.0/gtk/gtk.h"
> I'm afraid it won't help because gtk.h uses
>   #include 
> which may be "/usr/include/gtk-1.2/gdk/gdk.h".
> 
> 
> How the linked ld works? My programs are simple. Perhaps I could
> write a script to compile and link everything explicitly. But this
> include file business worries me still.
> 
> This is so frustating. I will return to GTK 1.2 soon.
> First Ubuntu failed to install GTK2, and now this!
> 
> I could start writing my programs under demos/gtk-demo/ and compile
> the demo. But then I don't understand how to add my mylib/mmapfile.o
> etc. files to the configure system. :-(
> 
> Help needed.
> 
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-list


___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list