[Glade-users] Gtk Curve problem



--0218-1234-57-PART-BREAK
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

Thanks for your help.
I have been looking at the GTK code (gtkcurve.c and 
gtkcurve.h) and I think I could find out where the problem
is and fixed it. I have just made a copy of the object 
called "gtk_my_curve" and correct it. I send you attached 
at this message the code just in case some of you wants to 
know what�s up and/or use it. Fortunately, the solution was 
very simple (it is commented on the gtk_my_curve.c file).
I have used this code and seems to be OK.
Am I to send it to the GTK developer team...???
Most cordially.

Prof. Oscar Pablo Di Liscia
Director
Carrera de Composici�n con Medios Electroac�sticos
Universidad Nacional de Quilmes
http://www.unq.edu.ar/cme/personales/odiliscia
Te. 4365-7119 / 7122
FAX 4365-7120
Roque Saenz Pe�a 180
1876 - Bernal (Provincia de Buenos Aires)
Argentina


-----Original Message-----
From: Damon Chaplin <damon karuna uklinux net>
To: Oscar Pablo Di Liscia <odiliscia unq edu ar>
Cc: "glade-users ximian com" <glade-users ximian com>
Date: 30 Jan 2003 18:36:33 +0000
Subject: Re: [Glade-users] Gtk Curve problem

On Tue, 2003-01-28 at 17:50, Oscar Pablo Di Liscia wrote:
Hi all:

I am using the gtk_gamma_curve Widget and each time I
run 
my program I get the following error:

Glib-Error: Could not allocate -20 bytes

I get also the same error that I get using the
gtk_curve 
(instead of the gamma) and attempting to change the
curve 
type (using the gtk_curve_change_type) to
GTK_CURVE_LINEAR.

I know that gtk_curve and gtk_gamma_curve are not
Widgets 
widely used, but anyway may be most handy for my
purpouses. 
Any help on this will be most appreciated.
Most cordially

Yes, this is a known problem with GtkCurve. In fact I
removed the Type
property in recent versions of Glade to avoid it.

There may be a way to work around the problem, e.g. by
making sure you
set a certain vector of points before changing the curve
type. But I'm
not sure.

Damon

--0218-1234-57-PART-BREAK
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="my_curve.c"

LyoNCm15X2N1cnZlLmMNCk9zY2FyIFBhYmxvIERpIExpc2NpYSAob2Rpb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vaW50W2ldWzFdID0NCgkJdW5wcm9qZWN0IChSQURJVVMgKyBoZWlnaHQgLSBjLT5wb2lu
dFt4XS55LA0KCQkJICAgYy0+bWluX3ksIGMtPm1heF95LCBoZWlnaHQpOw0KCSAgICB9DQoJICBj
LT5jdXJ2ZV90eXBlID0gbmV3X3R5cGU7DQoJICBndGtfbXlfY3VydmVfaW50ZXJwb2xhdGUgKGMs
IHdpZHRoLCBoZWlnaHQpOw0KCX0NCiAgICAgIGVsc2UNCgl7DQoJICBjLT5jdXJ2ZV90eXBlID0g
bmV3X3R5cGU7DQoJICBndGtfbXlfY3VydmVfaW50ZXJwb2xhdGUgKGMsIHdpZHRoLCBoZWlnaHQp
Ow0KCX0NCiAgICAgIGd0a19zaWduYWxfZW1pdCAoR1RLX09CSkVDVCAoYyksIGN1cnZlX3R5cGVf
Y2hhbmdlZF9zaWduYWwpOw0KICAgICAgZ3RrX215X2N1cnZlX2RyYXcgKGMsIHdpZHRoLCBoZWln
aHQpOw0KICAgIH0NCn0NCi8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCi8q
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCi8qKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKi8NCg0Kc3RhdGljIHZvaWQNCmd0a19teV9jdXJ2ZV9zaXplX2dyYXBo
IChHdGtNeUN1cnZlICpteV9jdXJ2ZSkNCnsNCiAgZ2ludCB3aWR0aCwgaGVpZ2h0Ow0KICBnZmxv
YXQgYXNwZWN0Ow0KDQogIHdpZHRoICA9IChteV9jdXJ2ZS0+bWF4X3ggLSBteV9jdXJ2ZS0+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dXJ2ZV9nZXRfdHlwZSAoKSk7DQp9DQoNCnN0YXRpYyB2b2lkDQpndGtfbXlfY3VydmVf
ZmluYWxpemUgKEd0a09iamVjdCAqb2JqZWN0KQ0Kew0KICBHdGtDdXJ2ZSAqbXlfY3VydmU7DQoN
CiAgZ19yZXR1cm5faWZfZmFpbCAob2JqZWN0ICE9IE5VTEwpOw0KICBnX3JldHVybl9pZl9mYWls
IChHVEtfSVNfTVlfQ1VSVkUgKG9iamVjdCkpOw0KDQogIG15X2N1cnZlID0gR1RLX01ZX0NVUlZF
IChvYmplY3QpOw0KICBpZiAobXlfY3VydmUtPnBpeG1hcCkNCiAgICBnZGtfcGl4bWFwX3VucmVm
IChteV9jdXJ2ZS0+cGl4bWFwKTsNCiAgaWYgKG15X2N1cnZlLT5wb2ludCkNCiAgICBnX2ZyZWUg
KG15X2N1cnZlLT5wb2ludCk7DQogIGlmIChteV9jdXJ2ZS0+Y3RscG9pbnQpDQogICAgZ19mcmVl
IChteV9jdXJ2ZS0+Y3RscG9pbnQpOw0KDQogICgqR1RLX09CSkVDVF9DTEFTUyAocGFyZW50X2Ns
YXNzKS0+ZmluYWxpemUpIChvYmplY3QpOw0KfQ0K

--0218-1234-57-PART-BREAK
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="my_curve.h"

LyoNCm15X2N1cnZlLmgNCg0KVGhlIEd0a19NeV9DdXJ2ZSBXaWRnZXQgaXMgb25seSBhbiAiYWxp
YXMiIG9mIHRoZSBvcmlnaW5hbCBHdGtfQ3VydmUgb25lIGJ5IHRoZSBHSU1QIFRlYW0uDQpJIGFt
IGp1c3QgdHJ5aW5nIHRvIGZpeCBzb21lIGJ1Z3Mgb2YgaXQuLi4NCiovDQoNCiNpZm5kZWYgX19H
VEtfTVlfQ1VSVkVfSF9fDQojZGVmaW5lIF9fR1RLX01ZX0NVUlZFX0hfXw0KDQojaW5jbHVkZSA8
Z2RrL2dkay5oPg0KDQojaWZkZWYgX19jc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