gtkmm

Gtk::TextView with constant string

自作多情 提交于 2019-12-25 08:48:42
问题 I am using Gtkmm 3+ and What I am trying to do is have the text buffer have the constant string "> " even if the user tries to delete it. In addition when the user pressed return it will automatically be there again. Basically have a constant string like a terminal does. The only way I can think about about accomplishing this would be to connect to the delete and backspace signals so the user cannot delete the string. But, is there a better way? so far this is the only way I can think of: /

Implementing a custom gtkmm treemodel

戏子无情 提交于 2019-12-25 05:49:47
问题 I am trying to implement a custom tree mode in gtkmm (reason for doing this is to show rows from a database using some pageination). I habe implemented all vfunc-methods, but i still get following errors: glibmm-CRITICAL **: Glib::Interface::Interface(const Glib::Interface_Class&): assertion `gobject_ != 0' failed GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed On instantiation I have following code: ModelTracks::ModelTracks(Library* library_ptr) : Glib:

Create a signal with Gtkmm

别说谁变了你拦得住时间么 提交于 2019-12-25 04:24:11
问题 I am using the gtkmm library with C++, and I am trying to create a signal which allows to change current tab, but it does not work. Actually I think the problem comes from this line: menuit->signal_activate().connect([&bo]() {bo->next_page();}); Where: menuit = Gtk::MenuItem bo = Gtk::Notebook The code compiles well, but when executing I get this line : Segmentation fault (program exited with code: 139) Thank you a lot for your help ! 回答1: menuit->signal_activate().connect([&bo]() {bo->next

Creating multiple windows in gtkmm

。_饼干妹妹 提交于 2019-12-25 01:56:21
问题 I started to learn gtkmm library and probably don't understand the way it works. Here's the problem: I've copied simple example from gtkmm tutorial, and want to modify it to create as many windows as I want by clicking the button. Why can't I just write code like in function on_button_clicked() below? class Hello : public Gtk::Window { public: Hello() :m_button("create copy") { set_border_width(20); m_button.signal_clicked().connect(sigc::mem_fun(*this, &Hello::on_button_clicked)); add(m

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

gtkmm: Simple example fails to compile: gtkmm.h: No such file or directory

丶灬走出姿态 提交于 2019-12-24 19:20:01
问题 I am working through the gtkmm documentation. I have started by trying to compile the "Simple Example". Here is the code. It can also be found here. /// SimpleExample.cpp #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); } I have tried to compile this using g++ SimpleExample.cpp -o SimpleExample `pkg-config gtkmm-3.0 --cflags --libs`

Cannot embed gnuplot x11 window into Gtk3 socket

风格不统一 提交于 2019-12-24 02:59:06
问题 I'm creating Gtk::Socket in my Gtk3 (actually, gtkmm) application and trying to embed gnuplot's window into it. But it does not work: the socket remains to stay as a black rectangle, while gnuplot window appears standalone elsewhere. Meanwhile, Gtk::Plug plugs into this socket perfectly. In Gtk2 this trick with gnuplot works well too. Here is socket.cpp #include <iostream> #include <fstream> #include <gtkmm.h> #include <gtkmm/socket.h> using namespace std; void plug_added(){ cout << "A plug

gtkmm manage/add vs smart pointers:

删除回忆录丶 提交于 2019-12-24 00:14:11
问题 gtkmm provides lifetime management of widgets using this sort of construct: Gtk::Widget* aWidget = Gtk::manage(new Widget()); Gtk::Widget containerWidget; containerWidget.add(*aWidget); This delegates lifetime management of aWidget to containerWidget. When containerWidget is cleaned up, it also cleans up aWidget - similar to Delphi's 'owner' concept. We also have several types of smart pointers, particular the C++ 11 smart pointers templates, which I use everywhere. I find the manage/add

How to develop interface like Eclipse using GTK?

大兔子大兔子 提交于 2019-12-23 21:33:31
问题 I want a write a desktop application using GTKMM. I want the interface to be made of different panels like in Eclipse you have the Project Explorer, Console, Properties, etc. You should be able to drag the panels to change their position, close them and popout them (not sure if you can popout the panels in Eclipse but you can do it in Visual Studio). I am using the word panels here as I am not sure what the right term is. I guess some call it dockable windows. Any pointers on how this can be

Problems compiling gtkmm

橙三吉。 提交于 2019-12-20 10:32:39
问题 OS: Fedora 14 Compiler: g++ (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4) I installed gtkmm24-devel from repository via yum. To make sure the install went as planned I decided to try one of the examples on the page. #include <gtkmm.h> int main(int argc, char *argv[]) { Gtk::Main kit(argc, argv); Gtk::Window window; Gtk::Main::run(window); return 0; } I ran the example, and, hey! It said it couldn't find gtkmm.h, no problem, I just forgot to link the library. I added /usr/include/gtkmm-2.4 to my