Re: Aligning widgets adjacent to a drawing area...

David J. Singer wrote:

I have the "text label" elements on the left hand side in a table already.
The sole drawing area on the righthand side is a separate entity though.
The problem is how to relate the positions of the widgets in the table to coordinates in the adjacent drawing area.

It's not easy to explain :-)

Oh, OK, I see. There's a single DrawingArea... Unless you can split it up, I think the best is to let GTK+ lay out the text labels and then check the allocation for the text widgets in your DrawingArea exposure handler (that is, at the time you actually do the drawing) for whatever position and size GTK+ has chosen for them. That way, you'd make sure that you don't interfere with font size, possible wrapping and other layout decisions taking place in the label column, possibly dynamically.
I'd still put the DrawingArea into the table with a suitable row span.

gtk_widget_translate_coordinates() with values from each of the text labels allocation's and the DrawingArea as the destination should do the job, I guess.

Christer Palm

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]