[Gtk-sharp-list] Canvas
Parrish M Myers
parrishmyers@yahoo.com
Sun, 24 Nov 2002 08:09:20 -0800 (PST)
Hi,
I wonder if anyone could help me. I am tring to make a little
application using the Glade and Gnome with gtk# and mono.
I'm not sure this is a problem... but I would like to know what I am
doing wrong... What I am tring to do is set the CanvasText.TextWidth
property. So, like any of the other properties I am tring to set the
'TextWidth' to "200"... I am assuming this works because becuase I can
set 'X' and 'Y' and 'Size' this way. Here is my snippet of code:
59 ...
60 CanvasText textItem = new CanvasText(canvas.Root());
61 textItem.X = 124;
62 textItem.Y = 49;
63 textItem.Text = "00:00:00";
64
65 textItem.TextWidth = 25;
66 ...
But line 65 produces the error:
(SwTimer:3456): GnomeCanvas-WARNING **: gnome-canvas-text.c:1072:
invalid property id 40 for "text-width" of type `GParamDouble' in
`GnomeCanvasText'
I'm not sure what this means, so I replaced line 65 with:
64 ...
65 textItem.Size = 32700;
66 while (textItem.TextWidth > 200) {
67 textItem.Size -= 100;
68 }
69 ...
and I get the desired effect. It is just uggly code that needlessly
complicates the code and affects the runtime (I have to guess the
initial Size close to the iterated number otherwise the program sits
there for a long time untils the size is determined.
If this is really a problem, should I file a bug? I'm really not sure
though, hence this email.
Thanks
Parrish
=====
-----------------------------------------------------------
Academia is a little like child | Parrish M. Myers
rearing, it provides a chance at | The Wacked Jester
immortality without the stretch | parrishmyers@yahoo.com
marks -- (unknown source) |
-----------------------------------------------------------
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus – Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com