GTK – Python Treeview Sorting Behavior (Column Header Need to be Clicked Twice)

I have a GTK3 GUI and a treeview on it. My code is written in Python 3.7.

I need to sort columns by clicking on them and this works. But I have to click on column header button twice to revert sorting (from descending to ascending). This happens both by mouse click and by using the code. Is this a bug and could this behavior be changed?

Here is the very simplified code:

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

builder = Gtk.Builder()
builder.add_from_file('test1.glade')
window1 = builder.get_object('window1')
treeview1 = builder.get_object('treeview1')

class Signals:
    def on_window1_destroy(self, widget):
        Gtk.main_quit()

file_data = (("a", 1),
             ("b", 2),
             ("c", 3),
             ("d", 4))

treestore1 = Gtk.TreeStore(str, int)
piter1 = treestore1.append(None, file_data(0))
piter2 = treestore1.append(None, file_data(1))
piter3 = treestore1.append(None, file_data(2))
piter4 = treestore1.append(None, file_data(3))

treeview1.set_model(treestore1)

for i, column_title in enumerate(("Column1", "Column2")):
    renderer = Gtk.CellRendererText()
    column = Gtk.TreeViewColumn(column_title, renderer, text=i)
    column.set_sort_column_id(i)
    treeview1.append_column(column)

# Sorting Code
treeview1.get_column(1).clicked()
treeview1.get_column(1).clicked()

builder.connect_signals(Signals())
window1.show_all()
Gtk.main()

Here is the Glade UI file:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
  <requires lib="gtk+" version="3.20"/>
  <object class="GtkWindow" id="window1">
    <property name="can_focus">False</property>
    <property name="default_width">300</property>
    <property name="default_height">300</property>
    <child>
      <placeholder/>
    </child>
    <child>
      <object class="GtkTreeView" id="treeview1">
        <property name="visible">True</property>
        <property name="can_focus">True</property>
        <child internal-child="selection">
          <object class="GtkTreeSelection"/>
        </child>
      </object>
    </child>
  </object>
</interface>

navigation – How can I make an essential navigational treeview sidebar work on mobile?

I’m currently working on a web application that will have significant user-created content. I
would like to organize this content hierarchically, with a side-bar on the left to navigate, some buttons above it, a navbar at the top, and the main content to the right filling up the whole page. This is similar to what Atlassian’s Confluence does (except I’ll probably have a bit less text above the treeview for navigaton):

Screenshot of Confluence
(image source)

On a desktop or laptop, or even maybe a tablet, this works great — the user can quickly get an overview of the structure of the content that they’re looking at, collapse irrelevant parts, and quickly jump to any page. Additionally, I can use the space above the treeview to show other information and provide UI that is common to each section.

But, on mobile (a phone), this UI is much worse. I could have a collapsible sidebar to the side, but I’ve used a competitor web application that does this and it results in the system being very difficult to use. Furthermore, I already have a hamburger button for a collapsible navbar, so having two may be confusing, and at the very least will be clunky in any way that I can see to do it. I could put the sidebar before the main page content, but then the user has to scroll to get at the content on the page that they want to view, which is likely to be annoying, and I want a very smooth user experience. If I put it on the bottom, below the main content, then the user is liable to miss it.

As such, I ask, how can I take the information that is presented in this design on desktops and laptops, and cleanly, smoothly, reliably, and easily (for the user) present it on mobile?

EDIT: I tried loading a Confluence instance on my phone, and it was a disaster — it basically renders as a desktop application with some of the text enlarged. It looks like they put no thought into the mobile design, or, at least, if they did then it’s not setup on the instance that I checked.

navigation – How can I make an essential naviational treeview sidebar work on mobile?

I’m currently working on a web application that will have significant user-created content. I
would like to organize this content hierarchically, with a side-bar on the left to navigate, some buttons above it, a navbar at the top, and the main content to the right filling up the whole page. This is similar to what Atlassian’s Confluence does (except I’ll probably have a bit less text above the treeview for navigaton):

Screenshot of Confluence
(image source)

On a desktop or laptop, or even maybe a tablet, this works great — the user can quickly get an overview of the structure of the content that they’re looking at, collapse irrelevant parts, and quickly jump to any page. Additionally, I can use the space above the treeview to show other information and provide UI that is common to each section.

But, on mobile (a phone), this UI is much worse. I could have a collapsible sidebar to the side, but I’ve used a competitor web application that does this and it results in the system being very difficult to use. Furthermore, I already have a hamburger button for a collapsible navbar, so having two may be confusing, and at the very least will be clunky in any way that I can see to do it. I could put the sidebar before the main page content, but then the user has to scroll to get at the content on the page that they want to view, which is likely to be annoying, and I want a very smooth user experience. If I put it on the bottom, below the main content, then the user is liable to miss it.

As such, I ask, how can I take the information that is presented in this design on desktops and laptops, and cleanly, smoothly, reliably, and easily (for the user) present it on mobile?

EDIT: I tried loading a Confluence instance on my phone, and it was a disaster — it basically renders as a desktop application with some of the text enlarged. It looks like they put no thought into the mobile design, or, at least, if they did then it’s not setup on the instance that I checked.

javascript – unable to get treeview dropdown in classic site

we are facing issue with N level tree view drop-down while getting dynamic data form list using 2 columns data in classic share point site.
1.column is parent
2.column self lookup column to parent
reference URL followed is :https://jquery-plugins.net/dropdown-tree-dynamic-dropdown-menu-with-jquery-and-bootstrap

Required format:

enter image description here

we are able to get only 2 level children by using below code.

function childrenObj(dataObj){
var arr=()
$.each(dataObj, function (index, subItem) {
    arr.push({
        "title":subItem.Title,                          
    })
});
return arr;

}

var finalArry=();

function getChildren(dataObj){

$.each(dataObj, function (i, value) {
    var temp=$.grep(dataObj,function(item,index){
        return item.PRJName.Title==value.Title;
    })
    if(temp.length>0)
    {       
    var Children= childrenObj(temp)
    if(Children.length>0){
        finalArry.push({

            "title":value.Title,
            "data":Children,
        })
    }
    else{
        finalArry.push({
            "title":value.Title,                
        })
    }       
    }
    else {
        finalArry.push({
            "title":value.Title,                
        })
    }
});
return finalArry;   

}

2013 – TreeView WebPart Property

Is there a way to add a list items TreeView as a WebPart Property?
Can you give me an overview on how to do this, knowing that the TreeView should contain selectable checkboxes that allow to retrieve the selected items.

I know that a custom property will be displayed automatically in the Property Pane if it’s of type bool, DateTime, enum, int, or string. But what if we want to add a TreeView, like in my case?

(I’m under SharePoint 2013)

Llenar un treeview desde un datatable en vb.net,

tengo un codigo en vb6 donde arma el arbol con el treeviewe y quiero migrar
este codigo vb.net con vs2010, como haria? anexo codigo

Public Function CargaArbol()
Set rs = Nothing
Set rs = frmSelectorLT.rsVerif
rs.MoveFirst

X1 = rs.Fields(0)                       'LotePT
X2 = rs.Fields(1)                       'PalletPT


If rs.Fields(2) <> "" Then
X3 = rs.Fields(2)                       'GB

If rs.Fields(3) <> "" Then
X4 = rs.Fields(3)                       'BB

If rs.Fields(4) <> "" Then
X5 = rs.Fields(4)                       'LoteMP

If rs.Fields(5) <> "" Then
X6 = rs.Fields(5)                       'PalletMP

If rs.Fields(6) <> "" Then
X7 = rs.Fields(7) & "/" & rs.Fields(6)        'OC / Lin

Else
X7 = ""
End If

Else
X6 = ""
X7 = ""
End If

Else
X5 = ""
X6 = ""
X7 = ""
End If

Else
X4 = ""
X5 = ""
X6 = ""
X7 = ""
End If

Else
X3 = ""
X4 = ""
X5 = ""
X6 = ""
X7 = ""
End If

R1 = 0
'tv1.Style = tvwTreelinesText
tv1.Style = tvwPictureText
tv1.BorderStyle = vbFixedSingle

'Corte por EOF
rs.MoveFirst
While Not rs.EOF
        R1 = R1 + 1
        Rx1 = "r" & R1
        LotePTAnt = X1
        Set imgX = ImageList1.ListImages(1)
        Set nodX = tv1.Nodes.Add(, , Rx1, "LotePT:" & X1)
        nodX.Image = 6

    'Corte por LotePT
    While (LotePTAnt = X1) And Not rs.EOF
        R2 = R2 + 1
        Rx2 = "s" & R2
        PalletPTAnt = X2
        Set nodX = tv1.Nodes.Add(Rx1, tvwChild, Rx2, "PalletPT: " & X2)
        nodX.Image = 7

        'Corte por Pallet PT
        While (PalletPTAnt = X2) And (LotePTAnt = X1) And Not rs.EOF
            If X3 <> "" Then
            R3 = R3 + 1
            Rx3 = "t" & R3
            Set nodX = tv1.Nodes.Add(Rx2, tvwChild, Rx3, "GrinderBatch :" & X3)
            nodX.Image = 5
            End If
            GrinderBatchAnt = X3

            'Corte Por GB
            While (GrinderBatchAnt = X3) And (PalletPTAnt = X2) And (LotePTAnt = X1) And Not rs.EOF
                If X4 <> "" Then
                R4 = R4 + 1
                Rx4 = "u" & R4
                Set nodX = tv1.Nodes.Add(Rx3, tvwChild, Rx4, "BlenderBatch :" & X4)
                nodX.Image = 4
                End If
                BlenderBatchAnt = X4

                'Corte por BlenderBatch
                While (BlenderBatchAnt = X4) And (GrinderBatchAnt = X3) And (PalletPTAnt = X2) And (LotePTAnt = X1) And Not rs.EOF
                    If X5 <> "" Then
                    R5 = R5 + 1
                    Rx5 = "w" & R5
                    Set nodX = tv1.Nodes.Add(Rx4, tvwChild, Rx5, "LoteMP :" & X5)
                    nodX.Image = 3
                    End If
                    LoteAnt = X5

                    'Corte por Lote MP
                    While (LoteAnt = X5) And (BlenderBatchAnt = X4) And (GrinderBatchAnt = X3) And (PalletPTAnt = X2) And (LotePTAnt =

X1) and not rs.EOF
If X6 <> "" Then
R6 = R6 + 1
Rx6 = "v" & R6
Set nodX = tv1.Nodes.Add (Rx5, tvwChild, Rx6, "PalletMP:" & X6)
nodX.Image = 2
End If
PalletAnt = X6

                        'Corte por PalletMP
                        While (PalletAnt = X6) And (LoteAnt = X5) And (BlenderBatchAnt = X4) And (GrinderBatchAnt = X3) And (PalletPTAnt

= X2) and (LotePTAnt = X1) and not rs.EOF
If X7 <> "" Then
R7 = R7 + 1
Rx7 = "x" & R7
Set nodX = tv1.Nodes.Add (Rx6, tvwChild, Rx7, "OC / Lin:" & X7)
nodX.Image = 1
End If
OClinAnt = X7

                        'Corte por OC/Lin
                        While (OClinAnt = X7) And (PalletAnt = X6) And (LoteAnt = X5) And (BlenderBatchAnt = X4) And (GrinderBatchAnt =

X3) and (PalletPTAnt = X2) and (LotePTAnt = X1) and not rs.EOF
rs.MoveNext
If not, then rs.EOF
X1 = rs.Fields (0) L LotePT
X2 = rs.Fields (1) Pall PalletPT
If rs.Fields (2) <> "" Then
X3 = rs.Fields (2) & # 39; GB
If rs.Fields (3) <> "" Then
X4 = rs.Fields (3) & # 39; BB
If rs.Fields (4) <> "" Then
X5 = rs.Fields (4) & # 39; LoteMP
If rs.Fields (5) <> "" Then
X6 = rs.Fields (5) Pall PalletMP
If rs.Fields (6) <> "" Then
X7 = rs.Fields (7) & "/" & rs.Fields (6) & # 39; OC / Lin
Otherwise
X7 = ""
End If
Otherwise
X6 = ""
X7 = ""
End If
Otherwise
X5 = ""
X6 = ""
X7 = ""
End If
Otherwise
X4 = ""
X5 = ""
X6 = ""
X7 = ""
End If
Otherwise
X3 = ""
X4 = ""
X5 = ""
X6 = ""
X7 = ""
End If
End If
Wend & # 39; Fin Corte OC / Lin
Wend & # 39; Fin Corte from Pallet PT
Wend & # 39; Fin Corte by Lote PT
Wend & # 39; Fin por Corte por Grinder Batch
Wend & # 39; Fin by Corte from Blender Batch
Wend & # 39; Fin por Corte por Pallet MP
Wend & # 39; Fin por Corte por Lote MP
Wend & # 39; Fin por Corte por OC / Lin

End Function

Development – TreeView (bootstrap) where error is

I can not create a bootstrap for the tree view from the list items. Where did I do something wrong? how do you repair?

 





using (SPSite site = new SPSite (SPContext.Current.Web.Url)) { using (SPWeb web = site.OpenWeb ()) { web.AllowUnsafeUpdates = true; SPList lists = web.Lists ("Staff"); SPListItemCollection oitems = lists.GetItems (new SPQuery () { Query = @ "" }); foreach (SPListItem element in Oitems) { String department = (item ("Department")! = Null)? item ("Department"). ToString (): ""; if (department! = null && department! = "") { HtmlGenericControl li = new HtmlGenericControl ("li"); departmentTab.Controls.Add (li); HtmlGenericControl anchor = new HtmlGenericControl ("span"); anchor.Attributes.Add ("href", ""); anchor.InnerText = department; li.Controls.Add (anchor); } string div = (item ("Division")! = null)? item ("Division"). ToString (): ""; if (div! = null && div! = "") { HtmlGenericControl li = new HtmlGenericControl ("li"); divisionTab.Controls.Add (li); HtmlGenericControl anchor = new HtmlGenericControl ("span"); anchor.Attributes.Add ("href", ""); anchor.InnerText = div; li.Controls.Add (anchor); } } } } }

Results:

Enter image description here

Windows Forms – (VB.NET) (TreeView) Converts a text "Docs / Bim / Dex" to the tree view

It is possible to convert a simple "Docs / Bim / Dex" address into a TreeView element.

Example:

Docs / Bim / Dex

Docs
|
+ Bim
|
+ Dex

It occurred to me to use textbox1.text.split ("/")but I know how to use it later, I guess for a while, but I do not know how to start

3.x python – Delete line in Treeview with Psycopg2 and not all records

Hello I'm trying to delete a line in Treeview (Tkinter) in the Postgresql database (Psycopg2). But I deleted all the records and can not apply to a single line. I tried% or% s
I would appreciate the cooperation, thank you.

def delete_employed (self):
send message['text'] = & # 39; & # 39;
Try:
(self.tree.item (self.tree.selection ())) # ['texto'][]
        
        
        
        except IndexError as e:
send message['text'] = & # 39; Please select a record & # 39;
to return
send message['text'] = & # 39; & # 39;
self.num = self.tree.item (self.tree.selection ())['values']
        #query = ("" "DELETE FROM employee WHERE (numdocEmp =% (numdoEmp) s or% (numdocEmp) s is null)" "")
query = ("DELETE FROM employee WHERE id_emp = id_emp")
self.run_query (query, (self.num,))
send message['text'] = & # 39; record {} successfully deleted & 39; format (self.name1Emp)
self.get_employees ()