gtk3

GTK+ MenuItem Size Small

主宰稳场 提交于 2019-12-23 05:32:38
问题 On a machine running Windows, the MenuItems are too small for my use case. Therefore, my question is, " how I may increase the font size of the text "Save", "Load" and "Exit?" " If not, then how can I increase the padding between the MenuItems? (without adding more of those line separators as seen between "Load" and "Exit") Additionally, how may I remove the intermediate variable SubMenu1 , if possible? Cropped Screenshot Below is a complete source to reproduce: #include <gtk/gtk.h> int main

Gtkglext and gtkglarea gtk3 windows does not work

你。 提交于 2019-12-23 03:14:40
问题 I need to get working gtk3 with vtk6. Ive just built (after some effort) gtkglext for gtk3. Later I built vtkmm1.2 with the win32 patches and I do not see vtk widget. Due to this, I discovered I cant see any draw in the gtkglext examples. On the other side, Ive tried the excellent example of gtkglarea (the new, gtk built in one ) with plain opengl from https://www.bassi.io/articles/2015/02/17/using-opengl-with-gtk/ and I get no draw because "fb setup not supported". It seems the framebuffer

using cairo with gtk3

≯℡__Kan透↙ 提交于 2019-12-23 03:06:59
问题 I am trying to draw a scatterplot with cairo in gtk3. To start, I am using the examples here: http://zetcode.com/tutorials/cairographicstutorial/ They compile with gtk2 successfully but display no image. They do not compile with gtk3 but give the following error: example.c: In function ‘on_expose_event’: example.c:17:31: error: ‘GtkWidget’ has no member named ‘window’ Any help on this would be greatly appreciated. btw I am using writing using ArchLinux for this if that helps. 回答1: There have

MVC with Python3 and Gtk3

一笑奈何 提交于 2019-12-23 02:52:29
问题 Is there any way to use MVC pattern with Python3 and Gtk3? I found a library called pygtkmvc , but it's based on pygtk , that is, gtk2 . 回答1: MVC is a pattern, you don't need a library in order to use it. It would go something like this contrived example: import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, GObject class Model(object): @property def greetee(self): return 'World' class Controller(object): def __init__(self, model, view): self._model = model self._view =

Python PyGOobject treeview: confirm edit after move between cells with Tab key

时光怂恿深爱的人放手 提交于 2019-12-23 02:19:25
问题 After searching for a long time I found a solution (pretty simple) to move between cells of a treeview grid using Tab key and mantaining cells in edit mode. Now I've got a problem: cell edit confirmation happens only after pressing Enter key. If I press Tab key a editing_canceled event appears to be triggered. How to solve it? How to permit the data confirmation also on tab key press? This is my event handler for treeview key-press-event: def key_tree_Tab(self, treeview, event,namewidget):

Python 3.4 / GTK / Async

人走茶凉 提交于 2019-12-22 12:38:31
问题 I use tkinter with a async funktion. Now I will use gtk3 in stead of tkinkter. Is there also a way to run my async function? How should I adapt the code Here are some code fragments: async def _event_loop(app, interval=0.05): try: while True: app.update() await asyncio.sleep(interval) except tkinter.TclError as exc: if "application has been destroyed" not in exc.args[0]: raise class SSHFrame(tkinter.Frame): def __init__(self, parent): super().__init__(parent) ... ... async def _run(self, host

How to left align a Gtk Label when its width is set by GtkSizeGroup

◇◆丶佛笑我妖孽 提交于 2019-12-22 11:08:05
问题 I have labels that should be left aligned and should all have the same width. I'm using a GtkSizeGroup to achieve the sizing (because the labels don't all have the same parent). Unfortunately this seems to break alignment: With the below code the labels align horizontally in the middle even though I ask for GTK_ALIGN_START . If I remove the sizegroup the labels align to start as they should. /* gcc `pkg-config --libs --cflags gtk+-3.0` label-align-test.c */ #include <gtk/gtk.h> int main(int

How do I change a Gtk3 Entry text color in Python3?

筅森魡賤 提交于 2019-12-22 08:35:49
问题 I have a list of Gtk.Entry() in my application, and I would like to change the color of the text of some of them. I tried the following : #!/usr/bin/python3 # Filename: mywindow.py from gi.repository import Gtk from gi.repository import Gdk class MyWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="My window") self.mainGrid = Gtk.Grid() self.add(self.mainGrid) self.myOkEntry = Gtk.Entry() self.myOkEntry.set_text("This is OK (green)") self.myOkEntry.override_color(Gtk

Gtk3 label line spacing

可紊 提交于 2019-12-22 00:35:20
问题 Is there any way to specify spacing between lines of text in multiline Gtk3 Label, as with CSS line-height property? This CSS property does not work and I can't google out anything else. 回答1: I found the solution using Pangoattribute on label <br>PangoAttrList *attr_list;</br> <br>PangoAttribute *attr;</br> <br> attr_list=pango_attr_list_new();</br> <br>attr=pango_attr_rise_new (20000);</br> <br>pango_attr_list_insert(attr_list,attr);</br> <br>gtk_label_set_attributes(GTK_LABEL(label),attr

How to set multiple items into a GtkSelection for Treeview drag and drop

淺唱寂寞╮ 提交于 2019-12-21 23:57:14
问题 My current project uses a Gtk.TreeView to display the contents of a ListView with four fields per row, two strings, an int and a boolean . I'm trying to implement drag and drop rearrangement of rows in the TreeView. I don't want simply to use TreeView.set_reorderable(True) for the built-in drag and drop because I want to have some control over the insertion and deletion of data from the model as well as to be able to implement undo/redo of drag and drop operations. I'm using Python 3.2 and