[Gtk-sharp-list] Text input in drawing area
andy at brdstudio.net
Sun Jan 17 08:24:27 EST 2010
I do use a Fixed sometimes when I just want a child layout to appear a
certain way and I'm growing frustrated with my lack of skill in the
Gtk.Alignemnt properties. I sometimes wonder if I shouldn't use the
Fixed widget all the time but I have a suspicion that the majority of
the layout problems I have are from a lack of experience and over time I
will get good enough to control the layout without the need for the
I'm just suggesting that if you get too frustrated use a Fixed and fight
the learning curve another day.
On 1/17/2010 2:43 AM, Andy Selvig wrote:
> Okay, but does any of this offer benefits to simply using a Fixed?
> That seems like a simple and effective solution, but if there's a
> better way to do it then I'm interested...
> On Sun, Jan 17, 2010 at 12:43 AM, Michael Hutchinson
> <m.j.hutchinson at gmail.com> wrote:
>> On Mon, Jan 11, 2010 at 6:51 PM, Piotr Zurek<p.zurek at gmail.com> wrote:
>>> Hi Michael,
>>> On Tue, Jan 12, 2010 at 12:18, Michael Hutchinson
>>> <m.j.hutchinson at gmail.com> wrote:
>>>> It's perfectly possible to have a custom widget position a child entry
>>>> directly. You don't necessarily need the Fixed to do this for you.
>>> Any idea where I could find a bit more information on how to do it or
>>> maybe an example of a project that is doing it?
>> I can't think of any examples of exactly this, but the basic idea is
>> that you're just implementing a special container that only sometimes
>> shows its child and shows it at different positions.
>> Because you're only using the child in a very limited way, you can
>> probably just subclass Bin and stuff the child in that, so it does the
>> bulk of work of propagating mapping, realization, destroying, etc. to
>> the child. Then, on the expose event of your widget, you have to check
>> the child state depending on the state of your widget. You may have to
>> set its visible state, or give it a requisition if its position has
>> changed, then propagate the expose. Or you could subclass Alignment,
>> and use the xpad/ypad to handle the positioning. Then you'd just have
>> to handle giving your widget a GdkWindow and overriding the expose and
>> allocation like usual. Just make sure you make the PropagateExpose
>> calls so the child is exposed too.
>> Something like that, anyway.
>> I think the Medsphere GTK# widget have some containers written in
>> managed code you could look at.
>> Michael Hutchinson
> Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.432 / Virus Database: 270.14.147/2628 - Release Date: 01/17/10 07:35:00
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Gtk-sharp-list