GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Aug 26, 2016 3:12 am

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: A tricky feature of FontButton
PostPosted: Mon Dec 02, 2013 4:40 pm 
Familiar Face

Joined: Fri Aug 05, 2011 8:05 am
Posts: 22
In my app, I have a TextView displayed, and I want to apply a font to the current selection in the TextView.

This seemed sometimes to work, and sometimes not. Eventually I noticed that as the FontButton dialog has an editable SpinButton to choose the font size, it is possible, intentionally or accidentally to select part or all of the numeric text in that box.

If you do that, the TextView loses its current selection, and consequently in the onFontChanged handler, things go awry since there is no longer a selection ;=(

So to make the thing work reliably, you have to add an onClicked handler to the FontButton, and have that tell the object using the TextView to make a note of the selection before the font dialog comes up.


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 3 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group