gtkmm

Is it possible to define GTK+ type using gtkmm?

谁都会走 提交于 2019-12-08 20:45:35
I would like to define a new subclass of some gtkmm type, implementing interface of underlying GTK+ object. Then, i want to compile it into some kind of dll and use in pure C code (GTK+, no gtkmm) through this interface. Is it possible? The followings are required to use gtkmm widget in GTK+ : implement the desired custom widget in gtkmm create a library from the widget for Glade design the user interface containing the custom widget with Glade declare the C interface for the application written in GTK+ build the user interface from XML with GtkBuilder Details can be found in my blog post . 来源

Static linking - working with GTKmm application? - revised

岁酱吖の 提交于 2019-12-08 14:17:59
问题 Is it possible to make a static linking (compilation) on Gtk(mm) program? I need the program to be less relaying on dependences in user's system. I try: g++ -static data/Area.h data/Picture.cpp data/GLScene.cpp data/KBDialog.cpp data/Dialogs.h data/FilePreview.cpp data/MainWindow.cpp prog.cpp -o prog `pkg-config --cflags --libs gtkmm-2.4 gtkglextmm-1.2 exiv2` but It fails: /usr/bin/ld: cannot find -lgtkmm-2.4 /usr/bin/ld: cannot find -lGL /usr/bin/ld: cannot find -latkmm-1.6 /usr/bin/ld:

How do you replace HBox/VBox with Box/Grid

夙愿已清 提交于 2019-12-08 13:37:37
The documentation for HBox and VBox includes the statement: Deprecated: Use Box instead, which is a very quick and easy change. But we recommend switching to Grid, since Box will go away eventually. However, it isn't obvious what the "quick and easy change" should be. How do you use Box and/or Grid to achieve the functionality of VBox or HBox ? One of the big changes in gtkmm3: Gtk::Box, Gtk::ButtonBox, Gtk::IconView, Gtk::Paned, Gtk::ProgressBar, Gtk::ScaleButton, Gtk::ScrollBar and Gtk::Separator now derive from Gtk::Orientable, allowing their orientation (vertical or horizontal) to be

Checking if path is simple and closed using cairo

删除回忆录丶 提交于 2019-12-08 06:52:47
问题 I am using cairomm together with gtkmm for a GUI project. I have defined a GeometricShape abstract widget (which inherits from Gtk::DrawingArea ) to inherit from if one needs to draw a square, a circle, etc. This class defines three regions: a fill (or body area); a border; a background area. The fill area is used to fill in the shape with a certain body color. The border (usually black) defines the shape and the background area is used to fill the remaining space (everything but the border

Linux / C++ Help with glade3 and gtkmm

≯℡__Kan透↙ 提交于 2019-12-08 03:30:57
问题 Here is a C application source code, which creates GUI using Glade3 and GTK2+: // gcc -o simple simple.c $(pkg-config --cflags --libs gtk+-2.0 gmodule-2.0) #include <stdio.h> #include <stdlib.h> #include <string.h> #include <gtk/gtk.h> GtkBuilder *builder; GtkWidget *window1; G_MODULE_EXPORT void on_window1_destroy (GtkObject *object, gpointer user_data) { gtk_main_quit(); } G_MODULE_EXPORT void on_button2_clicked (GtkObject *object, gpointer user_data) { gtk_main_quit(); } G_MODULE_EXPORT

GStreamermm: creating a new element type (in plugin) by deriving from Gst::Element

僤鯓⒐⒋嵵緔 提交于 2019-12-08 00:40:37
问题 The standard method of creating a new element type in plugin is gobject-style "derivation" from GstElement type with all this gobject magic, like this. I'm writting a project in C++ which use GStreamer with some elements specialized for my purpose. I've written several plugins in the way mentioned above, but I'm not satisfied with the code, since too much of it is just to met gobject requirements. I consider using gstreamermm. Is it possible to create a new type of elements with C++-style

Checking if path is simple and closed using cairo

主宰稳场 提交于 2019-12-07 23:55:29
I am using cairomm together with gtkmm for a GUI project. I have defined a GeometricShape abstract widget (which inherits from Gtk::DrawingArea ) to inherit from if one needs to draw a square, a circle, etc. This class defines three regions: a fill (or body area); a border; a background area. The fill area is used to fill in the shape with a certain body color. The border (usually black) defines the shape and the background area is used to fill the remaining space (everything but the border and its related fill area) with a color. Here is an example of how it looks for a circle: In this case,

undefined reference to `Class::Class()'

半世苍凉 提交于 2019-12-07 22:34:40
问题 I am writing a GTKmm window program; the main window creates two buttons, one for English and one for Chinese. The user can click on the button to bring up a different window in the appropriate language. Currently I am having trouble initializing the multiple-item container inside the main window. It is an object of type MainWindowPane, which inherits Gtk::HBox. When I try to make, the compiler issues the following error: $ make g++ -g `pkg-config gtkmm-2.4 --cflags` -c MainWindow.cpp g++ -g

undefined reference to `Class::Class()'

梦想与她 提交于 2019-12-06 11:49:46
I am writing a GTKmm window program; the main window creates two buttons, one for English and one for Chinese. The user can click on the button to bring up a different window in the appropriate language. Currently I am having trouble initializing the multiple-item container inside the main window. It is an object of type MainWindowPane, which inherits Gtk::HBox. When I try to make, the compiler issues the following error: $ make g++ -g `pkg-config gtkmm-2.4 --cflags` -c MainWindow.cpp g++ -g -o QPI_frontend main.o MainWindow.o StartButton.o `pkg-config gtkmm-2.4 --libs` MainWindow.o: In

Auto-connection signals with GtkBuilder but on GTKmm

最后都变了- 提交于 2019-12-06 08:54:26
问题 In C , I can autoconnec signals with this code: gtk_builder_connect_signals (builder, NULL) How to do this in C++ with GTKmm ? 回答1: You cannot use Glade to connect your signals when using gtkmm , you need to do that manually. Glib::RefPtr builder = Gtk::Builder::create_from_file("glade_file.ui"); Gtk::Window *window1 = 0; builder->get_widget("window1", window1); Gtk::Button *button1 = 0; builder->get_widget("button1, button1); // get other widgets ... button1->signal_clicked().connect(sigc: