gtkmm

GTKmm 3: Parse command line with Gtk::Application

℡╲_俬逩灬. 提交于 2019-12-14 04:19:03
问题 I'm trying to use GTK's argv-handling, but there seem to be some issues with the main loop. My goal is to parse the command line after GTK removed its options (like --display ), but before opening a window, because I want my app to be usable with a CLI-only interface, too, with both variants making use of Glib etc. This is why I'm trying to open the window in the command_line signal handler. This works as expected, exits when the window is closed. #include <gtkmm.h> int main(int argc, char *

Accessing a container child widget dimensions in a constructor

左心房为你撑大大i 提交于 2019-12-13 16:49:58
问题 Let's say I have a class with two Gtk::Containers like so: class Example : public Gtk::VBox { public: Example(); virtual ~Example(); private: Gtk::HBox m_c1; // First container Gtk::Grid m_c2; // Second container }; Constructing an Example is implemented this way: Example::Example() { const int nbRows{6}; const int nbColumns{7}; for(int col{0}; col < nbColumns; ++col) { Gtk::Button* btn {new Gtk::Button("A")}; m_c1.pack_start(*btn); } for(int row{0}; row < nbRows; ++row) { for(int col{0}; col

Ext JS in a WebKitGTK webkit_web_view

≡放荡痞女 提交于 2019-12-13 06:49:33
问题 I'm trying to embed a web browser into a gtk project. I'm trying to use WebKitGTK (but I'm not committed to it), every time I try and use it to parse an Ext JS page, it crashes the entire application. Here's the output, and how I'm including the .js files... ** (ttocui_gtk:16360): DEBUG: NP_Initialize ** (ttocui_gtk:16360): DEBUG: NP_Initialize succeeded ** (ttocui_gtk:16360): DEBUG: NP_Initialize ** (ttocui_gtk:16360): DEBUG: NP_Initialize succeeded ** (ttocui_gtk:16360): DEBUG: NP

error: void value not ignored as it ought to be - C/GTK+

送分小仙女□ 提交于 2019-12-13 05:39:50
问题 I am trying to create a window in GTK+ that has tab looks like this: Whenever the user clicks in the "New" button, there is a new tab appear. However, when I was compiling my program I got an error: void value not ignored as it ought to be phongcao@phongcao:~$ g++ /home/phongcao/C++/GTK+/newtab.cc -o /home/phongcao/C++/GTK+/newtab `pkg-config gtk+-2.0 --cflags --libs` /home/phongcao/C++/GTK+/newtab.cc: In function ‘int main(int, char**)’: /home/phongcao/C++/GTK+/newtab.cc:51:3: error: void

Glade-constructed TreeView with gtkmm

点点圈 提交于 2019-12-12 13:14:27
问题 I've got a glade-constructed TreeView/ListStore that I'm trying to load into an application and manipulate via gtkmm. Here's the manager's class: typedef struct { Gtk::ListStore *liststore_info; Gtk::TreeModelColumn<string> *treeview_info_column_time; Gtk::TreeModelColumn<string> *treeview_info_column_message; }UiElements; class GuiManager { Glib::RefPtr<Gtk::Builder> builder; UiElements elements; public: GuiManager(); ~GuiManager(); void info_handler(string msg); } And the implementation:

Eclipse CDT & gtkmm: “… could not be resolved.”, but compiles and runs

断了今生、忘了曾经 提交于 2019-12-12 12:37:07
问题 I'm coding in Eclipse CDT in C++ with gtkmm. I have managed to set up Eclipse so it compiles the code correctly, by adding pkg-config gtkmm-3.0 --cflags --libs to the compiler options. So it runs, and works. But in the editor is everything gtk related underlined with red and when I hover over those parts, it says something like: Type 'Gtk::Main' could not be resolved . So I could code like this, but it's really a pain with autocompletion not working and red lines all over the screen. How can

Draw signal doesn't get fired in GTKMM, when derived class doesn't call a superclass's constructor

≡放荡痞女 提交于 2019-12-12 01:40:13
问题 DrawingArea.hpp #ifndef __DRAWINGAREA #define __DRAWINGAREA #include <gtkmm.h> class DrawingArea : public Gtk::DrawingArea { public: bool on_my_draw(const Cairo::RefPtr<Cairo::Context>& cr); DrawingArea(GtkDrawingArea* &cobject, const Glib::RefPtr<Gtk::Builder>& builder); }; #endif // __DRAWINGAREA DrawingArea.cpp #include "DrawingArea.hpp" #include <iostream> DrawingArea::DrawingArea(GtkDrawingArea* &cobject, const Glib::RefPtr<Gtk::Builder>& builder) { this->signal_draw().connect(sigc::mem

Do I have to manually attach a gtk signal handler when I specified the function name in glade?

让人想犯罪 __ 提交于 2019-12-11 18:31:22
问题 I'm writing my first gtk program, using gtkmm, and glade. I made a filechooserbutton and it has a signal called file-set So I set that to what I assume is the function name I want it to call when the file is chosen. But then I see here: http://library.gnome.org/devel/gtkmm-tutorial/unstable/sec-builder-accessing-widgets.html.en That they're manually getting the dialog widget and setting a button signal handler in the code. Which is the right way to do it? And while I'm here any links to good

Why Does Gtk::Frame Force A Redraw & Resize?

好久不见. 提交于 2019-12-11 12:08:06
问题 In the included code I've created an application where I periodically update a label. When the application first starts up, updating the timeLabel results in redrawing the entire contents of the application. This can be observed by running the application with the --gtk-debug=updates argument. When the button on the right side is clicked, the frame that encloses the contents of the window is removed from the widget hierarchy. This results in further updates to the timeLabel only redrawing the

virtual noexcept(true) errors: MinGW and gtkmm

こ雲淡風輕ζ 提交于 2019-12-11 11:13:13
问题 I've been fighting for a month solid to build a //working// C++/gtkmm-3.0 application on Windows with MinGW. I finally managed to get the libraries, MinGW, and Codeblocks to get along on Windows XP (VirtualBox). However, when I try to build, I get the following errors. These are the most recent versions of gtkmm-3.0 and dependencies. I got them via MSYS2, though I cannot build in that environment for reasons yet unknown. So, as is oft recommended, I copied them over to the MinGW /lib and