[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

focus weirdness



Hi,
	I'm trying to get an entry box to select its contents upon recieving
focus (in this case it is actually warranted).  This is the code that I'm
using:

$entry->signal_connect('focus_in_event', sub {$_[0]->select_region(0, 4);},
$entry);

(in perl $_[0] is the first argument, and the bindings make all of these
things objects so that the widget argument can be omitted).

It doesn't work when someone clicks in the entry box (though it does get
called, I've verified this with print statements).  It works, however, if I
give focus to an entirely different toplevel window and back, it does work. 
Am I going about this the wrong way?  Am I encountering a bug?  What is the
best way to do this?  Thanks.
	-Chris

-- 
lansdoct@cs.alfred.edu
"If I had had more time I would have written a shorter letter." - Pascal
Linux Programs: http://cs.alfred.edu/~lansdoct/linux/
Linux - Get there. Today.
Evil Overlord Quote of the Day (www.eviloverlord.com):
99. Any data file of crucial importance will be padded to 1.45Mb in size.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]