gtk

How much of an increase in size do inline functions cause?

ε祈祈猫儿з 提交于 2020-01-24 04:11:41
问题 I have recently started making a C++ Wrapper of GTK+ (Nothing special, just wrapping everything into C++ classes for easy development, to be used in-house) and to cause minimum performance bloat to the already slow Gtk+ I used inline functions almost everywhere. Take a look at a few class functions... class Widget : public Object { public: // A few sample functions. gwidget is the internal GTK+ widget. void Show(void) { gtk_widget_show(GTK_WIDGET(gwidget)); } void ShowNow(void) { gtk_widget

How to access the theming Fonts and Colors on GTK/Gnome

谁说胖子不能爱 提交于 2020-01-23 03:31:07
问题 Lets say i want to write a special text editor widget. How can i get the default themed colors for texts, selected text and background and which are the users default fonts? I see that GNOME does define 5 special system fonts and default sizes for this purpose in the GNOME Appearance Configuration dialog, but i haven't found a single word in the GTK documentation how to access them (and the GTK mailing list is a joke:-( ). Windows and Cocoa both give me dozens of system values. I found the

ImportError: No module named gi.repository Mac OS X

為{幸葍}努か 提交于 2020-01-22 18:58:44
问题 I am installing virt-manager0.10.0 on Mac OS X First I installed python,libvirt, gtk+3, pygtk, and other dependencies with homebrew But when I run virt-manager I got this error from gi.repository import GObject ImportError: No module named gi.repository When I run this import in python command line I get same error.but there is no error when I try import gtk I think the problem is the homebrew pygtk version doesn't use gtk+3 and uses gtk2 and as we can see here gi.repository Windows only gtk

XWindow与GtkWindow的转换

倖福魔咒の 提交于 2020-01-22 10:06:25
在gdk/gdkx.h中可以看到定义了GdkWindow与Xlib中结构的变量访问,如GDK_WINDOW_XID得到Window(xid), Display可以通过XOpenDisplay(NULL)或者GDK_WINDOW_XDISPLAY。 得到这些后,想更变一下窗体控件的属性就简单了。 例如: GtkWidget *win = NULL; win = gtk_window_new (Gtk_WINDOW_TOPLEVEL); Display *display = XOpenDisplay(NULL); XResizeWindow (display, GDK_WINDOW_XID (win->window), 200, 200); //更改win的size XFlush (display); //即时刷新 可以使用如下接口: GtkWindow *win; GdkWindow *window = gtk_widget_get_window(win); const Window xwin = GDK_WINDOW_XID(window); Display * const display=GDK_WINDOW_XDISPLAY(window); 来获取Window 的id以及Display。 来源: CSDN 作者: 柳鲲鹏 链接: https://blog.csdn.net

Gtk theme in GTK# (Windows)

為{幸葍}努か 提交于 2020-01-21 11:28:12
问题 I'm trying to change the theme in GTK# ( OS: Windows, IDE: Xamarin ). But I get next issues: I was able to find only one theme which correctly render, it is "Orta". All was well, except for lags and freezes . Here is my code: string Resource_File = "Orta\\gtk-2.0\\gtkrc"; Application.Init (); Gtk.Rc.AddDefaultFile (Resource_File); Gtk.Rc.Parse (Resource_File); MainWindow win = new MainWindow (); win.Show (); Application.Run (); When I changing the size of the Paned or clicking on button I get

GObject Gtk, Gnome, Gtk+, Gl, Gtk2, Gtk3…I don't understand?

故事扮演 提交于 2020-01-21 10:58:07
问题 all I need some window to host webkit or/and cairo drwaing, but i have to deal with all that first to understand what I'm doing. now. I'm lost and no more understand what's all that about. and things get worse when I try working with binding or trying to figure what are dependencies for something. for example: in python, pyGtk deprecated and replaced by pyGObject(sometimes called pyGl!!) there are many sites, many downloads and versions, mixed outdated and new references, but not one

How to change the default font size in the Swing GTK LookAndFeel?

不想你离开。 提交于 2020-01-21 07:17:42
问题 Is there a way to change the default font size in the Swing GTK LaF? The GTK LaF seems to assume 72dpi, so all the fonts are only 3/4 of the size they should be when using a 96dpi screen. See this Fedora bug for details. I'd like to find a workaround in the meantime, while I wait for the fix. I've already tried resetting the font size via UIDefaults , as recommended here, for example, but (as also noted there) the GTK LaF appears to ignore this. I could build a widget factory that would also

Finding the workspace size (screen size less the taskbar) using GTK

可紊 提交于 2020-01-21 03:28:27
问题 How do you create a main window that fills the entire desktop without covering (or being covered by) the task bar and without being maximized ? I can find the entire screen size with and set the main window accordingly with this: window = gtk.Window() screen = window.get_screen() window.resize(screen.get_width(), screen.get_height()) but the bottom of the window is covered by the task bar. 回答1: You are totally at the mercy of your window manager for this, and the key issue here is: without

GTK入门

早过忘川 提交于 2020-01-17 19:18:17
环境准备 官网 下载 GTK 源码包,因为本机 GLib 版本不够,下载一个非最新版的 GTK3.8.0 先学习用 直接阅读 "/gtk+-3.8.0/docs/reference/gtk/html/gtk-building.html" 进行操作 安装完毕, gtk3-demo 出来 gtk 的样例界面即安装搞定 实例学习 编译命令和编译脚本 编译参数包括 pkg-config --libs --cflags gtk+-3.0 为了方便,用脚本管理起来 build.sh #!/bin/bash if [ $# -lt 1 ]; then echo "usage: $0 [xxxx.c]" exit fi gcc -o $1_out $1 `pkg-config --libs --cflags gtk+-3.0` 一个简单的HelloWorld按钮 01_simple_button.c #include <gtk/gtk.h> // 回调函数1 void hello( GtkWidget *widget, GdkEvent *event, gpointer data ) { g_print("Hello World\n"); } // 回调函数2 void destroy( GtkWidget *widget, gpointer data ) { gtk_main_quit(); }

How to manually draw the GtkTreeView expander

三世轮回 提交于 2020-01-17 14:03:48
问题 I'm using a GtkTreeView widget and I want to change the appearance of the "expander" icon that opens and closes child rows: I want the icons to be the triangels that we're all familiar with, but they're appearing as boxed "+" and "-" symbols instead. At first I thought there must be a style enumeration that I can set, but I cannot find one. Then, I thought maybe there's a style property I can set in my theme's gtkrc file, but I don't think there is one. Finally, I resorted to trying to