www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - TKD set focus on window?

reply "Joakim" <joakim742 gmail.com> writes:
Hi,

Quick question regarding TKD (tkinter):

Is there a way to set focus on the application window 
automatically on run? I'm on Mac OS X if that's of any importance.

I have tried to grep the documentation but I can't find anything 
relevant.

Thanks!
May 14 2014
next sibling parent "Mengu" <mengukagan gmail.com> writes:
On Wednesday, 14 May 2014 at 17:08:21 UTC, Joakim wrote:
 Hi,

 Quick question regarding TKD (tkinter):

 Is there a way to set focus on the application window 
 automatically on run? I'm on Mac OS X if that's of any 
 importance.

 I have tried to grep the documentation but I can't find 
 anything relevant.

 Thanks!
it seems the UiElement class has a focus(bool) method: https://github.com/nomad-software/tkd/blob/master/source/tkd/element/ui lement.d#L699-L711. so it seems it's kind of possible to do window.focus(true).
May 14 2014
prev sibling parent "Gary Willoughby" <dev nomad.so> writes:
On Wednesday, 14 May 2014 at 17:08:21 UTC, Joakim wrote:
 Hi,

 Quick question regarding TKD (tkinter):

 Is there a way to set focus on the application window 
 automatically on run? I'm on Mac OS X if that's of any 
 importance.

 I have tried to grep the documentation but I can't find 
 anything relevant.

 Thanks!
class App : TkdApplication { ... this.mainWindow.raise(); // <-- in UiElement this.mainWindow.focus(); // <-- in UiElement ... } Window inherits from UiElement. Remember to look at the methods in the parents of each class.
May 14 2014