更新时间:2023-01-27 13:55:16
您有两个选择(实际上,您有两个以上的选择,但是在继续之前,您需要尝试前两个).
You have two options (actually you have more than two options, but you need to try the first two before I continue).
连接到树状视图的"row_activated"信号,可以将其设置为单击或双击.这将传递到所选行的路径.
Hook up to the treeview "row_activated" signal, which can be set to single or double click. This will pass in the path to the selected row.
在树视图下方/外部放置一个按钮,以获取树视图"get_selected_row".然后,您可以使用它在新窗口中获取要打开的行的内容. 示例.提示:这是Gtk建议使用带有树状视图的按钮的方式.
Put a button below/outside the treeview that gets a treeview "get_selected_row". You can then use this to get the content of the row you wish to open in a new window. Example. Hint: this is how Gtk recommends using buttons with a treeview.