gtkmm

Gtkmm program compiles fine but crashes - windows XP

别来无恙 提交于 2019-12-06 05:15:39
I have recently installed gtkmm (gtkmm-2.4) when I compile with g++ I use the following information from pkg-config headerfiles pkg-config gtkmm-2.4 --cflags objectfiles pkg-config gtkmm-2.4 --libs So i compile I simple helloworld problam that is to show a window on the screen ... g++ gtkmm_app2.cpp -o gtkmm_app2 `pkg-config gtkmm-2.4 --cflags --libs` It compiles fine but when I execute the program it chrashes. I get the following information: An unhandled win32 exception occurred in gtkmm_app2.exe[5364] I am not an exert on debugging but when I get redirected to Visual Studio the problems

How to use CssStyleProvider in Gtkmm3

会有一股神秘感。 提交于 2019-12-05 21:52:26
问题 I'm programming in c++ with gtkmm3. I want to change some fonts in my program. I read all the things about CssStyleProvider, StyleContext in gtkmm documentation and also in gtk+ documentaion but i couldn't make it work and couldn't find any tutorial about that. I'm trying like that Glib::ustring data; data="GtkMenuBar, GtkMenuItem {font-name: Sans 6}"; /*tried with semi-colon, too*/ Glib::RefPtr<Gtk::CssProvider> asd = Gtk::CssProvider::create(); Glib::RefPtr<Gtk::StyleContext> asd2 = Gtk:

Gtkmm - “Gtk::DrawingArea” in “Gtk::ScrolledWindow”?

风流意气都作罢 提交于 2019-12-05 18:39:09
I am making a GUI program using "gtkmm". I would like to draw some graphics to the "Gtk::DrawingArea" widget but I want that widget to be "resizable", so when I draw let's say a line from "(0, 0)" to "(50, 50)" pixel - the drawing area should be resized to a square of size "(50, 50)"; and when I for example draw a line from "(0, 0)" to let's say "(100, 70)" pixel - the drawing area should be resized to a rectangle of size "(100, 70)". And to do this - I put the "Gtk::DrawingArea" widget into the "Gtk::ScrolledWindow" container. So when I put a picture with size "(100, 100)" to the drawing area

Stacking widgets in Gtk+

人盡茶涼 提交于 2019-12-04 17:53:12
Is there a way in Gtk+ to stack one widget on top of another -- not counting GtkFixed? GtkFixed doesn't work well for two reasons: 1) I need Z order, and 2) I need one widget to stretch and fill provided space. I don't think there is a proper container in standard GTK. I would subclass Gtk::Fixed... it is still the closest one you can get, and if you use gtkmm then subclassing shouldn't be very difficult¹. Then you can control the dimensions of all widgets, stretching one selected child to fill space. To control Z-axis you will probably need to manipulate widget's X windows--check GDK

Auto-connection signals with GtkBuilder but on GTKmm

China☆狼群 提交于 2019-12-04 14:35:43
In C , I can autoconnec signals with this code: gtk_builder_connect_signals (builder, NULL) How to do this in C++ with GTKmm ? Manmohan Bishnoi 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::mem_fun(*this, &button1_clicked)); Have a look at these answers : https://stackoverflow.com

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

夙愿已清 提交于 2019-12-04 04:50:33
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. #include <gtkmm.h> #include <iostream> #include <tr1/memory> struct WindowHolder { SmartPtr<Gtk::Window> ptr

How to use CssStyleProvider in Gtkmm3

做~自己de王妃 提交于 2019-12-04 03:25:43
I'm programming in c++ with gtkmm3. I want to change some fonts in my program. I read all the things about CssStyleProvider, StyleContext in gtkmm documentation and also in gtk+ documentaion but i couldn't make it work and couldn't find any tutorial about that. I'm trying like that Glib::ustring data; data="GtkMenuBar, GtkMenuItem {font-name: Sans 6}"; /*tried with semi-colon, too*/ Glib::RefPtr<Gtk::CssProvider> asd = Gtk::CssProvider::create(); Glib::RefPtr<Gtk::StyleContext> asd2 = Gtk::StyleContext::create(); asd->load_from_data(data); asd2->add_provider(asd, 0); /*also tried different

How to get native windows decorations on GTK3 on Windows 7+ and MSYS2

我与影子孤独终老i 提交于 2019-12-03 11:51:47
问题 I am trying to port my application from linux to windows and I have a problem with theming. In linux this works out of a box, just compile it and application is using good theme and looks native. I have installed gtkmm3 and gtk3 in MSYS2 and I am building it with CMake. This is OK, I had to copy all dlls to directory with binary to be able to execute it. I did not copy anything else. I am trying to create "unzip and execute" package. My problem is, that application looks out of place. It does

How to get native windows decorations on GTK3 on Windows 7+ and MSYS2

天大地大妈咪最大 提交于 2019-12-03 02:19:00
I am trying to port my application from linux to windows and I have a problem with theming. In linux this works out of a box, just compile it and application is using good theme and looks native. I have installed gtkmm3 and gtk3 in MSYS2 and I am building it with CMake. This is OK, I had to copy all dlls to directory with binary to be able to execute it. I did not copy anything else. I am trying to create "unzip and execute" package. My problem is, that application looks out of place. It does not look native at all. There are shadows around the window, which is fine in Windows10, but in

Setting up GTKmm in Eclipse for C++

回眸只為那壹抹淺笑 提交于 2019-12-02 13:23:30
问题 I am trying to create a GUI using GTKmm in Eclipse, however I can't get the configuration working. For reference, here is my actual code: #include <gtkmm.h> using namespace std; int main(int argc, char **argv) { Gtk::Main kit(argc,argv); Gtk::Window frmMain; kit.run(frmMain); return 0; } These are the settings I have entered under the GCC C++ Compiler section. All options: -I/usr/include/gtkmm-3.0 -I/usr/include/gdkmm-3.0 -I/usr/include/gtk-3.0 -O0 -g3 -Wall and for Command Line Pattern: $