7

With GTK3 some Treeviews (I presume) have a few buttons at the bottom that appear to be part of it. The System Settings in Ubuntu uses this, as well as the File Selector dialog for GTK3 apps

Example treeview

Is this a part of GTK3 or just a specially made container?

2

2 Answers 2

7

In case anyone else comes here, the buttons are ToolButtons in a Toolbar with the "inline-toolbar" class

self.listTools=Gtk.Toolbar()
self.listTools.set_property("icon_size",1)
context=self.listTools.get_style_context()
context.add_class("inline-toolbar")

self.addButton=Gtk.ToolButton()
self.addButton.set_property("visible",True)
self.addButton.set_property("can_focus",False)
self.addButton.set_property("use_action_appearance",False)
self.addButton.set_property("use_underline",False)
self.addButton.set_property("icon_name","list-add-symbolic")
self.listTools.add(self.addButton)

I'm not sure if all the button specific properties are necessary

I packed the treeview above the toolbar an a ScrolledWindow and gave it these properties

scrolled_window = Gtk.ScrolledWindow()
scrolled_window.add_with_viewport(self.objectsView)
scrolled_window.set_property("shadow_type","in")

Then finally I packed the ScrolledWindow above the Toolbar in a VBox

Sign up to request clarification or add additional context in comments.

Comments

0

The add/remove/up/down buttons are separate controls from TreeView. You'll have to add them to your UI and implement the behavior yourself.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.