gtk

Install GTK for c on Windows 10?

Deadly 提交于 2019-12-25 02:46:33
问题 Can you tell me how to install GTK on windows 10 or have a step by step guide, all the ones I've tried have not helped me. Possibly if someone also explain how to compile from cmd or prepare an IDE (code: block maybe). 回答1: Any commands I mention should be run at the MINGW shell, found here: C:\msys64\msys2_shell.cmd First update msys2 with pacman -Syu Make sure you have installed GCC...Install the required toolchain for GCC with pacman -S mingw-w64-x86_64-toolchain . When using pacman, just

Refresh child-items in a container - GTK

冷暖自知 提交于 2019-12-25 02:37:34
问题 I am developing some kind of financial calculator in c with a graphical userinterface. I am using the gtk-lib and I have encountered one problem that right that could not be solved. Its about how to dynamically update (refresh) the window and its childs - more specifically - there is one child item in the container that is a text-label. I want this label to be changed according to what is entered in the textinputfield. I am used to java where one easily can call a method named invalidate().

Building LablGtk fails

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 02:14:35
问题 I'm trying to build LablGtk to enable building CoqIDE from source. I used lablgtk-2.18.7.tar.gz from here. When I tried to configure-make it I got this error (and similar other errors): File "gdk.ml", line 346, characters 2-55: 346 | external create : len:int -> t = "ml_point_array_new" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Error (warning 61): This primitive declaration uses type t, which is unannotated and unboxable. The representation of such types may change in future

gtkmm - How to make box containing widgets expand to fill window?

。_饼干妹妹 提交于 2019-12-25 01:01:39
问题 I'm new to gtkmm and I'm a bit confused about packing and how to make widgets expand. This is the code I have written: #include <gtkmm.h> class GUIWindow : public Gtk::Window { public: GUIWindow() { set_title("title"); set_border_width(10); set_size_request(800, 600); add(_box_); _box_.pack_start(_grid_, true, true, 10); _grid_.add(_frame1_); _grid_.add(_frame2_); _grid_.attach_next_to(_frame3_, _frame1_, Gtk::POS_BOTTOM, 2, 1); _frame1_.set_label("f1"); _frame2_.set_label("f2"); _frame3_.set

Mac style joined buttons (segmented control) with Gtk

為{幸葍}努か 提交于 2019-12-25 00:33:41
问题 I've seen it done in the ubuntu software center, and with a few gnome apps. Where two buttons look like a single rectangle with a line through it, how is this being done? 回答1: In GTK 3.0 and later, use the INLINE_TOOLBAR style class or LINKED style class. #!/usr/bin/env python from gi.repository import Gtk button_names = [ Gtk.STOCK_ABOUT, Gtk.STOCK_ADD, Gtk.STOCK_REMOVE, Gtk.STOCK_QUIT] buttons = [Gtk.ToolButton.new_from_stock(name) for name in button_names] toolbar = Gtk.Toolbar() for

“key-release-event” not triggered

馋奶兔 提交于 2019-12-25 00:23:19
问题 Consider the following code: #include <gtk/gtk.h> static void stop(GtkWidget *window, GdkEventKey *key, gboolean *key_held) { *key_held = FALSE; g_print("stopped!\n"); } static void counter(GtkWidget *window, GdkEventKey *key, gpointer user_data) { gboolean key_held = TRUE; gulong signal_ID = g_signal_connect(window, "key-release-event", G_CALLBACK(stop), &key_held); for (unsigned long int i = 0;key_held;i++) { g_print("%li\n", i); } g_signal_handler_disconnect(window, signal_ID); } int main

remove inner border on gtk.Button

孤人 提交于 2019-12-24 20:02:37
问题 I would like to remove border on a gtk.Button and also set its size fixed. How can I accomplish that? My button looks like that: b = gtk.Button() b.set_relief(gtk.RELIEF_NONE) Thanks! p.d: I'm using pygtk 回答1: You can use gtk.Widget.set_size_request to set a fixed size for the widget. Note that this is generally a bad idea, since the user may want a larger font size than you had planned for, etc. As for removing the border, gtk.Button can often take up more space than you wish it would. You

Porting GTK3.0 project to GTK2.0

我与影子孤独终老i 提交于 2019-12-24 17:35:29
问题 I am building a simple GUI application which I have successfully deployed and run on my Raspberry PI dev board. However, due to issues with OpenCV being dependent on GTK+ v2.0, I have to back-port my application to an old version of GTK+. I'm already familiar with changing include paths, and so on, and library linking orders in my makefiles. However, when I make all the necessary changes, a fatal error occurs during build. Building dependencies file for main.o In file included from /opt/rpi

Python Gtk+ development in Linux using Eclipse + PyDev, Unresolved import: Gtk

柔情痞子 提交于 2019-12-24 17:27:31
问题 I just tried to write my first Gtk+ program using python in linux mint with Eclipse + PyDev, but I met this error in PyDev, Unresolved import: Gtk program source code: http://python-gtk-3-tutorial.readthedocs.org/en/latest/introduction.html from gi.repository import Gtk win = Gtk.Window() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main() error shown as below: Program can run. I checked PYTHONPATH in PyDev, I think it's right. How can I fix this problem? By the way, could

GDK signal, keypress, and key masks

青春壹個敷衍的年華 提交于 2019-12-24 17:19:10
问题 I am trying to catch user key press Ctrl+d on a GUI window to quit. My code looks like this: static gboolean callback(GtkWidget *widget, GdkEventKey *event, gpointer data) { if(event->state == GDK_CONTROL_MASK && event->keyval == 'd') gtk_main_quit(); return FASLE; } This works on my laptop(Ubuntu 11.04, gcc 4.5.2, libgtk 2.24.4). But when I do the same thing on a newer system(Ubuntu 12.10, gcc 4.7.2, libgtk 2.24.13), it doesn't work. I added g_print("%u\n", event->state); before the if