gtk3

How to capture image of a gtk ApplicationWindow in Python in linux?

谁都会走 提交于 2019-12-12 03:25:15
问题 I need to capture an image of an ApplicationWindow in Python, in linux. This would be my hypothetical test app taken from here: from gi.repository import Gtk import sys class MyWindow(Gtk.ApplicationWindow): # constructor for a Gtk.ApplicationWindow def __init__(self, app): Gtk.Window.__init__(self, title="Welcome to GNOME", application=app) self.set_default_size(200, 100) # create a label label = Gtk.Label() # set the text of the label label.set_text("Hello GNOME!") # add the label to the

gtk3 GtkWindow title bar color

跟風遠走 提交于 2019-12-12 03:23:28
问题 Using gtk3, how can I change the default GtkWindow titlebar color? Would it involve GtkStyleContext? I've only used GtkCssProvider. 回答1: You can't change the titlebar color from GTK. The titlebar is drawn by the window manager, and GTK doesn't "know" anything about it. You can only communicate with the window manager through "hints", such as whether the window should have a titlebar or what string should be displayed there, but the window manager is free to ignore them. 回答2: You can do it...

How to send multiple entrys to function - GTK

元气小坏坏 提交于 2019-12-12 02:41:44
问题 I have developed a financial calculator in c - Black & Scholes. My teacher wants me to implement a GUI to this and he suggested GTK. Due to my poor knowledge in c (java programmer from the start) this is almost too much for me at the moment because the deadline is in 4 hours. But after hard work and good help here on stackoverflow I think I have a chanche to make it!. But right now there is one irritating obstacle to overide - That is to pass more than one entry to a method. In short - there

C GTK can't open Dialog again after closing via ESC

佐手、 提交于 2019-12-12 01:39:54
问题 I have a Dialog called dlg_open with an btn_cancel_open Button. This dialog is mapped at the Buton-Event and the close Event of the dialog to: void on_btn_cancel_clicked (GtkWidget *widget, signal_map_data *smd) { #ifdef debug g_print ("-> on_btn_cancel_clicked\n"); #endif gtk_widget_hide (gtk_widget_get_toplevel (widget) ); gtk_widget_set_sensitive (smd->widg.wmw.wnd, 1); } void on_dlg_close (GtkWidget *widget, signal_map_data *smd) { #ifdef debug g_print ("-> on_dlg_close\n"); #endif gtk

Font setting for a specific gtk application

陌路散爱 提交于 2019-12-12 00:54:46
问题 I want to set the font to be used by a particular Gtk+ 3 application. How can it be done? I know I can set the font to be used by all Gtk+ 3 applications in the file $XDG_CONFIG_HOME/gtk-3.0/settings.ini , but I do not know how the font can be set for only a specific application. Edit: I am not developing the application. I just want to run it with a font size different from the current one set for the desktop. 回答1: Use GtkCssProvider. You don't say what language you're using GTK in, so no

Gtk3 Image full window image from file (python3)

冷暖自知 提交于 2019-12-11 22:44:24
问题 I need to find a way to load a image from file such that the image is actual size. I have read documentation [here][https://lazka.github.io/pgi-docs/Gtk-3.0] and [here][http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html] but the only way that seems to work is using the builder class to load a gui designed in glade. However via code I came up with the following and this does not produce the desired result, image is clipped. from gi.repository import Gtk class MainWindow(Gtk

Python spynner and gtk3 issue

陌路散爱 提交于 2019-12-11 21:13:28
问题 I am always getting the following error on executing the script. I am trying to attach spynner window in a Gtk window. Is spynner will only works with gtk2?? import sys import spynner from BeautifulSoup import BeautifulSoup from gi.repository import Gtk, Gdk from gi.repository import GObject, GLib class App: def __init__(self): self.browser = spynner.Browser() self.create_interior() self.window.show_all() def create_interior(self): self.window = Gtk.Window() self.window.set_border_width(0)

I added a gtk widget to the main window UI file, but it doesn't show up

試著忘記壹切 提交于 2019-12-11 15:59:19
问题 I am trying to add a GtkImage to my main window *.ui file, which was made using the GNOME Builder project template. <?xml version="1.0" encoding="UTF-8"?> <interface> <requires lib="gtk+" version="3.20"/> <template class="PodiumWindow" parent="GtkApplicationWindow"> <property name="default-width">600</property> <property name="default-height">300</property> <child type="titlebar"> <object class="GtkHeaderBar" id="headerBar"> <property name="visible">True</property> <property name="show-close

How to properly close a dialog made in Glade?

自作多情 提交于 2019-12-11 15:05:38
问题 I use Glade to make GUI. I did a main window and a dialog. The dialog is called from a button placed in the main window. The problem is that when I close (delete-event) the dialog it is impossible to call it again with the same button click of the main window. I am able to hide the dialog with gtk_widget_hide_on_delete , but this option is not what I need. I need to close the dialog and free the memory it takes. So what is the proper way to destroy the dialog and call it again with the same

How I can maximize GtkGrid to fill the entire GtkWindow?

女生的网名这么多〃 提交于 2019-12-11 13:53:58
问题 I made a basic GtkGrid application with a simple layout but I can't make the GtkGrid fill the entire GtkWindow . This is the code for creating the layout: GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size(GTK_WINDOW(window), 800, 600); GtkWidget *grid = gtk_grid_new(); g_signal_connect(window,"destroy", G_CALLBACK(gtk_main_quit), NULL); GtkWidget *vpaned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL); gtk_paned_set_position (GTK_PANED (vpaned), 400); GtkWidget