Logo Search packages:      
Sourcecode: harpia version File versions  Download package

def harpia::harpiagcfrontend::S2iHarpiaFrontend::__InsertBlocks (   self  )  [private]

Inserts the blocks in the BlocksTree.

Definition at line 199 of file harpiagcfrontend.py.

00199                               :
            """
            Inserts the blocks in the BlocksTree.
            """

            t_oTreeStore = gtk.TreeStore( gobject.TYPE_STRING,gobject.TYPE_PYOBJECT )

            t_oImage = gtk.CellRendererPixbuf()
            
            
            for t_sItem in self.Blocks.keys():

                  t_oParent = t_oTreeStore.append( None, [t_sItem,t_oImage] )

                  for t_nIndex in range( len(self.Blocks[t_sItem]) ):

                        t_oTreeStore.append( t_oParent, [self.Blocks[t_sItem][t_nIndex],t_oImage] )

            self.widgets['BlocksTreeView'].set_model( t_oTreeStore )

            t_oTextRender = gtk.CellRendererText()
      
            t_oTextRender.set_property( 'editable', False )

            t_oColumn = gtk.TreeViewColumn(_("Available Blocks"), t_oTextRender, text=0)

            self.widgets['BlocksTreeView'].append_column( t_oColumn )

#           TARGETS = [
#                 ('MY_TREE_MODEL_ROW', gtk.TARGET_SAME_WIDGET, 0),
#                 ('text/plain', 0, 1),
#                 ('TEXT', 0, 2),
#                 ('STRING', 0, 3),
#                 ]

            #drag......
            self.widgets['BlocksTreeView'].enable_model_drag_source( gtk.gdk.BUTTON1_MASK,
                                                                                                 [('text/plain', gtk.TARGET_SAME_APP, 1)],
                                                                                                gtk.gdk.ACTION_DEFAULT|
                                                                                                gtk.gdk.ACTION_COPY)
            self.widgets['BlocksTreeView'].connect( "drag-data-get", self.drag_data_get_cb)

            #........'n'drop
            self.widgets['WorkArea'].connect( "drag_data_received", self.drag_data_received)
            self.widgets['WorkArea'].drag_dest_set(gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT |gtk.DEST_DEFAULT_DROP,  [('text/plain', gtk.TARGET_SAME_APP, 1)], gtk.gdk.ACTION_DEFAULT | gtk.gdk.ACTION_COPY)


Generated by  Doxygen 1.6.0   Back to index