gtk3

Gtk+3 &C & Glade problems

谁都会走 提交于 2019-12-13 15:47:23
问题 I tried to make a simple Gui program with C and Glade on Linux. I wrote a simple program and design a window with Glade. When I run the code it says: (gtk-test:23026): Gtk-CRITICAL **: gtk_widget_show: assertion ‘GTK_IS_WIDGET(widget)’ failed And no Window open. I searched a bit on the internet but I cant anything helpful. Some say that I have to convert the glade file to .xml but that didn't work. C #include <gtk/gtk.h> int main(int argc, char *argv[]) { GtkBuilder *builder; GtkWidget

How can I read out the “glade ID” of a gtk3 object

99封情书 提交于 2019-12-13 14:19:17
问题 In glade it is possible to set an unique ID to an object. In the code one can obtain a pointer to this object by searching for it's "glade ID" via gtk_builder_get_object(). However for my current use-case I just want to read out this ID from an GObject. What's the API to do so ? 回答1: You can't. The builder ID is stored in the builder internally, not in the GObject. The reason for this is that IDs must be unique per builder, which would be impossible to enforce if you were able to get and set

How to set bg image of a window in a GTK3 application

女生的网名这么多〃 提交于 2019-12-13 07:29:50
问题 I found this way: GdkPixmap *backPixMap = gdk_pixmap_create_from_xpm ( window , NULL , NULL , fileName ); gdk_window_set_back_pixmap( GTK_WIDGET( window )->window , backPixMap , FALSE ); but it seems that GdkPixmap is obsolete now... So, with GTK3, how can I set the background image of a GtkWindow? 回答1: You just need to use an Overlay. Following is an example. class Window(Gtk.Window): def __init__(self): Gtk.Window.__init__(self) self.overlay = Gtk.Overlay() self.add(self.overlay) self.bg =

Change GTK3 tooltip color only for Eclipse running in Ubuntu

半城伤御伤魂 提交于 2019-12-13 07:17:22
问题 I am running Eclipse Mars on Ubuntu 15.04. I have seen instructions to change GTK3 tooltip fg/bg color at system-wide level. My question is how can I change the GTK3 tooltip fg/bg color only for Eclipse without affecting other applications. (GTK3 and CSS are not my fields of expertise so I really need some help here) 回答1: I found a way to fix Eclipse tooltip color without falling back to GTK2 and without affecting any other application. The fix is captured in a script and it can be accessed

how to save Drawing area's content after resizing window at cairo

此生再无相见时 提交于 2019-12-13 04:53:22
问题 how can I change the below code so the contents and drawings at the Drawing-area won't clean after changing window's size. I want to copy smaller surface content to top left corner of the bigger content and for copying bigger surface to smaller surface there should be some data loss code is from gtk+-3.0 reference manual #include <gtk/gtk.h> /* Surface to store current scribbles */ static cairo_surface_t *surface = NULL; static void clear_surface (void) { cairo_t *cr; cr = cairo_create

gtk+ python entry color [closed]

一曲冷凌霜 提交于 2019-12-13 03:44:53
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I'm trying to change the color of an entry gtk3 text. already searched everywhere and can not find a way. I think that is with an entry_buffer but I have no idea how to do it. for gtk2 found easily but my project

GtkDrawingArea won't update when drawing happens if Glade is used

烈酒焚心 提交于 2019-12-13 03:41:46
问题 I have created very simple GTK3 C app with glade, which contains button and GtkDrawingArea (held together with GtkPaned). When button is presed, it should immediately draw a rectangle, however, it doesn't happen. It only happens, when mouse howers on GtkPaned split part (see .gif). If Glade is not used, then this problem doesn't exist. How to fix this problem? gif C code: #include <gtk/gtk.h> //==============================================================Global=variables=====================

GTK+ Set Font Size

社会主义新天地 提交于 2019-12-12 23:14:51
问题 As before, 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?" " The code below is able to change the style of the "Save" text, except that it is not able to change the font-size . When the executable is executed, the following warning comes up: Gtk-WARNING **: Theme parsing error: Styles.css:10:14: Junk at end of value When the line font-size: 25px; is removed (or commented out), the warning

Checkbox with CSS in GLade Python

99封情书 提交于 2019-12-12 13:44:59
问题 everyone I am trying to change the colors of the checkboxes when they are pressed because I am doing a job that requires their use. I am using them with no "Drawing Indicator" attribute, so I need them to have a different color when pressed, because it does not look very well and is not very appealing. Is there any way to do this? The version of my glade is 3.18.3. Im using a Pi3 model B This is my code: import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from gi

Glade-constructed TreeView with gtkmm

点点圈 提交于 2019-12-12 13:14:27
问题 I've got a glade-constructed TreeView/ListStore that I'm trying to load into an application and manipulate via gtkmm. Here's the manager's class: typedef struct { Gtk::ListStore *liststore_info; Gtk::TreeModelColumn<string> *treeview_info_column_time; Gtk::TreeModelColumn<string> *treeview_info_column_message; }UiElements; class GuiManager { Glib::RefPtr<Gtk::Builder> builder; UiElements elements; public: GuiManager(); ~GuiManager(); void info_handler(string msg); } And the implementation: