clearing the entry selected color
- From: zentara <zentara1 sbcglobal net>
- To: gtk-perl-list gnome org
- Subject: clearing the entry selected color
- Date: Wed, 20 Dec 2006 09:59:04 -0500
Hi,
The recent question about validating an
entry text to a pattern, got me hung up
on this. When you enter text from the
program, the entry text is highlighted
like a selection. I can't seem to find a way
to clear it. I tried all sorts of combinations,
set_text, prepend_text, etc. They all highlight
the inserted text.
Also, is it possible to set the cursor position to 1?
Instead of where the mouse is clicked?
Thanks,
zentara
#!/usr/bin/perl
use warnings;
use strict;
use Gtk2 -init;
my $window = new Gtk2::Window;
$window->signal_connect (delete_event => sub { Gtk2->main_quit });
my $entry = Gtk2::Entry->new();
$entry->set_text('[ ].[ ].[ ].[ ]');
$entry->set_state('normal');
#$entry->set_state('insensitive');
#Gtk2->main_iteration while Gtk2->events_pending;
$entry->set_position(1);
$window->add($entry);
$window->set_focus_child($entry);
print $entry->get_text,"\n";
$window->show_all;
Gtk2->main;
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]