in reply to Eliminate blinking cursor from text widget

If you add -state => readonly to a normal Entry widget, it both stops it being edited and prevents the insertion cursor (blinking vertical bar) being shown.

It might have the same effect on a ROText widget too, but you don't need that if you set normal entry widgets readonly.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Replies are listed 'Best First'.
Re^2: Eliminate blinking cursor from text widget
by chessgui (Scribe) on Jan 14, 2012 at 13:37 UTC
    Thanks a lot.

    I also wonder which is the easiest way to determine the field on which I have clicked in terms of _text_ x and y coordinates.

    $board_text->bind('<Button-1>',\&click_handler); sub click_handler { my $click_x=... my $click_y=... #do sg. whith x,y }


    What should ... be? (I admit that I haven't dome my research on that one yet.)

      If you do the bind like this:

      $ef1->bind( '<Button-1>', [ \&fred, 'bill' ] );

      Then when you click on entry field 1 ($ef1) the subroutine 'fred' will be called with the handle of $ef1 as the first parameter, and the value 'bill' as the second. Now you can program whatever action is required.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?

Re^2: Eliminate blinking cursor from text widget
by chessgui (Scribe) on Jan 14, 2012 at 14:49 UTC
    Sorry but the entry widget seems to be limited to one line in height. I need a 8x8 text widget to represent the board.

      I take it from that you've been using a multi-line Text widget.

      The problem I foresee is that whilst in a Text widget, a button-1 click sets the insertion cursor to the character under the mouse, if you make it readonly and disable the insertion cursor, will the button-1 binding still work?

      I would use an 8x8 grid of Entry widgets. That way, each click identifies which symbol is clicked.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?

      PROBLEM SOLVED:

      You should set the insertOnTime option (which controls the time in millisecons for which the blinking cursor is on) to zero.

      $text_widget->configure(-insertontime=>0);