Simple HTML WYSIWYG editor

The scrolling isn't the issue, and I probably need to add the panels to the
AUI pane manager. The text pane scrolls fine in my real application.

What I am trying to do is make the rich text box act like the normal text
box. On my machine, the rich text box (in this application and in my real
application) sort of freezes until I stop updating it, and then it updates
all at once with the scroll bar at the top. The normal text box updates
immediately and scrolls downwards like a log viewer. Do you see the same
effect?

Thanks.

Carl

···

-----Original Message-----
From: wxpython-users-bounces+s7plc=ttlc.net@lists.wxwidgets.org
[mailto:wxpython-users-bounces+s7plc=ttlc.net@lists.wxwidgets.org] On Behalf
Of Mike Driscoll
Sent: Monday, 8. December 2008 15:42
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] TextCtrl vs. RichTextCtrl

Mario Lacunza wrote:

2008/12/7 Carl <s7plc@ttlc.net <mailto:s7plc@ttlc.net>>

    Hello Robin,

    Yes, I tried both types of RichText, with the same results. Also,
    I forgot
    to mention that the OS is XP Pro, I'm using the latest version of
    wxPython,
    and my project is based on the AUI_Manager.

    I'm not intentionally blocking the event loop. For now, everything is
    running in the main thread (to put these pseudo-dialogs in
    separate threads
    is a future task, but not necessary now). It works fine with the
    TextCtrl.

    I've attached some code that shows exactly what I'm experiencing.
    The app
    starts with two buttons, and they create panes with normal text
    and rich
    text. I'm not using a timer to slow down the updates, but there
    are enough
    lines to see that the normal text display updates with each new
    line and
    always scrolls to the last line. The rich text pane doesn't update
    at all
    until all lines are appended, and the scroll position is at the top. I
    noticed that neither panel will scroll, but that doesn't happen in
    my real
    application, and can be ignored.

    Thanks for taking a look.

    Carl

I test your app but I cant see any difference between both.. only the
richttext button take a little more time to charge, but in both we can
scroll to the bottom with no problem or odd behavior.

I use Ubuntu 8.10, Python 2.5.2 and wxPython 2.8.9.1

--
Saludos / Best regards

Mario Lacunza
Software Architect - Webmaster

Email: mlacunza [AT] gmail [DOT] com
http://www.lacunza.info
Lima - Peru

It definitely does not scroll on Windows XP. Unfortunately, I don't know
enough about AUI and / or nested panels to understand why...so I'm not
sure which is causing the issue or if that even is the issue. Hmmm

Mike
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Carl,

The scrolling isn't the issue, and I probably need to add the panels to the
AUI pane manager. The text pane scrolls fine in my real application.

What I am trying to do is make the rich text box act like the normal text
box. On my machine, the rich text box (in this application and in my real
application) sort of freezes until I stop updating it, and then it updates
all at once with the scroll bar at the top. The normal text box updates
immediately and scrolls downwards like a log viewer. Do you see the same
effect?

Thanks.

Carl
  

<snip>

Yes, I do. If I add a wx.Yield() after the AppendText(), you can see items get added to the text box. I noticed in some of my applications where I redirect text to a multiline TextCtrl, I use the wx.HSCROLL style rather than the wx.VSCROLL style. And no, I don't know why I started doing that. I must have gotten it from some other example...

You might be able to work around the issue by messing with the SetInsertionPointEnd() command or just SetInsertionPoint(). Both of these are methods of a TextCtrl.

···

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org

Yes

···

2008/12/8 Carl s7plc@ttlc.net

The scrolling isn’t the issue, and I probably need to add the panels to the

AUI pane manager. The text pane scrolls fine in my real application.

What I am trying to do is make the rich text box act like the normal text

box. On my machine, the rich text box (in this application and in my real

application) sort of freezes until I stop updating it, and then it updates

all at once with the scroll bar at the top. The normal text box updates

immediately and scrolls downwards like a log viewer. Do you see the same

effect?

Thanks.

Carl

-----Original Message-----

From: wxpython-users-bounces+s7plc=ttlc.net@lists.wxwidgets.org

[mailto:wxpython-users-bounces+s7plc=ttlc.net@lists.wxwidgets.org] On Behalf

Of Mike Driscoll

Sent: Monday, 8. December 2008 15:42

To: wxpython-users@lists.wxwidgets.org

Subject: Re: [wxpython-users] TextCtrl vs. RichTextCtrl

Mario Lacunza wrote:

2008/12/7 Carl <s7plc@ttlc.net mailto:s7plc@ttlc.net>

Hello Robin,
Yes, I tried both types of RichText, with the same results. Also,
I forgot
to mention that the OS is XP Pro, I'm using the latest version of
wxPython,
and my project is based on the AUI_Manager.
I'm not intentionally blocking the event loop. For now, everything is
running in the main thread (to put these pseudo-dialogs in
separate threads
is a future task, but not necessary now). It works fine with the
TextCtrl.
I've attached some code that shows exactly what I'm experiencing.
The app
starts with two buttons, and they create panes with normal text
and rich
text. I'm not using a timer to slow down the updates, but there
are enough
lines to see that the normal text display updates with each new
line and
always scrolls to the last line. The rich text pane doesn't update
at all
until all lines are appended, and the scroll position is at the top. I
noticed that neither panel will scroll, but that doesn't happen in
my real
application, and can be ignored.
Thanks for taking a look.
Carl

I test your app but I cant see any difference between both… only the

richttext button take a little more time to charge, but in both we can

scroll to the bottom with no problem or odd behavior.

I use Ubuntu 8.10, Python 2.5.2 and wxPython 2.8.9.1

Saludos / Best regards

Mario Lacunza

Software Architect - Webmaster

Email: mlacunza [AT] gmail [DOT] com

http://www.lacunza.info

Lima - Peru

It definitely does not scroll on Windows XP. Unfortunately, I don’t know

enough about AUI and / or nested panels to understand why…so I’m not

sure which is causing the issue or if that even is the issue. Hmmm

Mike


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users


Saludos / Best regards

Mario Lacunza
Software Architect - Webmaster

Email: mlacunza [AT] gmail [DOT] com
http://www.lacunza.info

Lima - Peru

Ahh, much better. Wx.Yield took care of half the problem. I can start
playing around with the insertion points now.

Thanks very much Mike, and everyone else.

Carl

···

-----Original Message-----
From: wxpython-users-bounces@lists.wxwidgets.org
[mailto:wxpython-users-bounces@lists.wxwidgets.org] On Behalf Of Mike
Driscoll
Sent: Monday, 8. December 2008 16:15
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] TextCtrl vs. RichTextCtrl

Carl,

The scrolling isn't the issue, and I probably need to add the panels to

the

AUI pane manager. The text pane scrolls fine in my real application.

What I am trying to do is make the rich text box act like the normal text
box. On my machine, the rich text box (in this application and in my real
application) sort of freezes until I stop updating it, and then it updates
all at once with the scroll bar at the top. The normal text box updates
immediately and scrolls downwards like a log viewer. Do you see the same
effect?

Thanks.

Carl
  

<snip>

Yes, I do. If I add a wx.Yield() after the AppendText(), you can see
items get added to the text box. I noticed in some of my applications
where I redirect text to a multiline TextCtrl, I use the wx.HSCROLL
style rather than the wx.VSCROLL style. And no, I don't know why I
started doing that. I must have gotten it from some other example...

You might be able to work around the issue by messing with the
SetInsertionPointEnd() command or just SetInsertionPoint(). Both of
these are methods of a TextCtrl.

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Building on some previous posts, I've attached some code that includes a
"close" button on a floating pane. The event fires, but I can't seem to get
only the pane to close. I just want it to do exactly what it does when I
click on the "x" on the pane (meaning, it just closes the pane, and doesn't
actually delete it).

I thought this would be easy, but I'm missing something. Either nothing
happens, or the entire application closes.

Thanks.

Carl

AUI_Test_02.py (2.54 KB)

Hi,
did you mean something like:

    def OnClose(self, event):
        print 'CLOSED'
        self._mgr.GetPane("Print Text").Hide()
        self._mgr.Update()

or is it something more complex?

vbr

···

2008/12/9 Carl <s7plc@ttlc.net>:

Building on some previous posts, I've attached some code that includes a
"close" button on a floating pane. The event fires, but I can't seem to get
only the pane to close. I just want it to do exactly what it does when I
click on the "x" on the pane (meaning, it just closes the pane, and doesn't
actually delete it).

I thought this would be easy, but I'm missing something. Either nothing
happens, or the entire application closes.

Thanks.

Carl

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Thank you, it works perfectly.

I can't believe I didn't try that. It never occurred to me that clicking the
'x' is just hiding the pane instead of closing and destroying it.

Thanks again.

Carl

···

-----Original Message-----
From: wxpython-users-bounces@lists.wxwidgets.org
[mailto:wxpython-users-bounces@lists.wxwidgets.org] On Behalf Of Vlastimil
Brom
Sent: Tuesday, 9. December 2008 12:04
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] Closing AUI Pane

2008/12/9 Carl <s7plc@ttlc.net>:

Building on some previous posts, I've attached some code that includes a
"close" button on a floating pane. The event fires, but I can't seem to

get

only the pane to close. I just want it to do exactly what it does when I
click on the "x" on the pane (meaning, it just closes the pane, and

doesn't

actually delete it).

I thought this would be easy, but I'm missing something. Either nothing
happens, or the entire application closes.

Thanks.

Carl

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hi,
did you mean something like:

    def OnClose(self, event):
        print 'CLOSED'
        self._mgr.GetPane("Print Text").Hide()
        self._mgr.Update()

or is it something more complex?

vbr
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Carl wrote:

Hello Robin,

Yes, I tried both types of RichText, with the same results. Also, I forgot
to mention that the OS is XP Pro, I'm using the latest version of wxPython,
and my project is based on the AUI_Manager.

I'm not intentionally blocking the event loop. For now, everything is
running in the main thread (to put these pseudo-dialogs in separate threads
is a future task, but not necessary now). It works fine with the TextCtrl.

You've already discovered wx.Yield, but I should mention that in your sample you *are* blocking the main event loop with your while loops. In other words, events can not be processed while the loop is running for the rich ctrl. The non-rich ctrl appears to work because the native widget is doing the equivalent of a Refresh and Update, but you'll also notice that it's a lot slower because of that.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Sounds good. I wasn't aware that the textctrl was doing an automatic
refresh.

That said, in your opinion, am I using the right tool for the job? I have
played around with the listctrl, and in Report Mode that could give a
similar effect, and the user wouldn't know the difference. I'm always open
to suggestions.

Thanks.

Carl

···

-----Original Message-----
From: wxpython-users-bounces@lists.wxwidgets.org
[mailto:wxpython-users-bounces@lists.wxwidgets.org] On Behalf Of Robin Dunn
Sent: Wednesday, 10. December 2008 19:49
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] TextCtrl vs. RichTextCtrl

Carl wrote:

Hello Robin,

Yes, I tried both types of RichText, with the same results. Also, I forgot
to mention that the OS is XP Pro, I'm using the latest version of

wxPython,

and my project is based on the AUI_Manager.

I'm not intentionally blocking the event loop. For now, everything is
running in the main thread (to put these pseudo-dialogs in separate

threads

is a future task, but not necessary now). It works fine with the TextCtrl.

You've already discovered wx.Yield, but I should mention that in your
sample you *are* blocking the main event loop with your while loops. In
other words, events can not be processed while the loop is running for
the rich ctrl. The non-rich ctrl appears to work because the native
widget is doing the equivalent of a Refresh and Update, but you'll also
notice that it's a lot slower because of that.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

I'm having a problem changing the caption of a pane. In the attached code, I
change the caption after the text is finished printing, but it never seems
to update. I've tried various settings in the AddPane properties, but
couldn't seem to get any further.

There are actually another problem I don't understand as well. One, it never
displays a caption at all until I click on "x" to close the print pane. I
thought my OnClose event did the same thing as the "x", but apparently not.

My print statements show that the caption is changing, and I'm calling the
self._mgr.Update. These are at lines 35-51.

What am I doing wrong?

Thanks.

Carl

AUI_Test_02.py (2.9 KB)

Hi,
I'm not sure about the reason, but your code works fine, when you dock
the text pane, however, for the floating one the caption isn't
updated.

adding the following lines to OnPrintText it "works", but it seems
quite hackish to me:

self._mgr.GetPane(self.Button.PaneName).Caption('Printing Done')
self._mgr.GetPane(self.Button.PaneName).Dock()
self._mgr.Update() # also not working without an intermediate Update()
self._mgr.GetPane(self.Button.PaneName).Float()
self._mgr.Update()

greetings
   vbr

···

2008/12/13 Carl <s7plc@ttlc.net>:

I'm having a problem changing the caption of a pane. In the attached code, I
change the caption after the text is finished printing, but it never seems
to update. I've tried various settings in the AddPane properties, but
couldn't seem to get any further.

There are actually another problem I don't understand as well. One, it never
displays a caption at all until I click on "x" to close the print pane. I
thought my OnClose event did the same thing as the "x", but apparently not.

My print statements show that the caption is changing, and I'm calling the
self._mgr.Update. These are at lines 35-51.

What am I doing wrong?

Thanks.

Carl

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hey, good catch. That never occurred to me.

Upon further experimentation, I found that if I leave the "hack" out, the
caption will change when I manually dock it, so it's definitely related to
that somehow. I tried tweaking other properties momentarily to trigger a
caption change, but no-go.

I'll go forward with using this hack for now. There is a "flicker" when the
pane refreshes, but other than that it works fine.

Maybe Robin or someone can elaborate on if there is a different way.

Thanks for your help.

Carl

···

-----Original Message-----
From: wxpython-users-bounces@lists.wxwidgets.org
[mailto:wxpython-users-bounces@lists.wxwidgets.org] On Behalf Of Vlastimil
Brom
Sent: Saturday, 13. December 2008 19:49
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] Changing AUI Pane caption

2008/12/13 Carl <s7plc@ttlc.net>:

I'm having a problem changing the caption of a pane. In the attached code,

I

change the caption after the text is finished printing, but it never seems
to update. I've tried various settings in the AddPane properties, but
couldn't seem to get any further.

There are actually another problem I don't understand as well. One, it

never

displays a caption at all until I click on "x" to close the print pane. I
thought my OnClose event did the same thing as the "x", but apparently

not.

My print statements show that the caption is changing, and I'm calling the
self._mgr.Update. These are at lines 35-51.

What am I doing wrong?

Thanks.

Carl

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hi,
I'm not sure about the reason, but your code works fine, when you dock
the text pane, however, for the floating one the caption isn't
updated.

adding the following lines to OnPrintText it "works", but it seems
quite hackish to me:

self._mgr.GetPane(self.Button.PaneName).Caption('Printing Done')
self._mgr.GetPane(self.Button.PaneName).Dock()
self._mgr.Update() # also not working without an intermediate Update()
self._mgr.GetPane(self.Button.PaneName).Float()
self._mgr.Update()

greetings
   vbr
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users