|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /usr/lib64/pygtk/2.0/demos/ |
Upload File : |
mò
e‡8Hc @ s» d Z d k Z d k Z e d ƒ \ Z Z Z e d ƒ \ Z Z Z d „ Z
d e i f d „ ƒ YZ d e i
f d „ ƒ YZ d e i f d „ ƒ YZ d
„ Z e d j o e ƒ n d S( s© Change Display
Demonstrates migrating a window between different displays and
screens. A display is a mouse and keyboard with some number of
associated monitors. A screen is a set of monitors grouped
into a single physical work area. The neat thing about having
multiple displays is that they can be on a completely separate
computers, as long as there is a network connection to the
computer where the application is running.
Only some of the windowing systems where GTK+ runs have the
concept of multiple displays and screens. (The X Window System
is the main example.) Other windowing systems can only
handle one keyboard and mouse, and combine all monitors into
a single screen.
This is a moderately complex example, and demonstrates:
- Tracking the currently open displays and screens
- Changing the screen for a window
- Letting the user choose a window by clicking on it
- Using GtkListStore and GtkTreeView
- Using GtkDialog
Ni c C s? | i ƒ d } | o | i ƒ } n | o
| i ƒ p d S( s@ Finds the toplevel window under the mouse pointer, if any.
i N( t displayt get_window_at_pointert pointer_windowt
get_user_datat widgett get_toplevelt None( R R R ( ( t+ /usr/lib64/pygtk/2.0/demos/changedisplay.pyt find_toplevel_at_pointer, s
t QueryForToplevelc B s) t Z d Z d „ Z d „ Z d „ Z RS( sÄ Asks the user to click on a window, then waits for them click
the mouse. When the mouse is released, returns the toplevel
window under the pointer, or NULL, if there is none.
c C s£ t i i | t i ƒ | i | ƒ | i t ƒ | i t i
ƒ t i ƒ } | i
t i ƒ | i | ƒ t i | ƒ } | i d d ƒ | i | ƒ | i ƒ d S( Ni
( t gtkt Windowt __init__t selft WINDOW_POPUPt
set_screent screent set_modalt Truet set_positiont WIN_POS_CENTERt Framet framet set_shadow_typet
SHADOW_OUTt addt Labelt promptt labelt set_paddingt show_all( R
R R R R ( ( R R ? s
c C sð | i ƒ i ƒ } t i i | t i i ƒ } t i
ƒ } t i i | i
t t i i d | ƒ t i i j oh t | _ | i d | i ƒ x"