Logo Search packages:      
Sourcecode: samba-gtk version File versions  Download package

def sambagtk::dialogs::RegValueEditDialog::on_binary_data_ascii_text_view_buffer_changed (   self,
  widget 
)
this function formats the text in the ascii field whenever it's changed

Definition at line 1652 of file dialogs.py.

                                                                   :
        """this function formats the text in the ascii field whenever it's changed""" 
        if (self.disable_signals):
            return
        
        self.disable_signals = True
        if widget == None:
            widget = self.binary_data_ascii_text_view.get_buffer()
        
        #stuff we need to move the cursor properly later
        cursor_iter = widget.get_iter_at_mark(widget.get_insert()) #insert means cursor, or "the insertion point" as gtk calls it
        cursor_offset = cursor_iter.get_offset()
        
        text = widget.get_text(widget.get_start_iter(), widget.get_end_iter())
        text = self.check_ascii_string(text)
        widget.set_text(text)
        
        #Calling this function below will translate the hex back into our ascii box, making errors easier to spot
        self.disable_signals = False
        self.on_binary_data_hex_text_view_buffer_changed(None)
        self.disable_signals = True
        
        #now that we've overwritten everything in the textbuffer, we have to put the cursor back in the same spot
        widget.place_cursor(widget.get_iter_at_offset(cursor_offset + self.ascii_cursor_shift))
        self.ascii_cursor_shift = 0
                                            
        self.disable_signals = False
        

Generated by  Doxygen 1.6.0   Back to index