Re: Nary trees

2002-10-08 Thread etienne buxin



--- Eric M. Monsler [EMAIL PROTECTED] wrote:
 etienne buxin wrote:
  hi,
  
  i'd like to use a structure similar to glib's Nary tree, but with the difference 
that many
 parent
  nodes can share one or several children nodes.
  any clue?
 
 
 This is going to be rather difficult.
 
 Unless you enforce a policy that only sibling-nodes can share child 
 nodes, you are going to have a lot of trouble.  Even then, any trivial 
 operation on a child node (e.g., remove from tree) will require 
 searching over the full set of parent-siblings and checking the child 
 pointers against the full set of siblings for the child-node.
 
 Don't do it.
 
 If a fellow developer at work suggested such a data-storage approach, I 
 would require a tone of convincing that this was a reasonable thing to do.
 
 If you do, I strongly suggest that you do not base it off of the current 
 glib n-ary tree implimentation.  At a minimum, I would enforce a policy 
 that a node has a numbered depth N, that all children are depth N+1 and 
 parents are N-1.  This may seem obvious, but in a multi-parent scenario 
 it would be easy to violate if moving a set of nodes within the tree.
 
 A suggested structure:
 
 struct eb_manymany {
uint   node_level;
uint   num_parents;
uint   num_par_max;
struct eb_manymany **par_ptr_array;
uint   num_children;
uint   num_child_max;
struct eb_manymany **chd_ptr_array;
gpointer   data;
 }
 
 That lets you reference count the parents and children, so that, for 
 example, when removing a node you can go to all the parents and remove 
 that child from their list of children.
 
 The _max allows dynamix allocation of the pointer arrays, if you 
 previously allocated space for 12 children and need a 13th, you can 
 reallocate that array up to size 24 or somthing, with 13 places occupied.
 
 If the above doesn't make sense after a few readings, you're not ready 
 to tackle this.  I have done a two-level parent-child that was 
 many-to-many, where entities were by definitions either parents or 
 children, and by the time I had the appropriate API and error checking 
 all in place it was very cumersome.
 
 For example, what policy do you generically implement if a the last 
 parent of a node is freed?  In my application, that meant that the child 
 was now a discard and could be freed, but that may or may not be 
 appropriate for a generic storage library.  Specify a calllback for the 
 child node in that situation, defaulting to freeing?  Complexity!
 
 If you do get it working as infinite level many-to-many, please post the 
 code. :)
 
 Eric
 

hello,

in fact, i'd like to create a structure to represent events.  i investigated trees 
because i need
a parent-child relationship between events, with the parent event being a consequence 
of his child
events.  Because one event may have several consequences, it must be able to have many 
parents (of
different depht levels, moreover). i could duplicate the child for each of his 
parents, but this
is not too good, because each event has _a lot_ of info carried with ( *data in glib's 
Nary tree)
and this will consume a lot of ressources.

has someone an idea?

thanks,
E.


__
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos  More
http://faith.yahoo.com
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: Cannot find a rule to create target all-local from dependencies

2002-10-08 Thread Owen Taylor


Paul Kent Anderson [EMAIL PROTECTED] writes:

 Trying to install xfce on AIX, which requires atk, glib, pango, gtk,
 etc. make (for all of them) complains about all-local missing
 
 I found a reference to this in the archives, and the solution then was
 to use make -k to continue building on Solaris 2.8. This would resolve
 out of order dependencies. Unfortunately, it's not working for
 me. Anybody know what's going on? I checked the Makefile, and sure
 enough, there isn't an all-local. Did ./configure miss something?

Using GNU make is recommended; while the GTK+ (etc.) makefiles will
work with some non-GNU makes, there will be problems with others.

See:

 http://developer.gnome.org/doc/API/2.0/gtk/gtk-building.html

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



Re: Problems with compiling Pango 1.0.4

2002-10-08 Thread Owen Taylor


Broich [EMAIL PROTECTED] writes:

 Hello,
 
 I have a big Problem with compiling the Pango-1.0.4 to make the gtk+-2.0.
 However  I will compile with the command make I get the following Error:
 
 querymodules.o: In function `main':
 /home/hbroich/Uninst/GTK/pango-1.0.4/pango/querymodules.c:175:
 undefined reference to `pango_config_key_get'
 /home/hbroich/Uninst/GTK/pango-1.0.4/pango/querymodules.c:177:
 undefined reference to `pango_get_lib_subdirectory'
 /home/hbroich/Uninst/GTK/pango-1.0.4/pango/querymodules.c:184:
 undefined reference to `pango_split_file_list'
 collect2: ld returned 1 exit status
 make[3]: *** [pango-querymodules] Fehler 1
 make[3]: Verlassen des Verzeichnisses Verzeichnis
 »/home/hbroich/Uninst/GTK/pango-1.0.4/pango«
 make[2]: *** [all-recursive] Fehler 1
 make[2]: Verlassen des Verzeichnisses Verzeichnis
 »/home/hbroich/Uninst/GTK/pango-1.0.4/pango«
 make[1]: *** [all-recursive] Fehler 1
 make[1]: Verlassen des Verzeichnisses Verzeichnis
 »/home/hbroich/Uninst/GTK/pango-1.0.4«
 make: *** [all-recursive-am] Fehler 2
 
 There are alle the needed *.h files
 Can someone help me or is there any Idea for my Problem ?

You don't have the freetype and XFree86 header files installed. (Pango-1.0.5
will produce a better error messsage in this situation.)

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



Re: Can't configure

2002-10-08 Thread Owen Taylor


Paul Thomas [EMAIL PROTECTED] writes:

 Hi,
 
 I'm trying to compile glib-2.0.6 and get the following  error:
 
 checking for iconv_open... no
 checking for libiconv_open in -liconv... no
 checking for iconv_open in -liconv... no
 configure: error: *** No iconv() implementation found in C library or
 libiconv
 
 
 
 What do I need to update here?

http://developer.gnome.org/doc/API/2.0/gtk/gtk-building.html says:

  The GNU libiconv library (http://www.gnu.org/software/libiconv/) is
  needed to build GLib if your system doesn't have the iconv()
  function for doing conversion between character encodings. Most
  modern systems should have iconv(). 

Regards,
Owen




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



Re: GTK+2.0.6 problem with Freetype

2002-10-08 Thread Owen Taylor


[EMAIL PROTECTED] (Paulo J. Matos) writes:

  
 Hi,
 
  You should look at the config.log file to see the exact error messages
  that were generated. The most likely possibility is that the
  freetype-config from /usr/local/bin was being used, but the linker
  found the libraries in /usr/X11R6/lib ... you may well simply
  want to delete (make a backup first):
  
   /usr/X11R6/bin/freetype-config
   /usr/X11R6/lib/libfreetype.so*
   
 
 I've done that, same situation happens. Now:
 pdestroy@localhost:~/gnome-2.0.2rc1/gtk+-2.0.6$ which freetype-config
 /usr/local/bin/freetype-config
 pdestroy@localhost:~/gnome-2.0.2rc1/gtk+-2.0.6$ freetype-config --version
 9.1.3
 
 I'm compiling it with gcc2.95.3, can that be the situation?

I don't think so.

 configure:14393: found /usr/local/bin/freetype-config
 configure:14406: result: /usr/local/bin/freetype-config
 configure:14417: checking for FT_New_Face in -lfreetype
 configure:14450: gcc -o conftest -g -O2 -Wall   conftest.c -lfreetype -L/usr/loc
 al/lib -lfreetype   5
 configure:14453: $? = 0
 configure:14456: test -s conftest
 configure:14459: $? = 0
 configure:14470: result: yes
 configure:14484: checking For sufficiently new FreeType (at least 2.0.1)
 configure:14508: gcc -c -g -O2 -Wall  -I/usr/local/include -I/usr/local/include/
 freetype2 conftest.c 5
 configure:14489: `#include' expects FILENAME or FILENAME

This indicates that there is a problem with the freetype configuration on
your system; I'd try removing all traces of freetype and then installing
it fresh.

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



joysticks and joypads

2002-10-08 Thread Marco Lettere


is there a way to handle joystick/joypad input using gdk input device
api (Gtk 1.2)? or do I have to look somewhere else?

thanx,
M.


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



Re: GTK+2.0.6 problem with Freetype

2002-10-08 Thread Paulo J. Matos

Working great now, thanks!

 [EMAIL PROTECTED] (Paulo J. Matos) writes:
 
   
  Hi,
  
   You should look at the config.log file to see the exact error messages
   that were generated. The most likely possibility is that the
   freetype-config from /usr/local/bin was being used, but the linker
   found the libraries in /usr/X11R6/lib ... you may well simply
   want to delete (make a backup first):
   
/usr/X11R6/bin/freetype-config
/usr/X11R6/lib/libfreetype.so*

  
  I've done that, same situation happens. Now:
  pdestroy@localhost:~/gnome-2.0.2rc1/gtk+-2.0.6$ which freetype-config
  /usr/local/bin/freetype-config
  pdestroy@localhost:~/gnome-2.0.2rc1/gtk+-2.0.6$ freetype-config --version
  9.1.3
  
  I'm compiling it with gcc2.95.3, can that be the situation?
 
 I don't think so.
 
  configure:14393: found /usr/local/bin/freetype-config
  configure:14406: result: /usr/local/bin/freetype-config
  configure:14417: checking for FT_New_Face in -lfreetype
  configure:14450: gcc -o conftest -g -O2 -Wall   conftest.c -lfreetype -L/usr/loc
  al/lib -lfreetype   5
  configure:14453: $? = 0
  configure:14456: test -s conftest
  configure:14459: $? = 0
  configure:14470: result: yes
  configure:14484: checking For sufficiently new FreeType (at least 2.0.1)
  configure:14508: gcc -c -g -O2 -Wall  -I/usr/local/include -I/usr/local/include/
  freetype2 conftest.c 5
  configure:14489: `#include' expects FILENAME or FILENAME
 
 This indicates that there is a problem with the freetype configuration on
 your system; I'd try removing all traces of freetype and then installing
 it fresh.
 
 Regards,
 Owen
 ___
 gtk-list mailing list
 [EMAIL PROTECTED]
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

-- 
Paulo J. Matos : pocm(_at_)mega.ist.utl.pt
Instituto Superior Tecnico - Lisbon
Software  Computer Engineering - A.I.
 -  http://mega.ist.utl.pt/~pocm 
 ---
Yes, God had a deadline...
So, He wrote it all in Lisp!

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



Re: Nary trees

2002-10-08 Thread Eric M. Monsler

etienne buxin wrote:
 
 --- Eric M. Monsler [EMAIL PROTECTED] wrote:

A suggested structure:

struct eb_manymany {
   uint   node_level;
   uint   num_parents;
   uint   num_par_max;
   struct eb_manymany **par_ptr_array;
   uint   num_children;
   uint   num_child_max;
   struct eb_manymany **chd_ptr_array;
   gpointer   data;
}

(snip)
 
 in fact, i'd like to create a structure to represent events.  i investigated trees 
because i need
 a parent-child relationship between events, with the parent event being a 
consequence of his child
 events.  Because one event may have several consequences, it must be able to have 
many parents (of
 different depht levels, moreover). i could duplicate the child for each of his 
parents, but this
 is not too good, because each event has _a lot_ of info carried with ( *data in 
glib's Nary tree)
 and this will consume a lot of ressources.
 
 has someone an idea?


The structure I proposed above should handle it, just remove the 
node-level.  Do you really mean that consequences are *parents* of 
events, not *children* of events?  My family tree reads differently, but 
whatever.

Let me call them causes and consequences, rather than parents and children.

If your set of operations is fairly limited, you should be OK.  For 
example, if the API was only Add(with list of causes and consequences 
pointers) and Remove(severing all cause/consequence, and also removing 
all unconnected nodes caused), it shouldn't be too complex.  Might be OK 
for creating a user-traversable set of nodes for a visualization exercise.

But, attempting to traverse the mesh is going to be a really tough problem.

Good luck.

Eric

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



Compile Error Using Gtk with C++. Urgent.

2002-10-08 Thread Thomas Scott



I have searched 
everywhere and cannot find a simple example of how to successfully compile a 
.cpp (or .cc) file that includes gnome.h and has Gtk code. The 
most basic example of a working program that compiles with c 
is:

gcc `gtk-config 
--libs` `gtk-config --cflags` -o hello hello.c
If I try the 
following:

g++ `gtk-config 
--libs` `gtk-config --cflags` -o hello hello.cpp

It complains that it 
cannot find gome.h. Does anyone know what the trick is to making 
this basic example work?

Tom


Re: Compile Error Using Gtk with C++. Urgent.

2002-10-08 Thread Sven Neumann

Hi,

Thomas Scott [EMAIL PROTECTED] writes:

 I have searched everywhere and cannot find a simple example of how to
 successfully compile a .cpp (or .cc) file that includes gnome.h and has
 Gtk code.  The most basic example of a working program that compiles with c
 is:
  
 gcc `gtk-config --libs` `gtk-config --cflags` -o hello hello.c
 
 If I try the following:
  
 g++ `gtk-config --libs` `gtk-config --cflags` -o hello hello.cpp
  
 It complains that it cannot find gome.h.  Does anyone know what the trick
 is to making this basic example work?

if it has GNOME code, use gnome-config instead of gtk-config. If it
only uses GTK+ functions, include gtk/gtk.h instead of gnome.h.


Salut, Sven

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



Trying to configure/compile glib-2.0.6

2002-10-08 Thread Paul Thomas


Hi,

I got through my other hoops but while tyring to ./configure
on my Linux box (older install), the configure script gets
to this point then quits:

checking for working alloca.h... (cached) yes
checking for alloca... (cached) yes
checking for atexit... yes
checking for on_exit... yes
checking for char... yes
checking size of char... configure: error: cannot compute sizeof (char), 77


Anyone know what I might need to address to 'compute sizeof (char)'?

Thanks,

--Paul



--
William J. Broad: The crux... is that the vast majority of the mass
of the universe seems to be missing.


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



Cursor for gtkentry

2002-10-08 Thread Ian King [ES]

Hi all,

Is it possible to change the cursor for a GtkEntry widget,  for an
application I have I need to display a wait cursor while background
processing commences, however when the mouse pointer is hovering over the
text entry the cursor changes to the caret cursor even though I have
explicitly set it beforehand to an hourglass cursor.

Any help is much appreciated.

Thanks

IEK

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



double click problem in treeview (Gtk+-2)

2002-10-08 Thread Mathias Nudge Hartwig


Dear List Members!

I have a problem when I try to catch a double
click signal on a GtkTreeView widget.

When I double click nodes without personally
added callback code, nothing happens. That's OK.

I want to add callback code so that I open an
dialog which allows data manipulation
on the chosen tree entry.
Everything's fine until I close the dialog
and move the mouse pointer into the tree view.
Then the entry is suddenly in drag-and-drop mode.

I tried to catch the release event to block this,
but this didn't work. The double click event
chain is press-release-press-2press-release.
So I wonder: IF the tree handles double clicks
on default, why does the drag-and-drop mode
turns on AFTER my dialog appears and how can
I prevent it? I checked if I returned FALSE
somewhere so the event may be propagated further,
but I think I did right.
Could anybody give a hint?

Here's some code from my callback function:

// if it is a double click
if ((event-button==1)  ((event-type 
 GDK_2BUTTON_PRESS)==GDK_2BUTTON_PRESS)) {
// handle double clicks
...
return TRUE;
}

// prevent single clicks
if (event-button==1) return FALSE;

// else call context menu
...
return TRUE;
}


Thanks and Greetings

-- 
Mathias Nudge Hartwig
http://www.trans-japan.de/mathias

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



Re: Problems with compiling Pango 1.0.4

2002-10-08 Thread Fam. Broich



Owen Taylor wrote:


You don't have the freetype and XFree86 header files installed. (Pango-1.0.5
will produce a better error messsage in this situation.)

Regards,
Owen

Thanks; now Pango will be compiled but there is another Problem with XFree86
When I start the configure-script i get the following Error / Warning:
   checking for X ... no
   configure: WARNING x development libraries not found.
The Programm Pango always compiled without any error by the command 
make install
My Question:
Where can i get the developement libraries or what is the path to this 
lib, because when I run the configure - script of the gtk+ with the 
compiled pango-1.0.4 i get the following error:
   pangox PANGO backend is required for X11 target
and the configure script stops. :-[

Regards,
 Hartmut

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



Forcing size_allocate?

2002-10-08 Thread The Surprises

Greetings,

I have a gnome_canvas packed into a vbox.  All drawing in the canvas is
connected to a size_allocate event because I need to know the width and
height of the area before drawing.  This works great, however upon
initial startup, I get a blank screen until I manually resize the window
to cause a size_allocate event to occur.  Is there any way to force a
size_allocate manually to get the canvas drawn by default?  I tried
emitting a size_allocate event, but this produced bogus width and height
numbers.

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



Gtk2.1.0 with X11 problem

2002-10-08 Thread Paulo J. Matos


Hi all,

I downloaded sources from gnome of Gtk2.1.0 and I was installing
it.
I installed atk, glib, pango and while making gtk2.1.0 I got:
gcc -g -O2 -g -Wall -Wl,--export-dynamic -o .libs/gtk-query-immodules-2.0 
queryimmodules.o -Wl,--export-dynamic  -L/usr/local/lib ./.libs/libgtk-x11-2.0.so 
/home/pdestroy/gnome2.1.0/gtk+-2.1.0/gdk/.libs/libgdk-x11-2.0.so -L/usr/X11/lib 
/usr/local/lib/libatk-1.0.so ../gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so 
../gdk/.libs/libgdk-x11-2.0.so 
/home/pdestroy/gnome2.1.0/gtk+-2.1.0/gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so -lXinerama 
-lXft -lXrender -lXext -lX11 /usr/local/lib/libfreetype.so 
/usr/local/lib/libpangoxft-1.0.so /usr/local/lib/libpangox-1.0.so 
/usr/local/lib/libpango-1.0.so /usr/local/lib/libgobject-2.0.so 
/usr/local/lib/libgmodule-2.0.so -ldl /usr/local/lib/libglib-2.0.so -lm -Wl,--rpath 
-Wl,/usr/local/lib
/home/pdestroy/gnome2.1.0/gtk+-2.1.0/gdk/.libs/libgdk-x11-2.0.so: undefined reference 
to `XftDrawPicture'
collect2: ld returned 1 exit status
make[3]: *** [gtk-query-immodules-2.0] Error 1
make[3]: Leaving directory `/home/pdestroy/gnome2.1.0/gtk+-2.1.0/gtk'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/pdestroy/gnome2.1.0/gtk+-2.1.0/gtk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/pdestroy/gnome2.1.0/gtk+-2.1.0'
make: *** [all-recursive-am] Error 2

Any ideas of what this might be about?

Best regards,
-- 
Paulo J. Matos : pocm(_at_)mega.ist.utl.pt
Instituto Superior Tecnico - Lisbon
Software  Computer Engineering - A.I.
 -  http://mega.ist.utl.pt/~pocm 
 ---
Yes, God had a deadline...
So, He wrote it all in Lisp!

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



Re: Forcing size_allocate?

2002-10-08 Thread Paul Davis

I have a gnome_canvas packed into a vbox.  All drawing in the canvas is
connected to a size_allocate event because I need to know the width and
height of the area before drawing.  

don't do this. a size allocate will always be followed by an expose
event. all drawing must be done from the expose event handler, always.
just store the width and height in the size allocate handler for later
use. if for some reason, the expose event is really missing, use
gtk_widget_queue_draw() to cause one to occur soon.

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



RH 8.0 widget realized error

2002-10-08 Thread Scott Merritt


I recently installed RedHat 8.0 (GNOME) and am now receiving a large number of errors 
similar to those listed below.  Any help in identifying/correcting this problem would 
be most appreciated.  Thanks, Scott.

(nautilus:1253): Gtk-CRITICAL **: file gtkwidget.c: line 2933 (gtk_widget_event): 
assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(nautilus:1371): Gtk-CRITICAL **: file gtkwidget.c: line 2933 (gtk_widget_event): 
assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(gnome-panel:1369): Gtk-CRITICAL **: file gtkwidget.c: line 2933 (gtk_widget_event): 
assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

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