parameters: (dad, vbox_tree, pref_dialog)
docstring: Preferences Dialog, Tree Tab part 2
docstring_summary: Preferences Dialog, Tree Tab part 2
docstring_tokens: Preferences Dialog Tree Tab part 2
function: def preferences_tab_tree_2(dad, vbox_tree, pref_dialog):
      """Preferences Dialog, Tree Tab part 2"""
      for child in vbox_tree.get_children(): child.destroy()
  
      vbox_misc_tree = gtk.VBox()
      hbox_tree_nodes_names_width = gtk.HBox()
      hbox_tree_nodes_names_width.set_spacing(4)
      label_tree_nodes_names_width = gtk.Label(_("Tree Nodes Names Wrapping Width"))
      adj_tree_nodes_names_width = gtk.Adjustment(value=dad.cherry_wrap_width, lower=10, upper=10000, step_incr=1)
      spinbutton_tree_nodes_names_width = gtk.SpinButton(adj_tree_nodes_names_width)
      spinbutton_tree_nodes_names_width.set_value(dad.cherry_wrap_width)
      hbox_tree_nodes_names_width.pack_start(label_tree_nodes_names_width, expand=False)
      hbox_tree_nodes_names_width.pack_start(spinbutton_tree_nodes_names_width, expand=False)
      checkbutton_tree_right_side = gtk.CheckButton(_("Display Tree on the Right Side"))
      checkbutton_tree_right_side.set_active(dad.tree_right_side)
      checkbutton_tree_click_focus_text = gtk.CheckButton(_("Move Focus to Text at Mouse Click"))
      checkbutton_tree_click_focus_text.set_active(dad.tree_click_focus_text)
      checkbutton_tree_click_expand = gtk.CheckButton(_("Expand Node at Mouse Click"))
      checkbutton_tree_click_expand.set_active(dad.tree_click_expand)
      hbox_nodes_on_node_name_header = gtk.HBox()
      hbox_nodes_on_node_name_header.set_spacing(4)
      label_nodes_on_node_name_header = gtk.Label(_("Last Visited Nodes on Node Name Header"))
      adj_nodes_on_node_name_header = gtk.Adjustment(value=dad.nodes_on_node_name_header, lower=0, upper=100, step_incr=1)
      spinbutton_nodes_on_node_name_header = gtk.SpinButton(adj_nodes_on_node_name_header)
      spinbutton_nodes_on_node_name_header.set_value(dad.nodes_on_node_name_header)
      hbox_nodes_on_node_name_header.pack_start(label_nodes_on_node_name_header, expand=False)
      hbox_nodes_on_node_name_header.pack_start(spinbutton_nodes_on_node_name_header, expand=False)
  
      vbox_misc_tree.pack_start(hbox_tree_nodes_names_width, expand=False)
      vbox_misc_tree.pack_start(checkbutton_tree_right_side, expand=False)
      vbox_misc_tree.pack_start(checkbutton_tree_click_focus_text, expand=False)
      vbox_misc_tree.pack_start(checkbutton_tree_click_expand, expand=False)
      vbox_misc_tree.pack_start(hbox_nodes_on_node_name_header, expand=False)
      frame_misc_tree = gtk.Frame(label="<b>"+_("Miscellaneous")+"</b>")
      frame_misc_tree.get_label_widget().set_use_markup(True)
      frame_misc_tree.set_shadow_type(gtk.SHADOW_NONE)
      align_misc_tree = gtk.Alignment()
      align_misc_tree.set_padding(3, 6, 6, 6)
      align_misc_tree.add(vbox_misc_tree)
      frame_misc_tree.add(align_misc_tree)
  
      vbox_tree.pack_start(frame_misc_tree, expand=False)
      def on_spinbutton_tree_nodes_names_width_value_changed(spinbutton):
          dad.cherry_wrap_width = int(spinbutton.get_value())
          dad.renderer_text.set_property('wrap-width', dad.cherry_wrap_width)
          dad.treeview_refresh()
      spinbutton_tree_nodes_names_width.connect('value-changed', on_spinbutton_tree_nodes_names_width_value_changed)
      def on_checkbutton_tree_right_side_toggled(checkbutton):
          dad.tree_right_side = checkbutton.get_active()
          tree_width = dad.scrolledwindow_tree.get_allocation().width
          text_width = dad.vbox_text.get_allocation().width
          dad.hpaned.remove(dad.scrolledwindow_tree)
          dad.hpaned.remove(dad.vbox_text)
          if dad.tree_right_side:
              dad.hpaned.add1(dad.vbox_text)
              dad.hpaned.add2(dad.scrolledwindow_tree)
              dad.hpaned.set_property('position', text_width)
          else:
              dad.hpaned.add1(dad.scrolledwindow_tree)
              dad.hpaned.add2(dad.vbox_text)
              dad.hpaned.set_property('position', tree_width)
      checkbutton_tree_right_side.connect('toggled', on_checkbutton_tree_right_side_toggled)
      def on_checkbutton_tree_click_focus_text_toggled(checkbutton):
          dad.tree_click_focus_text = checkbutton.get_active()
      checkbutton_tree_click_focus_text.connect('toggled', on_checkbutton_tree_click_focus_text_toggled)
      def on_checkbutton_tree_click_expand_toggled(checkbutton):
          dad.tree_click_expand = checkbutton.get_active()
      checkbutton_tree_click_expand.connect('toggled', on_checkbutton_tree_click_expand_toggled)
      def on_spinbutton_nodes_on_node_name_header_value_changed(spinbutton):
          dad.nodes_on_node_name_header = int(spinbutton.get_value())
          dad.update_node_name_header_num_latest_visited()
      spinbutton_nodes_on_node_name_header.connect('value-changed', on_spinbutton_nodes_on_node_name_header_value_changed)
function_tokens: def preferences_tab_tree_2 ( dad , vbox_tree , pref_dialog ) : for child in vbox_tree . get_children ( ) : child . destroy ( ) vbox_misc_tree = gtk . VBox ( ) hbox_tree_nodes_names_width = gtk . HBox ( ) hbox_tree_nodes_names_width . set_spacing ( 4 ) label_tree_nodes_names_width = gtk . Label ( _ ( "Tree Nodes Names Wrapping Width" ) ) adj_tree_nodes_names_width = gtk . Adjustment ( value = dad . cherry_wrap_width , lower = 10 , upper = 10000 , step_incr = 1 ) spinbutton_tree_nodes_names_width = gtk . SpinButton ( adj_tree_nodes_names_width ) spinbutton_tree_nodes_names_width . set_value ( dad . cherry_wrap_width ) hbox_tree_nodes_names_width . pack_start ( label_tree_nodes_names_width , expand = False ) hbox_tree_nodes_names_width . pack_start ( spinbutton_tree_nodes_names_width , expand = False ) checkbutton_tree_right_side = gtk . CheckButton ( _ ( "Display Tree on the Right Side" ) ) checkbutton_tree_right_side . set_active ( dad . tree_right_side ) checkbutton_tree_click_focus_text = gtk . CheckButton ( _ ( "Move Focus to Text at Mouse Click" ) ) checkbutton_tree_click_focus_text . set_active ( dad . tree_click_focus_text ) checkbutton_tree_click_expand = gtk . CheckButton ( _ ( "Expand Node at Mouse Click" ) ) checkbutton_tree_click_expand . set_active ( dad . tree_click_expand ) hbox_nodes_on_node_name_header = gtk . HBox ( ) hbox_nodes_on_node_name_header . set_spacing ( 4 ) label_nodes_on_node_name_header = gtk . Label ( _ ( "Last Visited Nodes on Node Name Header" ) ) adj_nodes_on_node_name_header = gtk . Adjustment ( value = dad . nodes_on_node_name_header , lower = 0 , upper = 100 , step_incr = 1 ) spinbutton_nodes_on_node_name_header = gtk . SpinButton ( adj_nodes_on_node_name_header ) spinbutton_nodes_on_node_name_header . set_value ( dad . nodes_on_node_name_header ) hbox_nodes_on_node_name_header . pack_start ( label_nodes_on_node_name_header , expand = False ) hbox_nodes_on_node_name_header . pack_start ( spinbutton_nodes_on_node_name_header , expand = False ) vbox_misc_tree . pack_start ( hbox_tree_nodes_names_width , expand = False ) vbox_misc_tree . pack_start ( checkbutton_tree_right_side , expand = False ) vbox_misc_tree . pack_start ( checkbutton_tree_click_focus_text , expand = False ) vbox_misc_tree . pack_start ( checkbutton_tree_click_expand , expand = False ) vbox_misc_tree . pack_start ( hbox_nodes_on_node_name_header , expand = False ) frame_misc_tree = gtk . Frame ( label = "<b>" + _ ( "Miscellaneous" ) + "</b>" ) frame_misc_tree . get_label_widget ( ) . set_use_markup ( True ) frame_misc_tree . set_shadow_type ( gtk . SHADOW_NONE ) align_misc_tree = gtk . Alignment ( ) align_misc_tree . set_padding ( 3 , 6 , 6 , 6 ) align_misc_tree . add ( vbox_misc_tree ) frame_misc_tree . add ( align_misc_tree ) vbox_tree . pack_start ( frame_misc_tree , expand = False ) def on_spinbutton_tree_nodes_names_width_value_changed ( spinbutton ) : dad . cherry_wrap_width = int ( spinbutton . get_value ( ) ) dad . renderer_text . set_property ( 'wrap-width' , dad . cherry_wrap_width ) dad . treeview_refresh ( ) spinbutton_tree_nodes_names_width . connect ( 'value-changed' , on_spinbutton_tree_nodes_names_width_value_changed ) def on_checkbutton_tree_right_side_toggled ( checkbutton ) : dad . tree_right_side = checkbutton . get_active ( ) tree_width = dad . scrolledwindow_tree . get_allocation ( ) . width text_width = dad . vbox_text . get_allocation ( ) . width dad . hpaned . remove ( dad . scrolledwindow_tree ) dad . hpaned . remove ( dad . vbox_text ) if dad . tree_right_side : dad . hpaned . add1 ( dad . vbox_text ) dad . hpaned . add2 ( dad . scrolledwindow_tree ) dad . hpaned . set_property ( 'position' , text_width ) else : dad . hpaned . add1 ( dad . scrolledwindow_tree ) dad . hpaned . add2 ( dad . vbox_text ) dad . hpaned . set_property ( 'position' , tree_width ) checkbutton_tree_right_side . connect ( 'toggled' , on_checkbutton_tree_right_side_toggled ) def on_checkbutton_tree_click_focus_text_toggled ( checkbutton ) : dad . tree_click_focus_text = checkbutton . get_active ( ) checkbutton_tree_click_focus_text . connect ( 'toggled' , on_checkbutton_tree_click_focus_text_toggled ) def on_checkbutton_tree_click_expand_toggled ( checkbutton ) : dad . tree_click_expand = checkbutton . get_active ( ) checkbutton_tree_click_expand . connect ( 'toggled' , on_checkbutton_tree_click_expand_toggled ) def on_spinbutton_nodes_on_node_name_header_value_changed ( spinbutton ) : dad . nodes_on_node_name_header = int ( spinbutton . get_value ( ) ) dad . update_node_name_header_num_latest_visited ( ) spinbutton_nodes_on_node_name_header . connect ( 'value-changed' , on_spinbutton_nodes_on_node_name_header_value_changed )