gtk

GTK Timer - How to make a timer within a frame

半城伤御伤魂 提交于 2019-12-23 05:29:07
问题 How do g_timer_new works? is it possible to do a char timerz[50]; GTimer *timer g_timer_start(GTimer *timer); strcpy(timerz,(g_timer_elapsed(GTimer *timer)) Or what Could I do to have a timer in a gtk_frame??? Have a nice day! :D 回答1: You can use g_timeout_add or g_timeout_add_seconds which will call a timeout function at regular interval. Please note that this timeout function can be delayed due to event processing and should not be relied on for precise timing. Check this developer page for

kdevelop 4.0 : No project Templates

烈酒焚心 提交于 2019-12-23 05:14:17
问题 I have just installed kdevelop 4.0 on my Ubuntu machine and found that there are very few project templates (all are Qt related). I am not a qt developer and the previous versions of kdevelop had a lot of project templates. I am not sure how to get general C and C++ GTK templates. A Screenshot from a older version of kdevelop: http://www.euclideanspace.com/software/language/cpp/kdevelop/kd2.gif 回答1: If you are using ubuntu, try installing the kapptemplate package. It doesn't contain as many

gWidgets: Resize combobox to fit content

拥有回忆 提交于 2019-12-23 04:49:09
问题 I have created a GUI using gWidgets and RGtk2. A part of the GUI is a glayout with a set of gcomboboxes. These boxes are initially empty and gets populated once a file is imported. On mac with Gtk+ running through X11 the width of the comboboxes gets resized to fit the longest textstring in the combobox. On windows this doesn't happen and the comboboxes gets scrollbars to accomodate the long text strings (see pictures). I have tried turning visibility off and on to force a redraw but the size

Cross compiling for Raspberry PI

泄露秘密 提交于 2019-12-23 04:38:10
问题 I am writing a GUI application for the Raspberry PI dev board that makes use of the OpenCV library to process some image data. The end result is a graphical application with some buttons, and an area to display images. I avoid IDE's when I can, as it gets tedious having to learn a new IDE for every tool, in addition to a new language that usually goes in hand with the projects I work on. 95% of all my development is in VIM. How do I set up a basic makefile project that makes use of GCC,

GTK UI Looks different when running from bundle and when running from Xamarin Studio

假如想象 提交于 2019-12-23 04:24:33
问题 I have C# App using Mono framework and GTK for UI.When i run it from Xamarin Studio it looks like this I have bundled Mono and GTK into a standalone bundle.When running from it it looks different. Which one looks more native to the OSX Platform? If its the first one,then how can i get the same look and feel in the bundled App. 回答1: GTK 2 Theming Options: Use the default system theme Per user theming via ~/.gtkrc Per application theming via GTK api Per application theming via environment var

gtk-listbox -contents shown in middle of horizontal line, listbox does not fit window size

旧城冷巷雨未停 提交于 2019-12-23 04:13:42
问题 I wrote a code for listbox in gtk problems 1. the contents of listbox are shown in middle of horizontal line. I want it to be left aligned. 2. the listbox does not fit the window size 3.the list box is within a notebook tab. I want when the item in the listbox is selected some processing to be done(some function called), the current tab display is hidden and new tab is displayed with the results and a back button. When Back button is pressed it does 2 cases for 2 tabs in 1 tab- it just shows

GTK::Socket and Gtk::Plug unexpected behaviour under Gnome and FVWM2

不羁的心 提交于 2019-12-23 03:56:13
问题 The following code works fine if run within FVWM2. But if you change desktop to Gnome, then the embedded window is destroyed instead of being embedded. Why is that? What am I missing?... The code follows but basically all it does is fork. In the child, we create a VPython window an let it idle forever. In the parent, we create a GTK window, find out what the window ID of the child window is, and try to embed it vis a GTK::Socket. Note that the VPython part maybe irrelevant to this. #!/usr/bin

GTK+ g_pointer_connect passing data incorrectly

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 03:28:20
问题 I have a problem with passing my data to the function when using g_signal_connect(). guint x = 777; gpointer ptr = &x; g_print(std::to_string(*(guint*)p).c_str()); g_signal_connect(G_OBJECT(dialogWindow), "destroy", G_CALLBACK(funct), ptr); The g_print in this piece of code outputs "777". However when the funct is called static void funct(gpointer data) { g_print(std::to_string(*(guint*)data).c_str()); } the g_prints outputs some garbage like: "81382720" Can anyone help me with this? 回答1: You

using cairo with gtk3

≯℡__Kan透↙ 提交于 2019-12-23 03:06:59
问题 I am trying to draw a scatterplot with cairo in gtk3. To start, I am using the examples here: http://zetcode.com/tutorials/cairographicstutorial/ They compile with gtk2 successfully but display no image. They do not compile with gtk3 but give the following error: example.c: In function ‘on_expose_event’: example.c:17:31: error: ‘GtkWidget’ has no member named ‘window’ Any help on this would be greatly appreciated. btw I am using writing using ArchLinux for this if that helps. 回答1: There have

MVC with Python3 and Gtk3

一笑奈何 提交于 2019-12-23 02:52:29
问题 Is there any way to use MVC pattern with Python3 and Gtk3? I found a library called pygtkmvc , but it's based on pygtk , that is, gtk2 . 回答1: MVC is a pattern, you don't need a library in order to use it. It would go something like this contrived example: import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, GObject class Model(object): @property def greetee(self): return 'World' class Controller(object): def __init__(self, model, view): self._model = model self._view =