KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/pygtk/2.0/demos/images.pyo
mò
e‡8Hc@sÑdZdkZdkZdkZeiieiieƒdƒZeiiedƒZ	eiiedƒZ
eiiedƒZd„Zd„Z
deifd	„ƒYZd
„ZedjoeƒndS(sÿImages

GtkImage is used to display an image; the image can be in a number of formats.
Typically, you load an image into a GdkPixbuf, then display the pixbuf.
This demo code shows some of the more obscure cases, in the simple case a call
to gtk_image_new_from_file() is all you need.
If you want to put image data in your program as a C variable, use the
make-inline-pixbuf program that comes with GTK+. This way you won't need to
depend on loading external files, your application binary can be self-contained.Ntimagess
alphatest.pngsgtk-logo-rgb.gifsfloppybuddy.gifcCs*|iƒ}|idƒ|i|ƒdS(Ni(tloadert
get_pixbuftpixbuftfilltimagetset_from_pixbuf(RRR((t$/usr/lib64/pygtk/2.0/demos/images.pytprogressive_prepared_callbacks
cCs|iƒdS(sŠ We know the pixbuf inside the GtkImage has changed, but the image
        itself doesn't know this; so queue a redraw.  If we wanted to be
        really efficient, we could use a drawing area or something
        instead of a GtkImage, so we could control the exact position of
        the pixbuf on the display, then we could queue a draw for only
        the updated area of the image.
    N(Rt
queue_draw(RtxtytwidththeightR((Rtprogressive_updated_callback st
ImagesDemocBsJtZdZdZdZdd„Zd„Zd„Zd„Z	d„Z
RS(NcCstii|ƒy|i|iƒƒWn&tj
o|idd„ƒnX|id|i	ƒ|i
|iiƒ|i
dƒtitdƒ}|i
dƒ|i|ƒtiƒ}|idƒ|i|ttdƒtiƒ}
|
itiƒtiddddƒ}|i|
ƒ|i|ttdƒtiƒ}y#tiit ƒ}|i"|ƒWn]t#i$j
oN}	ti&|ti'ti(ti)d|	ƒ}|idd	„ƒ|i+ƒnX|
i|ƒtiƒ}|id
ƒ|i|ttdƒtiƒ}
|
itiƒtiddddƒ}|i|
ƒ|i|ttdƒtiƒ}|i,t-ƒ|
i|ƒtiƒ}|idƒ|i|ttdƒtiƒ}
|
itiƒtiddddƒ}|i|
ƒ|i|ttdƒtiƒ}|i"dƒ|
i|ƒ|i/|ƒti0dƒ}|i|ttdƒ|id
|i2|ƒ|i3ƒdS(NtdestroycGs
tiƒS(N(tgtkt	main_quit(tw((Rt<lambda>4sis<u>Image loaded from a file</u>if0.5s1Unable to open image file 'gtk-logo-rgb.gif': 
%stresponsecCs
|iƒS(N(tdlgR(Rtresp((RR_ss#<u>Animation loaded from a file</u>s <u>Progressive image loading</u>t_Insensitivettoggled(4RtWindowt__init__tselft
set_screentparentt
get_screentAttributeErrortconnecttcleanup_callbackt	set_titlet	__class__t__name__tset_border_widthtVBoxtFalsetvboxtaddtLabeltlabelt
set_markupt
pack_starttFrametframetset_shadow_typet	SHADOW_INt	AlignmenttaligntImageRtgdktpixbuf_new_from_filet
GTKLOGO_IMAGERRtgobjecttGErrorterrort
MessageDialogtDIALOG_DESTROY_WITH_PARENTt
MESSAGE_ERRORt
BUTTONS_CLOSEtdialogtshowt
set_from_filetBUDDY_IMAGEtNonetstart_progressive_loadingtToggleButtontbuttonton_sensitivity_toggledtshow_all(RRR@R4RR,R)RGRR;R0((RR/sv




	










cCs…|idjoti|iƒd|_n|idj	o|iiƒd|_n|idj	o|iiƒd|_ndS(Ni(Rtload_timeoutRttimeout_removet
pixbuf_loaderRDtclosetimage_stream(Rtwin((RR"›s



cCsR|iƒ}x?|D]7}t|ƒt|ƒjo|i|iƒƒqqWdS(N(t	containertget_childrentchildrentchildttypettogglebuttont
set_sensitivet
get_active(RRURPRSRR((RRH©s
cCstid|i|ƒ|_dS(s„ This is obviously totally contrived(we slow down loading
            on purpose to show how incremental loading works).
            The real purpose of incremental loading is the case where
            you are reading data from a slow source such as the network.
            The timeout simply simulates a slow data source by inserting
            pauses in the reading process.
        i–N(Rttimeout_addRtprogressive_timeoutRRJ(RR((RRE²scCsÁ|idj	o¿y"|iidƒ}t|ƒ}Wn}tj
oq}t	i
|t	it	it	i
d|ƒ}|idd„ƒ|iiƒd|_|iƒd|_tSnX|ii||ƒpht	i
|t	it	it	i
dƒ}|idd„ƒ|iiƒd|_|iƒd|_tSn|djoŽ|iiƒd|_|iiƒp[t	i
|t	it	it	i
dƒ}|idd„ƒ|iƒd|_d|_tSnd|_q½nïyttd	ƒ|_Wnmtj
oa}d
}t	i
|t	it	it	i
||ƒ}|idd„ƒ|iƒd|_tSnX|idj	o|iiƒd|_nt	iiƒ|_|iidt|ƒ|iid
t|ƒtS(Nis.Failure reading image file 'alphatest.png': %sRcCs
|iƒS(N(tdR(RZtr((RRÎsisFailed to load imagecCs
|iƒS(N(RZR(RZR[((RRáscCs
|iƒS(N(RZR(RZR[((RRþstrbs.Unable to open image file 'alphatest.png' : %scCs
|iƒS(N(RZR(RZR[((RRst
area_preparedtarea_updated(RRNRDtreadtbuftlent
bytes_readtIOErrorR;RR<R=R>R?R@R!RMRARJR(RLtwritetopentALPHA_IMAGEt
error_messageR6tPixbufLoaderRRRtTrue(RRRgR@R;RbR`((RRY¼s‚	

	
				
	
	

			
			

		



(R%t
__module__RDRLRJRNRR"RHRERY(((RR*sl				
cCstƒtiƒdS(N(RRtmain(((RRk-st__main__(t__doc__tosR9Rtpathtjointdirnamet__file__tIMAGEDIRRfR8RCRRRRRkR%(R8RRsRRRfR9RkRnRCR((Rt?
s			!	
	
ÿ	


Anon7 - 2021