a T`c@s ddlZddlZddlmZddlmZmZddlmZm Z ddl m Z m Z m Z mZddlmZddlmZed Zejd kZejd kZejd kZgZeZed e Z ederdZeeeGdddeZedddZedddZGddde Z!Gdddej"Z"e e"Z"edes:erbGdddej#e"Z#e e#Z#edne Z#Gdddej$Z$e e$Z$edeser&Gdddej%Z%e e%Z%edGd d!d!ej&Z&e e&Z&ed!Gd"d#d#ej'Z'e e'Z'ed#Gd$d%d%ej(Z(e e(Z(ed%Gd&d'd'ej)e#Z)e e)Z)ed'esXer|Gd(d)d)ej*Z*e e*Z*ed)eserGd*d+d+ej+Z+e e+Z+ed+eserGd,d-d-ej,Z,e e,Z,ed-d.d/Z-Gd0d1d1ej.Z.e e.Z.ed1erej/j0Z1ne ej/j0d2ed3d4Z1Gd5d6d6ej/Z/e e/Z/ed6Gd7d8d8ej2e#Z2e e2Z2ed8eserGd9d:d:ej3e2Z3e e3Z3ed:eserGd;d<dd>ej5Z5e e5Z5ed>eser,Gd?d@d@ej6Z6e e6Z6ed@es8er\GdAdBdBej7Z7e e7Z7edBGdCdDdDej8Z8e e8Z8edDeserGdEdFdFej9Z9e e9Z9edFGdGdHdHej:Z:e e:Z:edHGdIdJdJej;Z;e e;Z;edJGdKdLdLej<ZZ>e e>Z>edPGdQdRdRej?Z?e e?Z?edReserGdSdTdTej@Z@e e@Z@edTGdUdVdVejAe>e?ZAe eAZAedVGdWdXdXe ZBedXGdYdZdZe ZCedZGd[d\d\ejDZDe eDZDed\Gd]d^d^ejEe>e?ZEe eEZEed^Gd_d`d`ejFe#ZFe eFZFed`GdadbdbejGZGe eGZGedbGdcddddejHZHe eHZHeddeserHGdedfdfejIe#ZIe eIZIedfGdgdhdhejJZJe eJZJedhGdidjdjejKZKe eKZKedjGdkdldlejLZLe eLZLedlesxerGdmdndnejMe#ZMe eMZMednGdodpdpejNZNe eNZNedpeserGdqdrdrejOZOe eOZOedrGdsdtdtejPZPe ePZPedtes"erFGdudvdvejQZQe eQZQedvesRerGdwdxdxejRZRe eRZRedxGdydzdzejSZSe eSZSedzGd{d|d|ejTZTe eTZTed|Gd}d~d~ejUZUe eUZUed~e r GdddejVZVe eVZVede r6GdddejWZWe eWZWede sBe rrejXZYe ejXddZXejZZ[e ejZddZZe s~e re ej\Z\ede re]Z^ne]ej_\Z^Z_e`e_e__dS)N)GObject)wakeup_on_signalregister_sigint_fallback)Template_extract_handler_and_args)overridestrip_boolean_resultdeprecated_initwrap_list_store_sort_func)get_introspection_module)PyGIDeprecationWarningGtkz2.0z3.0z4.0rraBYou have imported the Gtk 2.0 module. Because Gtk 2.0 was not designed for use with introspection some of the interfaces and API will fail. As such this is not supported by the pygobject development team and we encourage you to port your app to Gtk 3 or greater. PyGTK is the recomended python module to use with Gtk 2.0c@s eZdZdS)PyGTKDeprecationWarningN)__name__ __module__ __qualname__rr4/usr/lib/python3.9/site-packages/gi/overrides/Gtk.pyr<srcCs4g}|D]&}t|tjs$tjj|}||q|S)zCreate a list of TargetEntry items from a list of tuples in the form (target, flags, info) The list can also contain existing TargetEntry items in which case the existing entry is re-used in the return list. ) isinstancer Z TargetEntrynewappend)targetstarget_entriesZentryrrr_construct_target_listCs    rc Cst||\}}|tjj@} |durV| r>|j|||g|Rq|j|||g|Rn.| rp|j||g|Rn|j||g|RdSN)rrZ ConnectFlagsZAFTERZconnect_object_afterZconnect_objectZ connect_afterconnect) ZbuilderZgobjZ signal_nameZ handler_nameZ connect_objflags obj_or_mapZhandlerargsZafterrrr_builder_connect_callbackTs rc@s$eZdZddZddZddZdS)_FreezeNotifyManagercCs ||_dSr)obj)selfr!rrr__init__esz_FreezeNotifyManager.__init__cCsdSrrr"rrr __enter__hsz_FreezeNotifyManager.__enter__cCs|jdSr)r!Zthaw_child_notify)r"Zexc_typeZ exc_valueZ tracebackrrr__exit__ksz_FreezeNotifyManager.__exit__N)rrrr#r%r&rrrrr dsr cs~eZdZeejjZer(ddZddZ e s0e r<fddZ e sDe rPfddZ e sXe rdfd d Ze sle rvdd d ZZS)WidgetcCs |t|vSr)listr"childrrr __contains__tszWidget.__contains__ccs |}|r|V|}qdSr)Zget_first_childZget_next_siblingr)rrr__iter__wszWidget.__iter__cstt|t|Sr)superr'freeze_child_notifyr r$ __class__rrr.~szWidget.freeze_child_notifycs8|dur$t|tjs$tjt|}tt||dSr)rr TargetListrrr-r'drag_dest_set_target_listr"Z target_listr/rrr2sz Widget.drag_dest_set_target_listcs8|dur$t|tjs$tjt|}tt||dSr)rr r1rrr-r'drag_source_set_target_listr3r/rrr4sz"Widget.drag_source_set_target_listNcCsN|dur6||}|dur*td||ft|j}tj||||S)Nz/Class "%s" does not contain style property "%s") Zfind_style_property ValueErrorrValue value_typer r'style_get_property get_value)r" property_namevalueproprrrr8s  zWidget.style_get_property)N)rrrrr r'Ztranslate_coordinatesGTK4r+r,GTK2GTK3r.r2r4r8 __classcell__rrr/rr'os    r'c@sVeZdZddZddZddZddZeZdd d Zd d Z ddZ e e j jZd S) ContainercCs t|Sr)len get_childrenr$rrr__len__szContainer.__len__cCs ||vSr)rCr)rrrr+szContainer.__contains__cCs t|Sr)iterrCr$rrrr,szContainer.__iter__cCsdSNTrr$rrr__bool__szContainer.__bool__NcCsP|dur6||}|dur*td||ft|j}tj|||||S)Nz/Class "%s" does not contain child property "%s") Zfind_child_propertyr5rr6r7r rAchild_get_propertyr9)r"r*r:r;r<rrrrHs  zContainer.child_get_propertycsfdd|DS)zz'Container.child_get..r)r"r*Z prop_namesrrKr child_getszContainer.child_getcKs0|D]"\}}|dd}||||qdS)z=Set a child properties on the given child to key/value pairs.Z_z-N)itemsZreplaceZchild_set_property)r"r*kwargsrJr;rrr child_sets zContainer.child_set)N)rrrrDr+r,rG __nonzero__rHrNrQrr rAZget_focus_chainrrrrrAs rAcs,eZdZfddZeejjddZZS)Editablecstt||d|SN)r-rS insert_text)r"textpositionr/rrrVszEditable.insert_textrZfail_ret) rrrrVrr rSget_selection_boundsr@rrr/rrSs rSc@seZdZeejjdedZdS)ActionrJlabeltooltipstock_id arg_namescategoryN)rrrr r r[r#rrrrrr[sr[c@seZdZeejjdedZdS) RadioActionrJr]r^r_r;r`N)rrrr r rcr#rrrrrrcsrcc@s<eZdZeejjdedZd ddZd ddZ d dd Z dS) ActionGroup)rJr`NcsNz t|Wnty&tdYn0dfdd }|D] }||q/group-name/action-name. entries must be iterableNcsLt||||d}|dur<dur.|d|n|d|||dSNr\Zactivate)r[radd_action_with_accel)rJr_r] acceleratorr^callbackactionr" user_datarr_process_actions z0ActionGroup.add_actions.._process_action)NNNNNrE TypeErrorr"entriesrmrnerrlr add_actionss   zActionGroup.add_actionscsNz t|Wnty&tdYn0dfdd }|D] }||q/group-name/action-name. rfNFcsXtj||||d}|||durHdur:|d|n|d|||dSrg)r Z ToggleAction set_activerrh)rJr_r]rir^rjZ is_activerkrlrrrn?s z7ActionGroup.add_toggle_actions.._process_action)NNNNNFrorqrrlradd_toggle_actionss   zActionGroup.add_toggle_actionsc sz t|Wnty&tdYn0d}dfdd }|D] }||g|R}|dur@|}q@|dur|dur|dur|d|n|d||dS)a The add_radio_actions() method is a convenience method that creates a number of gtk.RadioAction objects based on the information in the list of action entry tuples contained in entries and adds them to the action group. The entry tuples can vary in size from one to six items with the following information: * The name of the action. Must be specified. * The stock id for the action. Optional with a default value of None if a label is specified. * The label for the action. This field should typically be marked for translation, see the set_translation_domain() method. Optional with a default value of None if a stock id is specified. * The accelerator for the action, in the format understood by the gtk.accelerator_parse() function. Optional with a default value of None. * The tooltip for the action. This field should typically be marked for translation, see the set_translation_domain() method. Optional with a default value of None. * The value to set on the radio action. Optional with a default value of 0. Should be specified in applications. The value parameter specifies the radio action that should be set active. The "changed" signal of the first radio action is connected to the on_change callback (if specified and not None) and the accel paths of the actions are set to /group-name/action-name. rfNrcsBt|||||d}tr |||kr2|d|||S)NrdT)rcr?Z join_grouprurh)Z group_sourcerJr_r]rir^Z entry_valuerkr"r;rrrnqs   z6ActionGroup.add_radio_actions.._process_actionZchanged)NNNNr)rErpr) r"rrr;Z on_changermZ first_actionrnrsrkrrwradd_radio_actionsNs   zActionGroup.add_radio_actions)N)N)NNN) rrrr r rer#rrtrvrxrrrrres - 1rec@seZdZddZdddZdS) UIManagercCs*t|tstdt|}tj|||SNzbuffer must be a string)rstrrp_get_utf8_lengthr ryadd_ui_from_stringr"bufferlengthrrrr}s zUIManager.add_ui_from_stringrUcCstj|||Sr)r ryinsert_action_groupr~rrrrszUIManager.insert_action_groupN)rU)rrrr}rrrrrrysryc@seZdZeejjZdS)ComboBoxN)rrrrr rZget_active_iterrrrrrsrc@seZdZeejjdedZdS)Box) homogeneousZspacingr`N)rrrr r rr#rrrrrrsrc@s(eZdZeejjddejjie dZdS) SizeGroup)moder)raZdeprecated_defaultsrbN) rrrr r rr#Z SizeGroupModeZVERTICALrrrrrrs  rc@seZdZeejjdedZdS)MenuItemr]r`N)rrrr r rr#rrrrrrsrcCs*t|tsJt|ts"|d}t|S)Nzutf-8)rr{ZbytesZencoderB)Zstringrrrr|s  r|csNeZdZer.ddlmZeZd fdd ZnddZdd Z d d Z Z S) Builderr)define_builder_scopeNcs&tt||r"|t|dSr)r-rr#Z set_scope BuilderScope)r"Zscope_object_or_mapr/rrr#szBuilder.__init__cCs|t|dS)aConnect signals specified by this builder to a name, handler mapping. Connect signal, name, and handler sets specified in the builder with the given mapping "obj_or_map". The handler/value aspect of the mapping can also contain a tuple in the form of (handler [,arg1 [,argN]]) allowing for extra arguments to be passed to the handler. For example: .. code-block:: python builder.connect_signals({'on_clicked': (on_clicked, arg1, arg2)}) N)Zconnect_signals_fullr)r"rrrrconnect_signalss zBuilder.connect_signalscCs*t|tstdt|}tj|||Srz)rr{rpr|r radd_from_stringr~rrrrs zBuilder.add_from_stringcCs,t|tstdt|}tj||||Srz)rr{rpr|r radd_objects_from_string)r"rZ object_idsrrrrrs zBuilder.add_objects_from_string)N) rrrr= _gtktemplaterrr#rrrr@rrr/rrs r)type)rarb stacklevelc@seZdZddZdS)WindowcOs&ts tdt|g|Ri|dS)NzRGtk couldn't be initialized. Use Gtk.init_check() if you want to handle this case.) initializedZ RuntimeError _window_initr"rrPrrrr#s zWindow.__init__N)rrrr#rrrrrsrc@sdeZdZeserXdZeejj ddddde dZ dd Z d d Z e d d Ze dd ZddZdS)Dialog)titleparentrbuttons_buttons_property)r transient_forr add_buttonsr)rrrr)rr)raignoredeprecated_aliasesrbcOs|}tt|j|}||d}|jtkrF|jjtjkrF|d7}|dd}|durt |t j st j dt|d|ddnd}|dd}|rt j dt|d|t jj@rd |d <|t jj@rd |d <|j|i||r|j|dS) NrrzThe "buttons" argument must be a Gtk.ButtonsType enum value. Please use the "add_buttons" method for adding buttons. See: https://wiki.gnome.org/PyGObject/InitializerDeprecationsrrrzThe "flags" argument for dialog construction is deprecated. Please use initializer keywords: modal=True and/or destroy_with_parent=True. See: https://wiki.gnome.org/PyGObject/InitializerDeprecationsTZmodalZdestroy_with_parent)copydictzip_old_arg_namesZupdater0rr#getrr Z ButtonsTypewarningswarnrZpopZ DialogFlagsZMODALZDESTROY_WITH_PARENT_initr)r"rrP new_kwargsZ old_kwargsrrrrrrr#s2     zDialog.__init__c Os|t|j^t8tjj|g|Ri|WdWdS1sP0YWdn1sn0YdSr)rZdestroyrr rrunrrrrrFs z Dialog.runcCs|Sr)Zget_action_areaZdialogrrrKrMzDialog.cCs|Sr)Zget_content_arearrrrrLrMcGs*dd}||D]\}}|||qdS)a The add_buttons() method adds several buttons to the Gtk.Dialog using the button data passed as arguments to the method. This method is the same as calling the Gtk.Dialog.add_button() repeatedly. The button data pairs - button text (or stock ID) and a response ID integer are passed individually. For example: .. code-block:: python dialog.add_buttons(Gtk.STOCK_OPEN, 42, "Close", Gtk.ResponseType.CLOSE) will add "Open" and "Close" buttons to dialog. cssP|rLz|dd\}}Wnty2tdYn0|dd}||fVqdS)Nrrz%Must pass an even number of arguments)r5)ZbZtZrrrr_button\s  z#Dialog.add_buttons.._buttonN)Z add_button)r"rrrWZresponserrrrNs zDialog.add_buttonsN)rrrr>r?rr r rr#rrrpropertyZ action_areaZvboxrrrrrrs*  rc@s6eZdZeejjddddedZddZdd Z d S) MessageDialog)rr message_typermessage_formatrr)rWrrarrbcCs|dd|d|dS)Nsecondary-use-markupFsecondary-textZ set_propertyr"rrrrformat_secondary_textvs z#MessageDialog.format_secondary_textcCs|dd|d|dS)NrTrrrrrrformat_secondary_markupzs z%MessageDialog.format_secondary_markupN) rrrr r rr#rrrrrrrrnsrc@seZdZeejjdedZdS)ColorSelectionDialogrr`N)rrrr r rr#rrrrrrsrc@seZdZeejjdedZdS)FileChooserDialog)rrrkrr`N)rrrr r rr#rrrrrrsrc@seZdZeejjdedZdS)FontSelectionDialogrr`N)rrrr r rr#rrrrrrsrc@s$eZdZeejjdddiedZdS)RecentChooserDialog)rrrecent_managerrrZmanagerrN)rrrr r rr#rrrrrrs rc@sJeZdZeser"eejjde dZe ejj Z e ejj Z e ejj Z dS)IconViewmodelr`N)rrrr>r?r r rr#rrZget_item_at_posget_visible_rangeZget_dest_item_at_posrrrrrs  rc@seZdZeejjdedZdS) ToolButton)r_r`N)rrrr r rr#rrrrrrsrc@seZdZeejjZdS) IMContextN)rrrrr rZget_surroundingrrrrrsrc@seZdZeejjZdS) RecentInfoN)rrrrr rZget_application_inforrrrrsrc@s^eZdZdddZdddZddd Zdd d Zd d ZddZdddZ e e j j ddZ dS) TextBufferNcKs&tjfd|i|}|||S)aCreates a tag and adds it to the tag table of the TextBuffer. :param str tag_name: Name of the new tag, or None :param **properties: Keyword list of properties and their values This is equivalent to creating a Gtk.TextTag and then adding the tag to the buffer's tag table. The returned tag is owned by the buffer's tag table. If ``tag_name`` is None, the tag is anonymous. If ``tag_name`` is not None, a tag called ``tag_name`` must not already exist in the tag table for this buffer. Properties are passed as a keyword list of names and values (e.g. foreground='DodgerBlue', weight=Pango.Weight.BOLD) :returns: A new tag. rJ)r ZTextTag get_tag_tableZadd)r"Ztag_nameZ propertiestagrrr create_tagszTextBuffer.create_tagFcCstj||||Sr)r r create_mark)r"Z mark_nameZwhereZ left_gravityrrrrszTextBuffer.create_markrUcCstj|||dSr)r rset_textr"rWrrrrrszTextBuffer.set_textcCs0t|tstdt|tj||||dSNztext must be a string, not %s)rr{rprr rinsert)r"rErWrrrrrs zTextBuffer.insertcGsB|}||||sdS||}|D]}||||q*dSr)Z get_offsetrZget_iter_at_offsetZ apply_tag)r"rErWtagsZ start_offsetstartrrrrinsert_with_tagss  zTextBuffer.insert_with_tagscGsNg}|D],}||}|s*td|||q|j||g|RdS)Nzunknown text tag: %s)rZlookupr5rr)r"rErWrZtag_objsrZtag_objrrrinsert_with_tags_by_name s  z#TextBuffer.insert_with_tags_by_namecCs.t|tstdt|tj|||dSr)rr{rprr rinsert_at_cursorrrrrrs zTextBuffer.insert_at_cursorrrY)N)F)rU)rU)rU)rrrrrrrrrrrr rrZrrrrrs      rc@s$eZdZeejjZeejjZdS)TextIterN)rrrrr rZforward_searchZbackward_searchrrrrr"s rcs(eZdZddZddZes er$eZddZfddZ d d Z d d Z d dZ ddZ ddZeejjZeejjZeejjZeejjZeejjedZfddZfddZfddZddZddZddZd d!Zfd"d#Zfd$d%Z fd&d'Z!fd(d)Z"fd*d+Z#Z$S), TreeModelcCs |dSr)Ziter_n_childrenr$rrrrD,szTreeModel.__len__cCsdSrFrr$rrrrG/szTreeModel.__bool__cCst|tjr|St|trL|dkrLt||}|dkrBtd|||Sz||}Wntyxtd|Yn0|SdS)Nrzrow index is out of bounds: %dzcould not find tree path '%s')rr TreeIterintrB IndexErrorget_iterr5)r"keyindexaiterrrr_getiter6s     zTreeModel._getitercs*tt|}t|dr|St|SdS)Nsort_new_with_model)r-rhasattrr TreeModelSortnew_with_model)r"Z super_objectr/rrrEs  zTreeModel.sort_new_with_modelcCst|tjr|St|SdSr)rr TreePathr"pathrrr _coerce_pathLs zTreeModel._coerce_pathcCs||}t||Sr)r TreeModelRowr"rrrrr __getitem__Rs zTreeModel.__getitem__cCs||}||j|dSr)set_rowrE)r"rr;rowrrr __setitem__VszTreeModel.__setitem__cCs||}||dSr)rZremoverrrr __delitem__Zs zTreeModel.__delitem__cCst||Sr)TreeModelRowIterget_iter_firstr$rrrr,^szTreeModel.__iter__zinvalid tree pathcs2||}tt||\}}|s.td||S)Nzinvalid tree path '%s')rr-rrr5)r"rsuccessrr/rrrhs   zTreeModel.get_itercs$|}tt||}|r |SdSr)rr-r iter_next)r"r next_iterrr/rrroszTreeModel.iter_nextcs$|}tt||}|r |SdSr)rr-r iter_previous)r"r prev_iterrr/rrruszTreeModel.iter_previouscCsvt|trtd|}t||kr.tdg}g}t|D].\}}|durPq>||||||q>||fS)Nz%Expected a list or tuple, but got strz1row sequence has the incorrect number of elements) rr{rp get_n_columnsrBr5 enumerater_convert_value)r"r n_columnsZresultcolumnsZcur_colr;rrr _convert_row{s   zTreeModel._convert_rowcCs.||\}}|D]}|||||qdSr)r set_value)r"treeiterrZ converted_rowrcolumnrrrrszTreeModel.set_rowcCs"t|tjr|St|||S)z5Convert value to a GObject.Value of the expected type)rrr6Zget_column_type)r"rr;rrrrs zTreeModel._convert_valuecGsZ|}g}|D]@}t|ts&td|dks6||kr>td||||qt|S)Nzcolumn numbers must be intsrzcolumn number is out of range)rrrrpr5rr9tuple)r"rrrvaluesZcolrrrrs z TreeModel.getcstt||||Sr)r-r row_changedrr"rrEr/rrrszTreeModel.row_changedcstt||||Sr)r-r row_insertedrrr/rrrszTreeModel.row_insertedcstt||||Sr)r-rrow_has_child_toggledrrr/rrrszTreeModel.row_has_child_toggledcstt|||Sr)r-r row_deletedrrr/rrrszTreeModel.row_deletedcstt|||||Sr)r-rrows_reorderedr)r"rrEZ new_orderr/rrrszTreeModel.rows_reordered)%rrrrDrGr>r?rRrrrrrrr,rr rr iter_childrenZiter_nth_child iter_parentZget_iter_from_stringr5rrrrrrrrrrrrr@rrr/rr+s<            rcs<eZdZeejjddZdfdd Zd fdd ZZ S) TreeSortable)NNrYNcstt||||dSr)r-r set_sort_func)r"Zsort_column_id sort_funcrmr/rrr szTreeSortable.set_sort_funccstt|||dSr)r-rset_default_sort_func)r"r rmr/rrr sz"TreeSortable.set_default_sort_func)N)N) rrrrr rZget_sort_column_idr r r@rrr/rrsrc@s6eZdZeejjdedZeejds2e ddZ dS)rrr`rcCs t|Sr)rr)r"Z child_modelrrrrszTreeModelSort.new_with_modelN) rrrr r rr#rr classmethodrrrrrrs rc@s^eZdZddZddZdddZddd Zdd d Zdd d ZdddZ ddZ ddZ dS) ListStorecGstj|||dSr)r r r#set_column_typesr"Z column_typesrrrr#s zListStore.__init__cCs8|dur&||\}}||||}ntj||}|Sr)rZinsert_with_valuesvr r r)r"rXrrrrrr _do_inserts zListStore._do_insertNcCs |r|d|Stj|SdSrT)rr r rr"rrrrrs zListStore.appendcCs |d|SNrrrrrrprependszListStore.prependcCs |||Srr)r"rXrrrrrszListStore.insertcCsB|dur4|durd}n||d}|||Stj||SrT)get_path get_indicesrr r  insert_beforer"siblingrrXrrrrs  zListStore.insert_beforecCsF|dur8|durd}n||dd}|||Stj||SNrrUr)rrrr r  insert_afterrrrrrs  zListStore.insert_aftercCs"|||}tj||||dSr)rr r rr"rrr;rrrrs zListStore.set_valuecsfdd}|rt|dtr@||ddd|dddnlt|dttfrzt|dkrftd||d|dn2t|dtr|t|d|dntddS)Ncsxt|t|krtdg}g}t||D]6\}}t|tsDtd|||||q*tj ||dSNz7The number of columns do not match the number of valuesz0TypeError: Expected integer argument for column.) rBrprrrrrr r setZcolsZvalsrrZcol_numr;r"rrr _set_listss  z!ListStore.set.._set_listsrrrToo many argumentsArgument list must be in the form of (column, value, ...), ((columns,...), (values, ...)) or {column: value}. No -1 termination is needed.)rrrr(rBrprrr"rrr!rr rrs  z ListStore.set)N)N)N)N)N rrrr#rrrrrrrrrrrrr s    r c@s|eZdZddZeddZeddZeddZed d Zd d Z d dZ ddZ ddZ ddZ ddZddZdS)rcCsht|tjstdt|j||_t|tjr>|||_ n&t|tj rR||_ ntdt|jdS)Nz expected Gtk.TreeModel, %s foundz/expected Gtk.TreeIter or Gtk.TreePath, %s found) rr rrprrrrrrEr)r"rZ iter_or_pathrrrr#8s   zTreeModelRow.__init__cCs|j|jSr)rrrEr$rrrrDszTreeModelRow.pathcCs|Sr)get_nextr$rrrnextHszTreeModelRow.nextcCs|Sr) get_previousr$rrrpreviousLszTreeModelRow.previouscCs|Sr) get_parentr$rrrrPszTreeModelRow.parentcCs"|j|j}|rt|j|SdSr)rrrEr)r"rrrrr&TszTreeModelRow.get_nextcCs"|j|j}|rt|j|SdSr)rrrEr)r"rrrrr(YszTreeModelRow.get_previouscCs"|j|j}|rt|j|SdSr)rrrEr)r"Z parent_iterrrrr*^szTreeModelRow.get_parentcst|trH|jkr&td|n|dkr8|}jj|St|tr| j\}}}g}t |||D]}| jj|qx|St|t rfdd|DSt dt|jdS)N!column index is out of bounds: %drcsg|] }|qSrr)rIkr$rrrLqrMz,TreeModelRow.__getitem__..z0indices must be integers, slice or tuple, not %s)rrrrr_convert_negative_indexr9rEsliceindicesrangerrrprr)r"rrstopstepZalistirr$rrcs"    zTreeModelRow.__getitem__c Cs4t|trL||jkr&td|n|dkr8||}|j|j||nt|tr| |j\}}}t |||}t |t |krt dt |t |ft |D]\}}|j|j|||qnft|trt |t |krt dt |t |ft||D]\} }||| <qntdt|jdS)Nr+rz9attempt to assign sequence of size %d to slice of size %dzr?r'r,rrrrrs rcsveZdZdddZfddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZZS)rrcCszt|trt|}nt|ts2ddd|D}t|dkrJtd|z t|WStyttd|Yn0dS)Nz:css|]}t|VqdSr)r{)rIZvalrrrZ rMz#TreePath.__new__..rz-could not parse subscript '%s' as a tree path)rrr{ZjoinrBrprZnew_from_string)clsrrrr__new__s       zTreePath.__new__cstt|dSr)r-rr#rr/rrr#szTreePath.__init__cCs |p dS)N)Z to_stringr$rrr__str__szTreePath.__str__cCs|duo||dkSrZcomparer"Zotherrrr__lt__szTreePath.__lt__cCs|duo||dkSrr:r;rrr__le__szTreePath.__le__cCs|duo||dkSrr:r;rrr__eq__szTreePath.__eq__cCs|dup||dkSrr:r;rrr__ne__szTreePath.__ne__cCs|dup||dkSrr:r;rrr__gt__szTreePath.__gt__cCs|dup||dkSrr:r;rrr__ge__szTreePath.__ge__cCs t|Sr)rErr$rrrr,szTreePath.__iter__cCs|Sr)Z get_depthr$rrrrDszTreePath.__len__cCs ||Sr)r)r"rrrrrszTreePath.__getitem__)r)rrrr7r#r9r<r=r>r?r@rAr,rDrr@rrr/rrs rc@s^eZdZddZddZdddZddd Zdd d Zdd d ZdddZ ddZ ddZ dS) TreeStorecGstj|||dSr)r rBr#rrrrrr#s zTreeStore.__init__cCs<|dur(||\}}|||||}ntj|||}|Sr)rZinsert_with_valuesr rBr)r"rrXrrrrrrrs zTreeStore._do_insertNcCs||d|SrTrr"rrrrrrszTreeStore.appendcCs||d|SrrrCrrrrszTreeStore.prependcCs||||Srr)r"rrXrrrrrszTreeStore.insertcCsX|durH|durd}n$|dur(||}||d}||||Stj|||SrT)rrrrr rBrr"rrrrXrrrrs zTreeStore.insert_beforecCs\|durL|durd}n(|dur(||}||dd}||||Stj|||Sr)rrrrr rBrrDrrrrs zTreeStore.insert_aftercCs"|||}tj||||dSr)rr rBrrrrrrs zTreeStore.set_valuecsfdd}|rt|dtr@||ddd|dddnlt|dttfrzt|dkrftd||d|dn2t|dtr||d|dntddS)Ncsxt|t|krtdg}g}t||D]6\}}t|tsDtd|||||q*tj ||dSr) rBrprrrrrr rBrrr rrr!!s  z!TreeStore.set.._set_listsrrrr"r#) rrrr(rBrprZkeysrr$rr rr s  z TreeStore.set)N)N)N)N)Nr%rrrrrBs    rBcseZdZeser"eejjde dZe ejj Z e ejj Z e ejj Z fddZfddZdfd d Zdfd d Zdfdd ZddZZS)TreeViewrr`cs t|}tt||||dSr)rr-rEenable_model_drag_source)r"Zstart_button_maskractionsrr/rrrFKs  z!TreeView.enable_model_drag_sourcecst|}tt|||dSr)rr-rEenable_model_drag_dest)r"rrGrr/rrrHQs zTreeView.enable_model_drag_destNFcs0t|tjst|}tt||||||dSr)rr rr-rEscroll_to_cell)r"rrZ use_alignZ row_alignZ col_alignr/rrrJVs zTreeView.scroll_to_cellcs,t|tjst|}tt||||dSr)rr rr-rE set_cursor)r"rrZ start_editingr/rrrK[s zTreeView.set_cursorcs&t|tjst|}tt|||Sr)rr rr-rE get_cell_area)r"rrr/rrrL`s zTreeView.get_cell_areacKs>t}||||d||||j|fi|dS)NF)TreeViewColumnZ set_title pack_startZ insert_columnset_attributes)r"rXrZcellrPrrrrinsert_column_with_attributeses    z&TreeView.insert_column_with_attributes)NFrIrI)NF)N)rrrr>r?r r rEr#rrZget_path_at_posrZget_dest_row_at_posrFrHrJrKrLrPr@rrr/rrEAs     rEcs<eZdZd ddZeejjZd fdd ZddZ Z S) rMr8NcKsDtjj||d|r ||d|D]\}}||||q(dS)NrT)r rMr#rNrO add_attribute)r"r cell_renderer attributesrJr;rrrr#rs  zTreeViewColumn.__init__cstt||||dSr)r-rMset_cell_data_func)r"rRfuncZ func_datar/rrrT~sz!TreeViewColumn.set_cell_data_funccKs6tj|||D]\}}tj||||qdSr)r Z CellLayoutZclear_attributesrOrQ)r"rRrSrJr;rrrrOszTreeViewColumn.set_attributes)r8N)N) rrrr#rr rMZcell_get_positionrTrOr@rrr/rrMqs  rMcs4eZdZfddZfddZfddZZS) TreeSelectioncs(t|tjst|}tt||dSr)rr rr-rV select_pathrr/rrrWs zTreeSelection.select_pathcs,tt|\}}}|r ||fS|dfSdSr)r-rV get_selected)r"rrrr/rrrXszTreeSelection.get_selectedcstt|\}}||fSr)r-rVget_selected_rows)r"rowsrr/rrrYszTreeSelection.get_selected_rows)rrrrWrXrYr@rrr/rrVs  rVc@sReZdZeejjddeddZddZe ej dr:dd Z e ej d rNd d Z d S)Button)r]stock use_stock use_underline)r\r)rarrbrcOstd|vr`|dr`tjdtdd|}|d|d<d|d<d|d<|d=tjj|fi|n|j|i|dS) Nr\zKStock items are deprecated. Please use: Gtk.Button.new_with_mnemonic(label)rrr]Tr]r^)rrrrr r[r#r)r"rrPrrrrr#s zButton.__init__set_focus_on_clickcOstjj|g|Ri|Sr)r r'r_rrrrr_szButton.set_focus_on_clickget_focus_on_clickcOstjj|g|Ri|Sr)r r'r`rrrrr`szButton.get_focus_on_clickN) rrrr r r[r#rrrr'r_r`rrrrr[s  r[c@seZdZeejjdedZdS) LinkButton)Zurir]r`N)rrrr r rar#rrrrrrasrac@seZdZeejjdedZdS)Labelrr`N)rrrr r rbr#rrrrrrbsrbc@s8eZdZeser,eejjdddde ddZ ddZd S) Adjustment)r;ZlowerZupperstep_incrementpage_incrementZ page_sizeZ page_incrZ step_incr)rerdr)rarrbrcOststrL|j|i|d|vr0||dq|t|dkr|||dn0tjj|g|Ri|d|vr|||ddS)Nr;rr)r>r?rrrBr rcr#rrrrr#s zAdjustment.__init__N) rrrr>r?r r rcr#rrrrrrrcsrcc@sPeZdZeejjddddedZejj ejj Bejj ejj BddfddZ d S) Table)n_rowsrrrZr)rgrrrc Cs"tj|||||||||| dSr)r rfattach) r"r*Z left_attachZ right_attachZ top_attachZ bottom_attachZxoptionsZyoptionsZxpaddingZypaddingrrrrhsz Table.attachN) rrrr r rfr#rZ AttachOptionsZEXPANDZFILLrhrrrrrfs rfc@seZdZeejjdedZdS)ScrolledWindowZ hadjustmentZ vadjustmentr`N)rrrr r rir#rrrrrrisric@seZdZeejjdedZdS) HScrollbarZ adjustmentr`N)rrrr r rkr#rrrrrrksrkc@seZdZeejjdedZdS) VScrollbarrlr`N)rrrr r rmr#rrrrrrm srmcs,eZdZdfdd Zdfdd ZZS) PanedFTcstt||||dSr)r-rnpack1r"r*ZresizeZshrinkr/rrro+sz Paned.pack1cstt||||dSr)r-rnpack2rpr/rrrq.sz Paned.pack2)FT)TT)rrrrorqr@rrr/rrn*srnc@seZdZeejjdedZdS)Arrow)Z arrow_typeZ shadow_typer`N)rrrr r rrr#rrrrrrr6srrcs&eZdZdddZfddZZS)IconSetNcCs6|dur&tjdtddtj|}n tj|}|S)NzXGtk.IconSet(pixbuf) has been deprecated. Please use: Gtk.IconSet.new_from_pixbuf(pixbuf)rr)rrrr rsZnew_from_pixbufr7)r6ZpixbufZiconsetrrrr7?s zIconSet.__new__cstt|Sr)r-rsr#rr/rrr#IszIconSet.__init__)N)rrrr7r#r@rrr/rrs>s rsc@seZdZeejjdedZdS)Viewportrjr`N)rrrr r rtr#rrrrrrtOsrtcs&eZdZdfdd ZddZZS)TreeModelFilterNcstt|||dSr)r-ruset_visible_func)r"rUdatar/rrrvYsz TreeModelFilter.set_visible_funccCs ||}||||dSr)Zconvert_iter_to_child_iterZ get_modelr)r"rErr;rrrr\s zTreeModelFilter.set_value)N)rrrrvrr@rrr/rruXsrucs,eZdZedddZdfdd ZZS) CustomSorterNcCs$|durt|}nd}tj||Sr)r r rxr)r6r rm compare_funcrrrrhs zCustomSorter.newcs(|durt|}nd}tt|||Sr)r r-rxr )r"r rmryr/rrr qs zCustomSorter.set_sort_func)N)N)rrrr rr r@rrr/rrxfs rxc@seZdZddZdS)Menuc Cs|d||||||dSr)Zpopup_for_device)r"Zparent_menu_shellZparent_menu_itemrUrwZbuttonZ activate_timerrrpopup~sz Menu.popupN)rrrr{rrrrrz}srzcGs tdSr)_Gtk_main_quit)rrrr main_quitsr}c OspttjRt,t|i|WdWdS1sD0YWdn1sb0YdSr)rr r}r _Gtk_main)rrPrrrmains r stock_lookup)aZsysrZ gi.repositoryrZ _ossighelperrrrrrZ overridesrrr r Zmoduler Zgir r Z_versionr>r?r=Z__all__rZwarn_msgrZRuntimeWarningrrrZobjectr r'rArSr[rcreryrrrrr|rrr#rrrrrrrrrrrrrrrrr rrrrBrErMrVr[rarbrcrfrirkrmrnrrrsrtrurxrzr}r|rr~rZ init_checkrZargvr(rrrrZs            ,  (               *    X                J        Q g  1 P ,    %