gtkmm

Configured eclipse for gtkmm and gtk+ on ubuntu

送分小仙女□ 提交于 2020-07-10 09:57:32
问题 I am trying to configure latest Eclipse for C++ (Oxygen) to work with gtkmm. How can I remove errors from Eclipse such as unresolved symbols and gtkmm header files. I am able to compile from command line using g++ and pkg-config flags. How can I do same thing from the Eclipse IDE? I am using latest IDE 2019 version. 回答1: I have been using gtkmm and Eclipse for a while now. Here is how I set it up to get both working properly together. To illustrate this, I will take the basic example from the

How to configure Clion to compile gtkmm project

╄→гoц情女王★ 提交于 2020-07-03 04:32:50
问题 I have copied a sample project from GTK #include <gtkmm.h> int main(int argc, char *argv[]) { auto app = Gtk::Application::create(argc, argv, "org.gtkmm.examples.base"); Gtk::Window window; window.set_default_size(200, 200); return app->run(window); } And when compiling directly from terminal it works just fine: g++ main.cpp -o simple `pkg-config gtkmm-3.0 --cflags --libs` But when I try compilation using Clion it says fatal error: gtkmm.h: No such file or directory #include <gtkmm.h> My

Row Background Color GtkTreeView Widget

血红的双手。 提交于 2020-06-27 16:54:14
问题 I'm attempting to color disabled rows in a gtk tree view widget a light gray color. From what I've read, I'm supposed to set the background-gdk property of the corresponding cellrenderer and bind it to a model column. This sort of works. Gtk::CellRendererText* textRenderer = manage(new Gtk::CellRendererText()); textRenderer->property_editable() = false; Gtk::TreeViewColumn *col = manage(new Gtk::TreeViewColumn("Column1", *textRenderer)); col->add_attribute(*textRenderer, "background-gdk", m

How do I set the number of visible lines in a Gtk::TextView?

故事扮演 提交于 2020-06-23 11:01:56
问题 I have a Gtk::TextView that I would always like to have two lines of text visible, regardless of the font size. Obviously if more than two lines were entered then the box would scroll but I'd like the text view to remain 2 lines tall. How do I do this? 回答1: This is very difficult. For example, what will you do if two font sizes are mixed in one line? One way to do it is to create a Pango layout of one letter and find out its height. This is an untested simplification of some code I wrote in C

How do I set the number of visible lines in a Gtk::TextView?

会有一股神秘感。 提交于 2020-06-23 11:01:05
问题 I have a Gtk::TextView that I would always like to have two lines of text visible, regardless of the font size. Obviously if more than two lines were entered then the box would scroll but I'd like the text view to remain 2 lines tall. How do I do this? 回答1: This is very difficult. For example, what will you do if two font sizes are mixed in one line? One way to do it is to create a Pango layout of one letter and find out its height. This is an untested simplification of some code I wrote in C

how to add text box in gtkmm:gtk::Listbox using c++

情到浓时终转凉″ 提交于 2020-01-16 01:05:12
问题 I want to add this type of text in Listbox using Gtkmm in c++. Can you suggest me any way how to do it, please? 回答1: For this very simple case, you might want to use gtkmm's ListViewText widget: https://developer.gnome.org/gtkmm/stable/classGtk_1_1ListViewText.html Here is some example code: https://git.gnome.org/browse/gtkmm-documentation/tree/examples/book/treeview/listviewtext/examplewindow.cc However, if you want to do anything more complex, you'd need to use the full Gtk::TreeView class.

Is it possible to define GTK+ type using gtkmm?

风格不统一 提交于 2020-01-14 04:05:13
问题 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? 回答1: 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

Destructing Glib::RefPtr causes failed assertions in the GTK 3 core

╄→гoц情女王★ 提交于 2020-01-12 18:51:50
问题 The guys from Gtkmm are comparing Glib::RefPtr with std::auto_ptr<> : Glib::RefPtr is a smartpointer. Specifically, it is a reference-counting smartpointer. You might be familiar with std::auto_ptr<> , which is also a smartpointer, but Glib::RefPtr<> is much simpler, and more useful. But for some strange reason, I can't get my work done with the RefPtr . The same code is just fine with a auto_ptr . In the following code, SmartPtr is just a placeholder for one of these two smartpointers.