wxStyledTextCtrl problem ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Robson

    #1

    wxStyledTextCtrl problem ?

    I have a wierd thing with a little editor app I'm writing.

    I'm using wxStyledTextCtr l ; the wrapper for Scintilla. When I create the
    frame in wxPython, I use self.Editor.Set Focus() to put the focus initially
    on the editor.

    This works fine.

    Odd thing is though, switching back and forwards between applications
    alternately hides and reappears the caret.

    Hit Alt-Tab twice and it disappears
    Hit Alt-Tab twice and it comes back.

    It still works fine - there's just no caret. I've tried various things in
    EVT_ACTIVATE including Moving the Caret on screen, and forcing it to be
    visible - they are being called but it makes no difference.

    Any ideas ?

  • Josiah Carlson

    #2
    Re: wxStyledTextCtr l problem ?


    Paul Robson <autismuk@autis muk.muralichuck s.freeserve.co. uk> wrote:[color=blue]
    >
    > I have a wierd thing with a little editor app I'm writing.
    >
    > I'm using wxStyledTextCtr l ; the wrapper for Scintilla. When I create the
    > frame in wxPython, I use self.Editor.Set Focus() to put the focus initially
    > on the editor.
    >
    > This works fine.
    >
    > Odd thing is though, switching back and forwards between applications
    > alternately hides and reappears the caret.
    >
    > Hit Alt-Tab twice and it disappears
    > Hit Alt-Tab twice and it comes back.
    >
    > It still works fine - there's just no caret. I've tried various things in
    > EVT_ACTIVATE including Moving the Caret on screen, and forcing it to be
    > visible - they are being called but it makes no difference.
    >
    > Any ideas ?[/color]

    I don't know why the problem you are having happens, but I would just
    make a call to self.Editor.Set Focus() on an EVT_ACTIVATE event.

    - Josiah

    Comment

    • Jean Brouwers

      #3
      Re: wxStyledTextCtr l problem ?



      If you are running GTK+ try using

      self.Editor.Set STCFocus(True)

      in addition to or instead of SetFocus(). Plus maybe

      wx.CallAfter(se lf.Editor.Ensur eCaretVisible)

      It solved the 'dissapearing caret' problem for our application.


      /Jean Brouwers



      In article
      <pan.2004.11.28 .12.10.30.74527 @autismuk.mural ichucks.freeser ve.co.uk>,
      Paul Robson <autismuk@autis muk.muralichuck s.freeserve.co. uk> wrote:
      [color=blue]
      > I have a wierd thing with a little editor app I'm writing.
      >
      > I'm using wxStyledTextCtr l ; the wrapper for Scintilla. When I create the
      > frame in wxPython, I use self.Editor.Set Focus() to put the focus initially
      > on the editor.
      >
      > This works fine.
      >
      > Odd thing is though, switching back and forwards between applications
      > alternately hides and reappears the caret.
      >
      > Hit Alt-Tab twice and it disappears
      > Hit Alt-Tab twice and it comes back.
      >
      > It still works fine - there's just no caret. I've tried various things in
      > EVT_ACTIVATE including Moving the Caret on screen, and forcing it to be
      > visible - they are being called but it makes no difference.
      >
      > Any ideas ?
      >[/color]

      Comment

      • Jean Brouwers

        #4
        Re: wxStyledTextCtr l problem ?


        Here is the recent thread about this particular problem:

        <http://lists.wxwidgets.org/cgi-bin/e...:200410:lfppnf
        okhnlgfialpfdh>

        /Jean Brouwers


        In article <29112004001154 6030%mrjean1ATc omcastDOTnet@no .spam.net>,
        Jean Brouwers <mrjean1ATcomca stDOTnet@no.spa m.net> wrote:
        [color=blue]
        > If you are running GTK+ try using
        >
        > self.Editor.Set STCFocus(True)
        >
        > in addition to or instead of SetFocus(). Plus maybe
        >
        > wx.CallAfter(se lf.Editor.Ensur eCaretVisible)
        >
        > It solved the 'dissapearing caret' problem for our application.
        >
        >
        > /Jean Brouwers
        >
        >
        >
        > In article
        > <pan.2004.11.28 .12.10.30.74527 @autismuk.mural ichucks.freeser ve.co.uk>,
        > Paul Robson <autismuk@autis muk.muralichuck s.freeserve.co. uk> wrote:
        >[color=green]
        > > I have a wierd thing with a little editor app I'm writing.
        > >
        > > I'm using wxStyledTextCtr l ; the wrapper for Scintilla. When I create the
        > > frame in wxPython, I use self.Editor.Set Focus() to put the focus initially
        > > on the editor.
        > >
        > > This works fine.
        > >
        > > Odd thing is though, switching back and forwards between applications
        > > alternately hides and reappears the caret.
        > >
        > > Hit Alt-Tab twice and it disappears
        > > Hit Alt-Tab twice and it comes back.
        > >
        > > It still works fine - there's just no caret. I've tried various things in
        > > EVT_ACTIVATE including Moving the Caret on screen, and forcing it to be
        > > visible - they are being called but it makes no difference.
        > >
        > > Any ideas ?
        > >[/color][/color]

        Comment

        • Paul Robson

          #5
          Re: wxStyledTextCtr l problem ?

          On Sun, 28 Nov 2004 23:43:32 -0800, Josiah Carlson wrote:
          [color=blue]
          > I don't know why the problem you are having happens, but I would just
          > make a call to self.Editor.Set Focus() on an EVT_ACTIVATE event.[/color]

          Tried that, it doesn't work :(

          Or to be precise, it works every other time :)

          Comment

          • Paul Robson

            #6
            Re: wxStyledTextCtr l problem ?

            On Mon, 29 Nov 2004 08:10:18 +0000, Jean Brouwers wrote:
            [color=blue]
            > If you are running GTK+ try using
            >
            > self.Editor.Set STCFocus(True)
            >
            > in addition to or instead of SetFocus(). Plus maybe
            >
            > wx.CallAfter(se lf.Editor.Ensur eCaretVisible)
            >
            > It solved the 'dissapearing caret' problem for our application.[/color]

            Thanks - that worked perfectly !

            Comment

            Working...