Re: Compoilation error

2003-01-28 Thread Chris Nystrom
On Tue, 28 Jan 2003, Michal 'Gleba' Ziemski wrote:

> Your linker is not able to find the requirded GTK libs.
> 
> Run gtk-config --libs --cflags and check if the paths are correct
> (I belive gtk-config is a wrapper to pkg-config for GTK??)
> If not you'll have to edit your .pc files (most probably they are
> in /usr/lib-pkg-config)
> 
> If this seems fine, check your library paths (/etc/ld.so.config - or sth
> like that
> don't remember for sure right now) and add your gtk lib path if required.
> 
> run ldconfig -v and check if the gtk libs are listed

Actually ldconfig is operating system specific. For Solaris it is crle.

Chris


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



RE: Compoilation error

2003-01-28 Thread Chris Nystrom
On Tue, 28 Jan 2003, Joaquin Henriquez Alzola (REE) wrote:

> I have this for:
> # gtk-config --libs --cflags
> -I/opt/sfw/include/gtk-1.2 -I/opt/sfw/include/glib-1.2 -I/opt/sfw/lib/glib/include 
>-I/usr/openwin/include
> -L/opt/sfw/lib -L/usr/openwin/lib -R/usr/openwin/lib -lgtk -lgdk -lgmodule -lglib 
>-ldl -lXext -lX11 -lsocket -lnsl -lm
> #
> 
> I think that from here I can see that -lgmodule is not specifiued in the path and 
>when I do a serach for the *.pc
> # find / -name "*.pc"
> /var/glib-2.2.0/glib-2.0.pc
> /var/glib-2.2.0/glib-2.0-uninstalled.pc
> /var/glib-2.2.0/gmodule-2.0.pc
> /var/glib-2.2.0/gmodule-2.0-uninstalled.pc
> /var/glib-2.2.0/gthread-2.0.pc
> /var/glib-2.2.0/gthread-2.0-uninstalled.pc
> /var/glib-2.2.0/gobject-2.0.pc
> /var/glib-2.2.0/gobject-2.0-uninstalled.pc
> /usr/local/lib/pkgconfig/glib-2.0.pc
> /usr/local/lib/pkgconfig/gobject-2.0.pc
> /usr/local/lib/pkgconfig/gmodule-2.0.pc
> /usr/local/lib/pkgconfig/gthread-2.0.pc
> /opt/sfw/lib/pkgconfig/gdk.pc
> /opt/sfw/lib/pkgconfig/gtk+.pc

It looks like you have more than one version on your system. gtk-config is
reporting glib-1.2 and yet your find is reporting glib-2.2.0.

Perhaps you are using the wrong version of gtk-config? Do a "which
gtk-config" and make sure it corresponds with the one you want to use.

My guess would be that glib-1.2 is installed in /opt/sfw and glib-2.2 is
installed in /usr/local, so you would want to use
/usr/local/bin/gtk-config instead of /opt/sfw/bin/gtk-config.

Hope this helps,
Chris


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: Is GTK for me?

2002-12-29 Thread Chris Nystrom
On Sun, 29 Dec 2002, Honza wrote:

> I need to develop an application and therefore need a GUI that suits the
> following needs. I have hardly any expiriencwith Linux and don't have it
> installed. 
> 
> - win32 fullscreen / directx preferably

You might consider SDL (http://www.libsdl.org) instead of directx.

Chris


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: Gtk+ 2 binaries for Solaris?

2002-12-16 Thread Chris Nystrom
On Mon, 16 Dec 2002, Jarek Dukat wrote:

> Are there Gtk+ 2 and related libs officially available for Solaris 8/9,
> preferably as packages ready to install in system?

You might try http://www.sun.com/gnome. I assume they are included.

Chris


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: newbie's question - it's urgent .

2002-07-17 Thread Chris Nystrom

On 17 Jul 2002, Sven Neumann wrote:

> Chris Nystrom <[EMAIL PROTECTED]> writes:
> 
> > You might try using a loop and repeatedly call the expose event handler.
> > Not sure what you do if this is not fast enough.
> 
> you should never call an expose event handler directly since this
> would mean that you draw outside an expose event. Instead you should
> use gtk_widget_queue_draw() to generate an expose_event.

Yes, poor wording on my part. Sorry.

Chris


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: newbie's question - it's urgent .

2002-07-17 Thread Chris Nystrom

On Wed, 17 Jul 2002, simith nambiar wrote:

> hi list,
>  I am trying to draw RGB images on to the
> window, iam grabbing a frame once and displaying it in
> the expose event handler, this is ok when i do it for
> the first time , but what if i need to do it
> continiously ?
>is there any method i can use?

You might try using a loop and repeatedly call the expose event handler.
Not sure what you do if this is not fast enough.

Chris


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: GTK for windown

2002-06-14 Thread Chris Nystrom

On Sat, 15 Jun 2002, Small Din Don wrote:

> Where WEB site have information for windows GTK.

You might try:

  http://www.gimp.org/~tml/gimp/win32/

Good luck,
Chris


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: gtk_paint_string future

2002-06-05 Thread Chris Nystrom

On 5 Jun 2002, Daniel Elstner wrote:

> I just can't stand it.  That's so damn egoistic.  Yes, I honestly hope
> others will be able to help you with the performance problems.  But
> performance reasons just can't be taken as an excuse for not using
> Unicode.

If the performance is unacceptable, then the performance is unacceptable.
If reducing the target user base is the only way the programmer can get
his or her app to work to their standard, then that is their decision. If
this is an open source project, you are free to improve it if you want.

Either the library has to be sped up, or if it is a problem with the
person writing the code, then the documentation needs to improve. Don't
shoot the messenger. This is valuable feedback.

My $0.02,
Chris


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: About drawing primitives

2002-05-29 Thread Chris Nystrom

On Wed, 29 May 2002, Esteban Quijano wrote:

> How can I use gdk drawing primitives with arbitrary colors, instead of using
> the typical 'widget->style->...' found in most sample code.

You need to create your own graphics context.
 
> I'd like for example to do something like:
> 
> gdk_draw_rectangle(
>   widget->window,
>   /* DarkViolet */  <
>   TRUE, 0, 0,
>   widget->allocation.width,
>   widget->allocation.height);
> 
> How can I pass a DarViolet or LightGreen GdkGC to the drawing primitive
> function?

Below is the example scribble program modified to use blue instead of
black.
 
> How can I use specific RGB values such as RGB(128, 32, 41)?

I use something like this:

void
color_foreground_set(int red, int green, int blue)
{
  color_fg.red = red * 255;
  color_fg.green = green * 255;
  color_fg.blue = blue * 255;

  gdk_color_alloc(colormap, &color_fg);

  gdk_gc_set_foreground(gc, &color_fg);
}

So all you would have to do is call like this:

color_foreground_set(128, 32, 41);

Hope this helps,
Chris

--
/* example-start scribble-simple scribble-simple.c */

/* GTK - The GIMP Toolkit
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh
 *   MacDonald
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#include 

/* Backing pixmap for drawing area */
static GdkPixmap *pixmap = NULL;

static GdkColormap *colormap = NULL;
static GdkGC *gc = NULL;
static GdkColor color_fg;

/* Create a new backing pixmap of the appropriate size */
static gint configure_event( GtkWidget *widget,
 GdkEventConfigure *event )
{
  if (pixmap)
gdk_pixmap_unref(pixmap);

  pixmap = gdk_pixmap_new(widget->window,
  widget->allocation.width,
  widget->allocation.height,
  -1);

  gdk_draw_rectangle (pixmap,
  widget->style->white_gc,
  TRUE,
  0, 0,
  widget->allocation.width,
  widget->allocation.height);

  if (gc != NULL)
gdk_gc_unref(gc);

  if (colormap == NULL)
  {
colormap = gdk_colormap_get_system();
gc = gdk_gc_new(widget->window);
  }

  gdk_color_parse("blue", &color_fg);

  gdk_color_alloc(colormap, &color_fg);

  gdk_gc_set_foreground(gc, &color_fg);

  return TRUE;
}

/* Redraw the screen from the backing pixmap */
static gint expose_event( GtkWidget  *widget,
  GdkEventExpose *event )
{
  gdk_draw_pixmap(widget->window,
  widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
  pixmap,
  event->area.x, event->area.y,
  event->area.x, event->area.y,
  event->area.width, event->area.height);

  return FALSE;
}

/* Draw a rectangle on the screen */
static void draw_brush( GtkWidget *widget,
gdoublex,
gdoubley)
{
  GdkRectangle update_rect;

  update_rect.x = x - 5;
  update_rect.y = y - 5;
  update_rect.width = 10;
  update_rect.height = 10;
  gdk_draw_rectangle (pixmap,
  gc,
  TRUE,
  update_rect.x, update_rect.y,
  update_rect.width, update_rect.height);
  gtk_widget_draw (widget, &update_rect);
}

static gint button_press_event( GtkWidget  *widget,
GdkEventButton *event )
{
  if (event->button == 1 && pixmap != NULL)
draw_brush (widget, event->x, event->y);

  return TRUE;
}

static gint motion_notify_event( GtkWidget *widget,
 GdkEventMotion *event )
{
  int x, y;
  GdkModifierType state;

  if (event->is_hint)
gdk_window_get_pointer (event->window, &x, &y, &state);
  else
{
  x = event->x;
  y = event->y;
  state = event->state;
}

  if (state & GDK_BUTTON1_MASK && pixmap != NULL)
draw_brush (widget, x, y);

  return TRUE;
}

void quit ()
{
  gtk_exit (0);
}

int main( int   argc,
  char *argv[] )
{
  GtkWidget *window;
  GtkWidget *drawing_area;
  GtkWidget *vbox;

  GtkWidget *button;

  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_set_name (window, "Test Inpu

Re: suid

2002-05-29 Thread Chris Nystrom

On Wed, 29 May 2002, [iso-8859-1] Monserrat Seisdedos Nuñez wrote:

> I'm trying to write a program that modifies the crontab file of a user,
> these files are readable only by root, so as gtk can't iniciate bit suid
> programs, how can i carry out my goal???

system("crontab -l > mycron.dat");

...

system("crontab mycron.dat");

Chris


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: help on plotting the image from a webcam!!!

2002-05-23 Thread Chris Nystrom

On Thu, 23 May 2002, simith nambiar wrote:

>  iam newbie for linux as well as gtk, and i
> wanted to develop an application (VOIP) for my
> project.
> I have a webcam from which i would be grabbing frames 
> ,so can i plot the data on a drawing board or any
> componenet of gtk, In case it is possible could u plz
> tell me what to use and how to do it.

Here is a small demo of how to display an image using Gtk+ 1.x and Imlib.
I ended up using gdk-pixbuf instead, but do not have a handy demo program
of that.

Chris

--
/*
 *
 *  show-it.c
 *
 */

#include 
#include 
#include 

gint
delete_window(GtkWidget *widget)
{
  return(FALSE);
}

gint
destroy_window(GtkWidget *window, gpointer data)
{
  gtk_main_quit();
  return(FALSE);
}

int main(int argc, char *argv[])
{
  GtkWidget *window;
  GtkWidget *event_box;
  GtkWidget *gtk_pixmap;
  GdkPixmap *pixmap;
  GdkImlibImage *image;
  gint width, height;

  if (argc<=1)
  {
printf("Usage:\n %s image_file\n",argv[0]);
exit(1);
  }

  gtk_init(&argc, &argv);

  gdk_imlib_init();
  gtk_widget_push_visual(gdk_imlib_get_visual());
  gtk_widget_push_colormap(gdk_imlib_get_colormap());

  image = gdk_imlib_load_image(argv[1]);

  width = image->rgb_width;
  height = image -> rgb_height;

  gdk_imlib_render(image, width, height);
  pixmap = gdk_imlib_move_image(image);

  event_box = gtk_event_box_new();

  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

  gtk_pixmap = gtk_pixmap_new(pixmap, NULL);

  gtk_window_set_default_size(GTK_WINDOW(window), 700, 700);

  gtk_signal_connect (GTK_OBJECT (window), "delete_event",
GTK_SIGNAL_FUNC (delete_window), NULL);

  gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (destroy_window), NULL);

  gtk_container_add (GTK_CONTAINER(event_box), gtk_pixmap);
  gtk_container_add (GTK_CONTAINER(window), event_box);

  gtk_widget_show (gtk_pixmap);
  gtk_widget_show (event_box);
  gtk_widget_show(window);

  gtk_main();

  return 0;
}


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: Problems with gtk+2.0.2

2002-05-20 Thread Chris Nystrom

On Mon, 20 May 2002, [EMAIL PROTECTED] wrote:

> Long story short, I can't get anything to compile. It keeps telling me
> it can't find whatever.h and the list is very long As if it isn't linked
> correctly.

What platform? Did you install it yourself? Were there any errors in
the install? Are you compiling by hand, or are you using a Makefile?

Chris


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: PHPIZE

2002-05-17 Thread Chris Nystrom

On Fri, 17 May 2002, John Mozurkewich wrote:

> Can anyone tell me where I can find PHPIZE? 
> When trying to run ./buildconf I get this error:
> 
> sh: phpize:  not found
> *** Error code 127 (bu21)

Perhaps from here:

  http://www.php.net/downloads.php

Chris


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: Is there a canvas widget

2002-05-16 Thread Chris Nystrom

On 16 May 2002, Havoc Pennington wrote:

> The issue has nothing to do with ego, it's just a question of whether
> GnomeCanvas is the right thing for GTK. At the moment it doesn't
> really have the desired design, and it's also fairly buggy, at least
> in the 2.0 version. There's no point rushing it in to GTK, it's easy
> to use in the separate library. Just add "libgnomecanvas-2.0" to your
> PKG_CHECK_MODULES line and you're in business.

Interesting. What is the design now, compared to the desired design? Just
curious. What are the design changes that need to be made?

So basically you are saying is that the reason it is not included, is
that the quality is not there, yet.

Chris

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: Is there a canvas widget

2002-05-16 Thread Chris Nystrom

On Thu, 16 May 2002, Matthias Clasen wrote:

> See http://bugzilla.gnome.org/show_bug.cgi?id=79286

If there are no dependencies on gnome why not just d/l it and sed
's/gnome/gtk/g' ? and then post it somewhere, or am I missing something?

Chris

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: Is there a canvas widget

2002-05-15 Thread Chris Nystrom

On Wed, 15 May 2002, Paul Davis wrote:

> as an avid user of GtkCanvas, i would encourage you to move to GTK+2,
> and then use GnomeCanvas from GNOME 2. In this release of GNOME, the
> Canvas has *no* GNOME-related dependencies other than those shared by
> GTK+ (glib, ATK, Pango). You can use it in its own library without
> any of the rest of GNOME. The only thing you have to put up with is
> the "Gnome" prefix to the name. This is much better solution,
> especially since there are several useful bug fixes and redesigns in
> the GnomeCanvas.

Why not just move it to Gtk+ then, so one does not have to install Gnome
to use it? Or perhaps provide it as a separate package? Just curious.

Chris


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: gtk+2.0 installation on Windows

2002-05-01 Thread Chris Nystrom

On Wed, 1 May 2002, Edgarg wrote:

> Please, I need very detailed instructions on how to install this program
> and compile a program with gcc, step by step. I´ll appreciate your
> collaboration a lot.

I have not tried it myself, but you might want to check out this recently
announced project:

  http://wingtk.sourceforge.net/

Chris


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



RE: glib request

2002-04-26 Thread Chris Nystrom

On Fri, 26 Apr 2002, Campbell, Matthew A wrote:

> Can MinGW even create DLLs?  I didn't know gcc could output shared objects
> in the DLL specification.  It'd be really cool if it could...

Yes.

See _How to Create a dll_ at http://www.mingw.org/docs.shtml

and

  http://www.nanotech.wisc.edu/%7Ekhan/software/gnu-win32/dllhelpers.html

Chris


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: text on a pixmap

2002-04-12 Thread Chris Nystrom

On Fri, 12 Apr 2002, Jean-Yves Lamoureux wrote:

> I'm looking for a way to print some text ON a pixmap.
> Imagine I've a window, with a background pixmap.
> How can I print text on it ? 

You draw the pixmap in the expose event:

gint expose_event( GtkWidget  *widget,
  GdkEventExpose *event )
{
  GdkPixmap *pixmap;

  pixmap = pixmap_get();

  gdk_draw_pixmap(widget->window,
  widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
  pixmap,
  event->area.x, event->area.y,
  event->area.x, event->area.y,
  event->area.width, event->area.height);

  return FALSE;
}

You can use the gdk_draw_string to get text to the pixmap:

  gdk_draw_string(pixmap, font, gc, x, y, s);

And you can use the gtk_wdiget_queue_draw() function to emit an expose
signal:

  gtk_widget_queue_draw(w);

Hope that helps.

Chris



___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: Sockets

2002-03-13 Thread Chris Nystrom

On Tue, 12 Mar 2002, Paul Davis wrote:

> GTK is a toolkit for creating graphical user interfaces. It has
> nothing to do with sockets or other IPC mechanisms, though it has some
> builtin support to make integrating I/O handling a little simpler. I
> think you need to look at another library that is focussed on this
> area, not GTK.

He might run into problems when trying to integrate the socket IO with
the gtk_main function that never returns. He needs to become familiar
with monitoring the IO (14.2 in the tutorial, I think), or how to avoid
using the gtk-main function.

Chris


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: Communication

2000-12-04 Thread Chris Nystrom x8269

On Fri, 1 Dec 2000, Florent. Devin wrote:

> I want to know which is the easiest way to connect to program ?
> You have two programs that runs separately, and have to connect there
> I/O. Is there a better way to do this in Gnome/Gtk than doing this by
> IPC ?
> I need to have the easiest way to do this. I mean that I do not want
> eavy code modification.

If you get any good answers please summarize, or at least send me e-mail.
I need this same capability.

I want to layer my application on top of ssh, but I am not sure how to
open a program read/write. Thinking IPC was the only way I have been
trying to unstand how I might accomplish what I need to do in that way.

I know you can do either read, or write with popen, but not both.

Solaris has a command pipe(), that appears to be bi-directional, but it is
not clear to me how to use it from the man page.

Still working on it...

Thanks,
Chris



___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list