[wxPython-users] ogl question
Tim Blechmann
tim at klingt.org
Thu Feb 22 10:33:25 PST 2007
ah, thanks a lot ... it's a good example to show me how to start ...
will play around with it and adapt it to my needs ...
thanks, tim
On Thu, 2007-02-22 at 10:52 -0600, Chris Mellon wrote:
> On 2/22/07, Tim Blechmann <tim at klingt.org> wrote:
> > hi all,
> >
> > i've got a probably simple ogl related question.
> >
> > is it possible to add simple widgets like TextCtrl or other non-trivial
> > widgets into an ogl.ShapeCanvas or even better into an
> > ogl.CompositeShape. i need connectable widgets on a canvas with an
> > embedded text widget, and i guess, that's the easiest way.
> >
> > any hints?
> >
>
> Attached is a sample of a text widget attached to an OGL object. It
> doesn't work very well:
>
> When you resize it smaller, you can't see the hint rect because it's
> drawn on the canvas, which is clipped under the text control.
>
> You can't move it, because you're clicking on the text control instead.
>
> The first I'm not sure how to fix - I'm not an expert on OGL
> internals. It's possible that you can override the hint rect drawing
> from within the Shape class, and create a client DC for the "inner"
> control instead.
>
> The second could be fixed if you had a control that didn't need to
> handle mouse events itself (you could redirect mouse clicks on the
> text control, but you'd lose text selection).
>
> So, for this specific purpose, I'd suggest using a standard OGL shape
> with text, and add a double-click handler that uses the techniques in
> the attached to position a newly created text control. You'll need to
> add some other bindings to "vanish" the text control when you're done
> (hitting return for single lines, loss of focus, clicking on the
> canvas or another control point).
>
> You could also extend the attached to place the text control in one
> region of a multi-region control, and the shape could still be moved
> by clicking on one of the other regions. The drawing problem still
> exists, though.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
--
tim at klingt.org ICQ: 96771783
http://www.mokabar.tk
Relying on the government to protect your privacy is like asking a
peeping tom to install your window blinds.
John Perry Barlow
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20070222/6fc1b5a5/attachment.pgp
More information about the wxpython-users
mailing list