Re: Xlib-error in threaded GTK+

2000-06-05 Thread Tomas Berndtsson
Owen Taylor <[EMAIL PROTECTED]> writes: > > > I have had this problem aswell. > > > A second thread is writing to some shared memory that > > > the X thread reads. > > > > Well, it's not shm-memory in my case, but they do share memory areas, > > which has been allocated with malloc (not g_malloc

Different colours on different characters in a entry widget

2000-06-05 Thread Preben Randhol
Is it possible to set the colour of _one_ character different from the rest in a entry widget? I tried to use set_style before the character was appended, but then the whole text changed to the colour I had specified. -- Preben Randhol -- [[EMAIL PROTECTED]] --

Re: Using gtk_timeout_add with very short timeperiods (45 ms)

2000-06-05 Thread Erik Forsberg
>default unix system timer resolution is limited by the timer interrupt >frequency set by the kernel. On a conventional Linux box, that >defaults to 10ms. So, first of all, you will never get good results >unless your period is a multiple of 10ms. > [ ... ] This sounds like a good explanation to

Re: Using gtk_timeout_add with very short timeperiods (45 ms)

2000-06-05 Thread Paul Barton-Davis
>I'm trying to write a program that reads a hardware port every 45 ms, >it's a CID application with a piece of hardware attached to the >parallell port. >I guess another solution is to have a separate thread blocking on the >hardware. However, I'm still interested in the answer to the question ab

Re: Xlib-error in threaded GTK+

2000-06-05 Thread Owen Taylor
Tomas Berndtsson <[EMAIL PROTECTED]> writes: > Simon Burton <[EMAIL PROTECTED]> writes: > > > Hi, > > I have had this problem aswell. > > A second thread is writing to some shared memory that > > the X thread reads. > > Well, it's not shm-memory in my case, but they do share memory areas, > wh

Re: Xlib-error in threaded GTK+

2000-06-05 Thread Tomas Berndtsson
Simon Burton <[EMAIL PROTECTED]> writes: > Hi, > I have had this problem aswell. > A second thread is writing to some shared memory that > the X thread reads. Well, it's not shm-memory in my case, but they do share memory areas, which has been allocated with malloc (not g_malloc). Tomas _

Re: Xlib-error in threaded GTK+

2000-06-05 Thread Simon Burton
Hi, I have had this problem aswell. A second thread is writing to some shared memory that the X thread reads. just as stumped, Simon. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list

Re: GTK+ 1.2.8 doesn't seem to work.

2000-06-05 Thread Simon Burton
Hi Mikas, Looks like you need to install Xt, and probably some other things e.g. X11. Yes I know this is a bitch, I am having problems with various libs myself. You already run X, right? e.g. I have lots of files /usr/X11R6/lib/libXt* Simon. ___ gtk-l

GTK+ 1.2.8 doesn't seem to work.

2000-06-05 Thread Mikas
Hi, There seems to be one little problem, that prevents dumb users like me from using GTK+ (and all the other programs that require it) So it's like this: I've installed glib1.2.8 then launched GTK+1.2.8's "configure" file and got an error message saying that I don't have some X Libraries or Inclu

Xlib-error in threaded GTK+

2000-06-05 Thread Tomas Berndtsson
I've read the FAQ, and I've done what it suggests, but I still can't get rid of the "Xlib: unexpected async reply (sequence 0x)!". I have a program, where I first have a part which uses no GTK+ or X calls at all. In this first part, I create a thread, using pthread_create(). This thread runs

Re: Using gtk_timeout_add with very short timeperiods (45 ms)

2000-06-05 Thread Jiang XU
I am not quite sure about what your problem is, maybe you need to send some codes. But you maybe want to check: 1. the function that you made for the time out call back, whether you set the return value to 0. You must set the return value to 1 so that the call back function will be called aga

Using gtk_timeout_add with very short timeperiods (45 ms)

2000-06-05 Thread Erik Forsberg
I'm trying to write a program that reads a hardware port every 45 ms, it's a CID application with a piece of hardware attached to the parallell port. I tried having a gtk_timeout_add that runs a function every 45 ms, but it doesn't seem to work very well. The Clist I have in the program doesn't g

Re: C question

2000-06-05 Thread rlau
Bruce is right. You can shoot your foot more than one way. If you are using strncpy and your string printing function is dependent on a null terminated string, you better make sure the string you are copying is null terminated. My point is this, you can always points out the obvious but it'

Re: C question

2000-06-05 Thread Bruce Ide
[EMAIL PROTECTED] wrote: > > You should consider declaring your structure like that > > typedef struct a_item{ > g_char b[ MAX_G_CHAR_SIZE ]; > } A_ITEM; > > Use strcpy or iits equivalent to copy it. I think that's a good way to > do that because g_malloc will that allocate the right size for y

Re: C question

2000-06-05 Thread Thomas Mailund
> void some_function (...) { >item temp; > >temp.text = "Some text that the user defines and changes from time to > time"; >add_item(temp); ^^ You might want to avoid this. If 'item' is a simple as in this example it doesn't matter that much, but if it is

Re: C question

2000-06-05 Thread Bruce Ide
Thames wrote: > ... > The add_item function is declared in the same file, and in the same file > a global variable is defined, like this: > > GList *items; > > void add_item (item temp) { >item *item_pointer; >gint i; >gchar *temp_text; > >item_pointer = (item*)g_malloc(sizeof(i

Re: C question

2000-06-05 Thread Nicolas GEORGE
Thames, dans le message (.gtk.general:3215), a écrit : >for(i=0; i <= g_list_length(items) - 1; i++) { > item_pointer = g_list_nth_data(items, i); Warning: this part of code is quadratic: g_list_length and g_list_nth_data are linear and called n times. You should use: GList *temp_list;

Re: C question

2000-06-05 Thread Jiang XU
I guess the problem is about memory usage. You didn't malloc some space for the text. What you should do is : void some_function (...) { item temp; temp.text = g_malloc( SIZE ); strcpy( temp.text, ".." ); add_item(temp); } You cannot simply set a string to a pointer withou

Re: C question

2000-06-05 Thread rlau
You should consider declaring your structure like that typedef struct a_item{ g_char b[ MAX_G_CHAR_SIZE ]; } A_ITEM; Use strcpy or iits equivalent to copy it. I think that's a good way to do that because g_malloc will that allocate the right size for you. Your code did not allocate space for

C question

2000-06-05 Thread Thames
Hi... I have a question about general C. Cut down to the bone, the problem is: I have defined af structure: typedef struct { gchar *text; } item; In a function (a callback function) I define a variable of item and assigns a value to the member variable text: void some_function (...) { ite

RE: Having linker problems.

2000-06-05 Thread Arjan J. Molenaar
Do you have the glib-devel package installed? (and the gtk+-devel package...) Arjan > -Original Message- > From: John Lambert [mailto:[EMAIL PROTECTED]] > Sent: zondag 4 juni 2000 21:43 > To: [EMAIL PROTECTED] > Subject: Having linker problems. > > > Hi there, I just typed in the progr

Having linker problems.

2000-06-05 Thread John Lambert
Hi there, I just typed in the program that is in the book developing linux applications with GTK+ and GDK. I'm getting undefined linker errors for the functions g_set_error_handler, g_whatever_handler (s). This is the first program on pages 10,11, and 12. I was wondering if you could throw some

Getting the width of widgets

2000-06-05 Thread Rich Freeman
Hi folks, Reading the gtk source code is not helping me solve my current problem! I've got a hbox with a clist and vseperator in it. What I'd like to do is find out the width of the clist and the seperator so I can generate a pixmap to fit the remaing space. The clist can be empty, but it has a