Re: How to get windows id or title by clicking on it [message #66899 is a reply to message #66898] |
Thu, 18 June 2009 18:23   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jeanphi62 writes:
> I work with a GUI which include up to 8 windows which have titles as
> "window 1 window 2 window 3...", and I would like to get the id of the
> window just exposing it (left click on the window) or the best should
> be to get the title of the window by left clicking on it as each one
> of these titles include the number of its window.
> I have already events linked with the drawing area inside of these
> windows, but as the user may avoid to move the mouse over the drawing
> area, I would need to get the event when clicking on the window itself
> (as every body does to put the window to the front-most window of the
> screen)
>
> Is there a simple function such as widget_control, event.top,
> get_window_title=title ??
No really, you can change a window title, but not get it.
Presumably you already know what it is. ;-)
You could set KBRD_FOCUS_EVENTS on your top-level base widgets,
but you couldn't always tell which window you selected. If you
were changing focus to the window, you could tell, or if you
changed focus to another window, you could tell. But if you
clicked a window that already had focus, you wouldn't hear
about that. You might be able to make something like that
work for you.
But, frankly, I've written a LOT of widget applications and
I've never thought I needed anything like this. Are you sure
this can't be solved with a design change?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|