First, to set up the motivation for this: I’m building a custom panel that will parse text which includes LaTeX equations and provide nicely wrapped text with the equations embedded in-line. I’ve already got some example code that uses matplotlib to produce a panel with the equation inside of it, now I just want to find a way to embed that panel into some sort of text control.
One possibility I considered was to convert the matplotlib panel into an image, and use richtextctrl to embed it, but this seems somewhat hackish. I’d also VERY MUCH like the ability to keep it as a panel, so I could, for example, bind some custom menus when you right-click on the equation panel.
If anyone can provide some pointers to get me started on either inheriting from richtextctrl and adding an “embed panel” method, or some other existing projects that do something similar to this, I’d greatly appreciate it.
Heck, this doesn’t need to be user editable, so if there’s a better way to create a text object that can fill and wrap around other panels, buttons, objects, etc, that would be great too. I’m not married to any one approach, I just need a way to embed a small panel inside of some text, keep the object on a single line of the text, and look good when you resize windows.
Any guidance would be greatly appreciated.
Thanks,
James
Just a slightly random suggestion but have you considered using a
HtmlWindow, webkit or something similar?
Gadget/Steve
···
On 27/02/2012 6:17 PM, James Davidheiser wrote:
First, to set up the motivation for this: I'm building a custom panel
that will parse text which includes LaTeX equations and provide nicely
wrapped text with the equations embedded in-line. I've already got
some example code that uses matplotlib to produce a panel with the
equation inside of it, now I just want to find a way to embed that
panel into some sort of text control.
One possibility I considered was to convert the matplotlib panel into
an image, and use richtextctrl to embed it, but this seems somewhat
hackish. I'd also VERY MUCH like the ability to keep it as a panel,
so I could, for example, bind some custom menus when you right-click
on the equation panel.
If anyone can provide some pointers to get me started on either
inheriting from richtextctrl and adding an "embed panel" method, or
some other existing projects that do something similar to this, I'd
greatly appreciate it.
Heck, this doesn't need to be user editable, so if there's a better
way to create a text object that can fill and wrap around other
panels, buttons, objects, etc, that would be great too. I'm not
married to any one approach, I just need a way to embed a small panel
inside of some text, keep the object on a single line of the text, and
look good when you resize windows.
Any guidance would be greatly appreciated.
Thanks,
James
--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en