gtk3

Is there a easier way of creating a bordered Label in python Gtk3 than putting it in Frame?

爷,独闯天下 提交于 2019-12-25 15:51:56
问题 By easier i mean - can i define a style or something and apply it to all labels in my program? I have a lot of labels in it and I don't want to type so much. I heard about "Pango Style" but can I apply it to all label widgets at once? 回答1: The term: "lot of labels" is relative. Are we talking about 14 or 84? If it's closer to 84 you should probably be using Glade to create the interface then set the frames x-pad and y-pad properties. With CSS for gtk3 you'll have to pack any label in a frame

How do I set a listStore model on pre-created listbox from Glade?

馋奶兔 提交于 2019-12-25 12:49:10
问题 Apparently the "proper" way to have items in a GTKListBox or Treeview is constructing with a listStore model, in the constructor. What if I want to use Glade GUI project, in which a list box is already created, and referenced by builder.get_object("appsDocumentListBox") ? Can I set the model after Gtk.builder created the window, or is there a better way to do this? I'm also wondering what the performance improvement is of using the ListStore vs manually adding with row = Gtk.ListBoxRow() ,

How to change/switch windows using Gtk.Application Gtk+3 Glade Python?

烂漫一生 提交于 2019-12-25 12:38:26
问题 I read this tutorial- https://python-gtk-3-tutorial.readthedocs.io/en/latest/application.html It says in the first para - Gtk.Application encompasses many repetitive tasks that a modern application needs such as handling multiple instances, D-Bus activation, opening files, command line parsing, startup/shutdown , menu management , window management , and more. How do I do startup/shutdown, window management and menu management using Gtk.Application? I could not find any tutorials, examples or

Widgets to list files with gtk

夙愿已清 提交于 2019-12-25 11:01:09
问题 I am creating an application which is going to list a bunch of files. I would like to list files like fileroller, but I don't know how. I guess I need to create a 2xn (name, size) grid, but I don't know how to make entries appear light->dark->light per line, and how to create a "fat" bar above it. Can anyone tell me what sort of widgets I need to combine to create something like that? 回答1: You probably want a GtkTreeView with a GtkListStore, that should give you everything you need. If you've

Widgets to list files with gtk

痞子三分冷 提交于 2019-12-25 11:01:07
问题 I am creating an application which is going to list a bunch of files. I would like to list files like fileroller, but I don't know how. I guess I need to create a 2xn (name, size) grid, but I don't know how to make entries appear light->dark->light per line, and how to create a "fat" bar above it. Can anyone tell me what sort of widgets I need to combine to create something like that? 回答1: You probably want a GtkTreeView with a GtkListStore, that should give you everything you need. If you've

Widgets to list files with gtk

非 Y 不嫁゛ 提交于 2019-12-25 11:00:01
问题 I am creating an application which is going to list a bunch of files. I would like to list files like fileroller, but I don't know how. I guess I need to create a 2xn (name, size) grid, but I don't know how to make entries appear light->dark->light per line, and how to create a "fat" bar above it. Can anyone tell me what sort of widgets I need to combine to create something like that? 回答1: You probably want a GtkTreeView with a GtkListStore, that should give you everything you need. If you've

Is a “monitor” in Gtk3 the same as a “Screen” in X11?

我们两清 提交于 2019-12-25 09:15:17
问题 I wrote an application in Gtk3 using gdk_display_get_monitor_at_window and gdk_monitor_get_geometry . Out of 75 gtk functions that I used, these are the only 2 that are causing problems for people trying to compile on Ubuntu because most people are not running a version of Ubuntu that has gtk3 3.22. My application also uses X11, so I want to replace these functions with X11 equivalents. After briefly looking at X11, I have some questions: Is a Gtk "monitor" equal to an X11 "screen"? If the

GtkTreeView with CSS in Gtk3

a 夏天 提交于 2019-12-25 08:43:05
问题 How can I make every other row a different color in a GtkTreeView using CSS for Gtk3? I've tried using: even-row-color, -GtkWidget-even-row-color and GtkTreeView row:nth-child(even). I'm using gtk+-3.2.3 on Ubuntu natty. /* COMPILE WITH: gcc -Wall -o tree1 `pkg-config --cflags --libs gtk+-3.0` tree1.c */ #include <gtk/gtk.h> enum { LIST_ITEM = 0, N_COLUMNS }; static void init_list(GtkWidget *list) { GtkCellRenderer *renderer; GtkTreeViewColumn *column; GtkListStore *store; /******************

Find glade gtk3 widget by unique id

妖精的绣舞 提交于 2019-12-25 04:15:40
问题 In glade I can give a unique id to each widget, however in the c-code, I have no idea how I can make use of these id's. The method "gtk_widget_get_name" seems to return something else. At least currently I only get the typenames from it, e.g. "GtkGrid", "GtkComboBoxText", "GtkStatusbar" ... thats probably the default if I did not set a different name in the c-code. So how can I read the id of a gtkwidget, which I typed into glade ? 回答1: The Glade ID is used with gtk_builder_get_object() to

passing arguments from python gtk function

断了今生、忘了曾经 提交于 2019-12-25 03:47:08
问题 I am trying to pass the "filename" from the function on_file_open_clicked defined as: import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk, Gdk, Pango UI_INFO = """ <ui> <menubar name='MenuBar'> <menu action='FileMenu'> <menuitem action='FileOpen' /> <menuitem action='FileQuit' /> </menu> </menubar> </ui> """ class MenuManager(Gtk.UIManager): def __init__(self): super().__init__() action_group = Gtk.ActionGroup("my_actions") self.add_file_menu_actions(action_group) self