gtkmm

Glade/gtkmm TreeView

ε祈祈猫儿з 提交于 2020-01-06 03:53:24
问题 In following up with an answer to my previous question on this issue, I've made some progress and am looking for the next bit of guidance. In brief, I'm having trouble loading up a Treeview from Glade with a gtkmm application. To start, here's the source. The class: typedef struct { Gtk::Window *window_info; Gtk::TreeView *treeview_info; Glib::RefPtr<Gtk::ListStore> liststore_info; class InfoColumns : public Gtk::TreeModel::ColumnRecord { public: InfoColumns() { add(time); add(message); } Gtk

How to open/spawn a file with glib/gtkmm in Windows

£可爱£侵袭症+ 提交于 2020-01-05 05:27:15
问题 I've already tried: GError *pError = NULL; string uri = g_filename_to_uri(file.c_str(), NULL, &pError); if (!g_app_info_launch_default_for_uri(uri.c_str(), NULL, &pError)) { cout << "Failed to open uri: " << pError->message; } Here I get the error "URIs not supported". Is the uri I create here wrong? My second approach was to spawn the file with an asynchronous command line: file = quoteStr(file); try { Glib::spawn_command_line_async(file); } catch (Glib::SpawnError error) { cout << error

How do I add a ComboBox to a TreeView column?

故事扮演 提交于 2020-01-05 03:34:11
问题 In Gtkmm, I want to have a Gtk TreeView with a ListStore, and have one of the columns in the list be a ComboBoxText. But I can't seem to figure out how to do it. What I currently have looks like: class PlayerListColumns : public Gtk::TreeModelColumnRecord { public: PlayerListColumns() { add(name); add(team);} TreeModelColumn<string> name; TreeModelColumn<ComboBoxText*> team; } Then when setting the TreeView (the player_list_view object) PlayerListColumns *columns = new PlayerListColumns();

Gtkmm compiling error

Deadly 提交于 2020-01-04 04:00:11
问题 OS: Windows 7 Compiler: MinGW IDE: Code::Blocks I just installed Gtkmm on my computer in the folder C:/gtkmm/ and set up an example program. When I compiled it, it gave the error "gtkmm.h: No such file or directory" I tried setting the PATH variable to C:/gtkmm/include and C:/gtkmm/gtkmm-2.4, but neither worked. Then I tried using #include "C:/gtkmm/include/gtkmm-2.4/gtkmm.h" and that just gave a ton of errors saying that it doesn't know where a few dozen files are. I've also heard that you

is GTK 3.x a real cross-platform solution?

青春壹個敷衍的年華 提交于 2020-01-02 06:50:46
问题 I have tasted both Qt 4.x/5.x and GTKmm 3.x and I really like GTKmm over Qt. Now I have just discovered that GTKmm 3.x doesn't offer a Windows porting, they also do not offer a Mac porting, basically I can't find nothing but libraries/sources/binaries for Linux. Apparently the Windows support ( I'm not sure about the situation for the Mac OS stuff ) was dropped in the 2.x era and it's still not-existing today. I have planned to use GTK 3.x for specific reasons, especially for some new

OpenGL + gtkglextmm + glade

孤街醉人 提交于 2020-01-01 19:02:15
问题 when I am programming with "gtkmm", there is a widget "Gtk::DrawingArea" . I can program that widget "by hand" (so write the code) or more elegant way is to use "glade" user interface designer, where I can do the same "graphically" . Now I am trying to connect OpenGL with gtkmm through "gtkglextmm" library. In that library, there is a widget "Gtk::GL::DrawingArea" - but this widget "IS NOT" available in glade. So is there any way to program with "OpenGL + gtkglextmm" using "glade" (for the

Stacking widgets in Gtk+

笑着哭i 提交于 2020-01-01 17:12:05
问题 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. 回答1: 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

Unable to get height/width of a widget - gtkmm

五迷三道 提交于 2020-01-01 10:54:07
问题 I'm writing an application using gtkmm. I wrote a simple widget class, that I want to display in the application's main window only in some cases. Otherwise, I would like a Label "disabled" to be visible. To achieve that I packed both the widget and the label into one VBox, and I show() and hide() them in order to swap them. However, the custom widget is far larger than the label, so I need to resize the label a bit . I know I can use label.set_size_request(x,y), and it works, when I type the

interfacing gobject with C++

僤鯓⒐⒋嵵緔 提交于 2019-12-31 06:58:47
问题 I’m trying to create a custom audio sink plugin for gstreamer using the Gst::AudioSink as a base class. For me this involves multiple learning curves as I’m new to gstreamer, gstreamermm and gobject. Also I have no background or real interest in gtkmm as I’m not working on GUI code at present. I am trying to create a class along the lines of: class MyAudioSink: public Gst::AudioSink { public: explicit MyAudioSink(KantarAudioSink *gobj); virtual ~MyAudioSink(); static void class_init(Gst:

“Gtk-WARNING **: cannot open display:” when running a gtkmm project in Eclipse

↘锁芯ラ 提交于 2019-12-30 11:04:33
问题 I'm trying to run a gtkmm project in Eclipse CDT (On Ubuntu). The project compiles fine, there are no errors reported but when I try to run the project the console prints out this message "Gtk-WARNING **: cannot open display:" If I go to where the executable is located, in nautilus, I can open it and it runs fine. It's just a problem when trying to run directly from Eclipse. Thanks, 回答1: It sounds like the the "DISPLAY" environment variable is not being set in the environment used by eclipse