FAQ Database Discussion Community


What is 'client side decoration'?

user-interface,gtk,window-managers
I am a student who did some web stuff and some command line applications, now giving GUIs a try. I read http://python-gtk-3-tutorial.readthedocs.org/en/latest/layout.html and I stumbled over this sentence: Since GTK+ now supports Client Side Decoration, a Gtk.HeaderBar can be used in place of the title bar (which is rendered by...

What is the point of the _StructName convention in C?

c,gtk,conventions
After reading some source from the GTK+ library, I have encountered what I perceive to be a rather odd piece of code: typedef struct _GtkWidgetClass GtkWidgetClass; ... struct _GtkWidgetClass { ... }; What I don't understand about this code is why it isn't written like this: typedef struct { ......

Is it possible to change the position of a Gtk.MessageDialog's caption text?

python-3.x,gtk,gtk3,messagedialog
I'm working on a project where I use the Gtk.MessageDialog to get user input. Now, it works, but there is one thing I'd like to change, and that is where the caption text is positioned within the dialog. Here's what it looks like right now: I was wondering if I...

double Gtk::Messadialog before quiting

c++,gtk,gtkmm
I'm trying to display a message dialog if the pid of running program is valid, This is my essencial code: Gtk::Main kit (argc, argv); Glib::RefPtr<Gtk::Builder> refBuilder = Gtk::Builder::create(); try { refBuilder->add_from_file (UI_PATH); } catch (const Glib::FileError& ex) { std::cout << "FileError: " << ex.what() << std::endl; return 1; } catch...

Selecting GTK Treeview item from Code

c#,mono,treeview,gtk,gtk#
After i add some items to the GTK Tree View,i need to select the first item in the list from code to fire the treeviewcursorchanged event ie:when clicking on a tree view item.I need to select the first treeview item.But there is no select event. I populate the treeview with...

GTK/GDK Algorithm to take full screenshots of all monitors

linux,gtk,screenshot,gdk
Hi all I'm fairly new to the whole GTK game and needed some help with an algorithm to take screen shot of all monitors. I was thinking something along these lines can you please guide me: gdk_display_manager_list_displays each display can have multiple screens (screens means monitors?) so use gdk_display_get_n_screens to...

pass custom variables when connecting a gtk widget

python,gtk,gtk3
I've a Gtk.switch, and I want to connect it to a function, but I want that function to get another variable to do her job... : switch = Gtk.Switch() switch.connect("notify::active", self.on_switch_stream) def on_switch_stream(self,switch, gparam): print "switch=%s stream=%s" % (switch,gparam) But it seems, that the "connect" method, doesn't allow that...What is...

Programmatically change FileChooserDialog to list directories first with Python 3.4 and Gtk3?

python,gtk
I'm new to UI developement with Gtk and ran into something I didn't expect. The FileChooser automatically sorts by name, regardless to if it's a file or directory. I like having directories listed first, and people are used to/expect it. Is there some way I can get FileChooser to behave...

Pygobjects RenderToggle in filtered model selects wrong column

python,gtk,gtk3,pygobject
I'm trying to add a toggle field in an filtered model for pygobjects. I used the code from the tutorial and enhanced to add toggle renderer, but as soon as I click in a filtered list the toggles are rendered wrong. Assume you have a unfiltered list: ########################### # 0|test|a|toggle=False...

Passing main arguments to init functions of gui libraries

c,qt,user-interface,gtk
When it comes to a library initialization in libraries such as Qt and GTK+ You have to pass the main arguments into the function that initializes the library. Why? What is the library doing with them?

Error Removing Row from Gtk TreeStore

c,gtk,gtk3
I have a function for removing an individually selected row from a liststore, but every time I call it, I get an error that reads: Gtk-CRITICAL **: gtk_list_store_remove: assertion `iter_is_valid (iter, list_store)' failed Here is the function: void delete_row() { selector = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); gtk_tree_selection_get_selected(selector, &model, &iter); gtk_list_store_remove(GTK_LIST_STORE(store), &iter); } The...

GObject funtion to change the window title

c,gtk
Is it possible to change the title of a window using a GObject method? I have the below lines of code window=gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window),"Hello World"); What I wish to do is to replace the gtk_window_set_title with a method defined in GObject(ie one of its ancestor class) so as to change the...

Remove non-GtkListBoxRow parent from GtkListBox

python,gtk
Just a quick note about something I have encountered recently. I used python, but I guess, it applies for other languages as well. from gi.repository import Gtk win = Gtk.Window() listbox = Gtk.ListBox() somewidget = Gtk.Somewidget() win.add(listbox) listbox.insert(somewidget -1) listbox.remove(somewidget) #ERROR This is a GtkListBox, filled with an item not...

Function applied to too many arguments in lablgtk

gtk,ocaml
I need some help understanding why the following code will not compile. I am attempting to place a GSourceView2 inside a vertical box in lablgtk. I've adapted the code from this Ocaml article open GMain open GdkKeysyms let locale = GtkMain.Main.init () let main () = let window = GWindow.window...

GtkDialog mapped without a transient parent

gtk,pygtk,glade,pygobject
I have a GUI built in Glade (3.18) which is called by a Python 3 program (using PyGObject). I get a lot of warnings when running the program (Fedora 21) that say: Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged. How can I fix this warning? I tried...

Keyboard mnemonics not working [closed]

c,gtk
In the below code, I expect Ctrl + F to hide/show the child of the GtkExpander but it is not happening. #include <gtk/gtk.h> int main (int argc,char *argv[]) { GtkWidget *window, *expander, *label; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Expander"); gtk_container_set_border_width (GTK_CONTAINER (window), 10); gtk_widget_set_size_request (window,...

How to include gtk/gtk.h in a C file

c,gtk
Im very new to development in C and would like to create a GUI using GTK. Ive already downloaded and installed gtk 3.6.4 bundle. Im trying to compile some example code like this: #include <gtk/gtk.h> int main(int argc, char *argv[]) { GtkWidget *window; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_show(window); gtk_main();...

How do I disable edition of a PyGtk Combobox?

python,gtk,pygtk
I want the user to be able to select the items on a PyGTK ComboBox, while not being able to write in the combo. He/She should be allowed just to select one of the items. So I can't use set_active(False), for it will disable the combo. How can I do...

Python GTK AttributeError: 'gi.repository.Gtk' object has no attribute 'FlowBox'

python,gtk,pygobject
I am following Python GTK3+ Tutorial to make some applications on Ubuntu. However, when I try to execute sample code given for FLowBox, it results into following error: AttributeError: 'gi.repository.Gtk' object has no attribute 'FlowBox' I have GTK3 (v3.10.8) installed as well as Python 2.7.6 and Python 3.4.0. I'm using...

Python GTK - refreshing a table/scrollwindow

python,postgresql,gtk
In this simple program I'm drawing a window, adding a search box, getting a search term for the user, looking that up in a postgreSQL DB and displaying the reults. It works up to a point - when the user enters a second query. I have tried in two different...

Cannot run python on windows. What am I missing?

python-3.x,gtk,glade,pygobject
I am pretty new to python. Please correct me if I show stupidity. So I am trying to run the following code: from gi.repository import Gtk class LisaMainWindow: def on_LisaMainWindow_destroy(self, object, data=None): print ("quit with cancel") Gtk.main_quit() def __init__(self): self.gladefile = "lisaMainWindow.glade" self.builder = Gtk.Builder() print ("gtk builder done") self.builder.add_from_file(self.gladefile)...

Paint on Transparent window with HeaderBar Python and Gtk3

python,gtk,pygtk
I have a little problem with the following code. It creates a GtkWindow, make it paintable so I can draw on it with cairo on draw events. Then I add a GtkHeaderBar and a simple button widget. from gi.repository import Gtk import cairo def draw_callback(widget,cr): if widget.transparency: cr.set_source_rgba(0,0,0,0.5) else: cr.set_source_rgb(0,0,0)...

“Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale.” on OSX

c,osx,gtk,locale
Background information: I use Mac OSX Yosemite. I've installed gtk+ using brew install gtk+ and fixed the errors using export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig. I've build my program using make but when I try to run it I get a warning like this: (process:16182): Gtk-WARNING **: Locale not supported by C library. Using...

How to write new widgets implementing MVC with lablgtk2?

gtk,ocaml
I am writing a family of new widgets for lablgtk2, the OCaml bindings for Gtk+. Some of these widgets can edit or present a fairly complex information, I am therefore interested in using model-view-controler or subject-observer, similar to what can be found in the GTree module. This module defines a...

Python3 gi: GtkTextBuffer core dump

python,python-3.x,gtk,pygtk,glade
Using Python3 with gi.repository.Gtk, I'm trying to display multiple text lines inside a GtkTextView via a GtkTextBuffer. Basically, I'm dynamically adding lines using an _addLine method, which updates the text buffer that way (self._lines is an array and self._textBuffer is a GtkTextBuffer): def _addLine(self, text): if len(self._lines) == self._maxLines: self._lines...

How do I expand the children inside a button?

python,python-3.x,gtk,gtk3
I just updated to Fedora 22, and got with it Gnome 3.16. I'm running a small app of mine and I get a deprecation warning. The xscale property of the Alignment object is going away. There is a problem however, I can not expand the children of a button without...

Link to website in Gtk.MenuBar using Glade

python-3.x,gtk,glade
What is the best way to create a menuitem (for the Gtk.MenuBar) that should open the default browser with a new tab and loading an URL? Is it possible to do that in Glade directly or do I need to create that function in the program code itself? Is there...

Allow_grow and allow_shrink in GWindow.widnow method in LablGtk2

window,gtk,ocaml
I made a window using GWindow.window method in LablGtk2. After compiling, I ran the program. Then, I got warnings. GLib-GObject-WARNING **: The property GtkWindow:allow-grow is deprecated and shouldn't be used anymore. It will be removed in a future version. GLib-GObject-WARNING **: The property GtkWindow:allow-shrink is deprecated and shouldn't be used...

How to refresh cairo drawing in gtk2?

c,gtk,gnome,cairo,gtk2
I have a problem with refreshing my cairo drawing. It doesn't work and I don't know why. Could you help me? I want to create a new "drawing" whenever analyse function is executed. I created something like this: d_area = gtk_drawing_area_new(); Then i packed it in scrolled window: gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(formula_scrolled_window), d_area);...

Does gdk_color_copy really allocate memory?

c,gtk,gdk
My impression from the gdk docs is that gdk_color_copy allocates memory: Makes a copy of a color structure. The result must be freed using gdk_color_free(). The future-version gdk_rgba_copy clearly does: A newly allocated GdkRGBA, with the same contents as rgba Nevertheless I am encountering memory errors in my code with...

Exceptions in Lablgtk callbacks

exception,gtk,ocaml
In Lablgtk, whenever there is an exception in a callback, the exception is automatically caught and an error message is printed in the console, such as: (prog:12345) LablGTK-CRITICAL **: gtk_tree_model_foreach_func: callback raised an exception This gives no stack trace and no details about the exception, and because it is caught...

Changing window title on button press does not work

c,gtk,glade,anjuta
I'm using anjuta with glade and gtk+. I'm trying to get the button in my app to change the window title: void changetitle(GtkWidget *win) { gtk_window_set_title(GTK_WINDOW(win),"My Window"); FILE *fh = fopen("/tmp/output.txt", "w"); fclose(fh); } I'm trying to get the button to execute this action, but I seem to be failing...

Python: Entry Window sometimes will not die

python,gtk
I have this odd intermittent problem with a popup dialog that requests the user to enter a URL and press enter. Roughly half of the time, there is no response to the user pressing Enter. It can happen twice in a row for the same entered data and then work...

Gtk FlowBox - buttons in box clickable area tiny

python,gtk
I've created a GtkFlowBox into which I've added a load of buttons and am trying to catch clicks on these buttons with a function which, for the moment, simply outputs the selected button. However, the actual clickable area of each button is minuscule - you need to click right in...

error: undefined reference to.. long list while compiling GTK-3.12.2

linux,gtk,undefined-reference
Getting 100+ errors like this: ./.libs/libgtk-3.so: undefined reference to `g_drive_can_start_degraded' I've provided all the linker flags like -lglib-2.0 -lfreetype etc. still I'm getting those errors any help?...

make gtk widget fill parent window

xml,gtk,alignment,pygtk
I am new to gtk programming (but experienced with python). I have a window that has a button widget child. What do I have to do if I want the button to completely fill the window? By the way, this would be extremely easy to do with xml (fill-parent), is...

How to make filename/path from Gtk+ (Python 3.4) FileChooserDialog accessible globally

python,gtk,gtk3,filechooser
I've got some code that uses the Gtk+ FileChooserDialog in Python 3.4 to allow a user to select a file. Then, it's supposed to close the dialog (obviously) and continue executing the code that follows the user choosing a file. However, what happens is that the user selects their file,...

GDK Screen vs Monitor vs Display?

linux,gtk,screenshot,gdk
I'm currently working on a small app to take a screenshot of all the physical monitors. I am getting very confused though between all the terminology. I understand: that we can have multiple displays each display can have multiple monitors, which are known as screens? I'm confused because I'm thinking...

OpenCL / OpenGL Interop using GtkGLArea

c,opengl,gtk,opencl,gtk3
I know it looks like I only visit when I need something but I have another question. Building on my previous question, where I successfully ran a basic OpenGL program. I'm now adding OpenCL interop with a trivial CL script that shrinks the triangle a small amount each time it...

GTK+ 2.0 dynamic array

c,gtk
I am new to GTK+ and am writing in C using Eclipse. I have a couple of questions, if anyone can help I'll be more than thankful. I need to make a dynamic array of widgets (number of widgets can vary, like buttons or images). How can I achieve this?...

Gtk3 keys bindings in css files

css,gtk,gtk3,pygobject
Where can I find an exhaustive list of available keybindings a user can define in a css file for Gtk3. I have already checked those resources: https://developer.gnome.org/gtk3/stable/GtkCssProvider.html https://developer.gnome.org/gtk3/stable/gtk3-Bindings.html /usr/share/themes/Default/gtk-3.0/gtk-keys.css (which is empty) /usr/share/themes/Emacs/gtk-3.0/gtk-keys.css For example how can a user make <Control>Space move the cursor to the end of the text...

C++ program with gtk+

c++,gtk
I want to call gtk+ routines from a C++ program test.cpp, and he encountered a problem while building my program. I am getting the following error: g++ test.cpp -o test.x test.cpp:1:22: fatal error: gtk/gtk.h: No such file or directory # include <gtk/gtk.h> Somehow I need to link to gtk+. What...

Check box active and diactive in pythonGTK using glade

python,gtk,pygtk,glade
I want to write the code for the following image: I want to tell if tick is true be able to enter user and pass if the tick of Login is false not be able to enter user and pass. This is xml glade file: <?xml version="1.0" encoding="UTF-8"?> <interface> <!--...

A C function call that returns proper value but destination variable gets wrong

c,cmake,gtk,cairo
I am writing a library for producing charts from numerical data, it uses cairo and is meant to use code conventions similar to that library. The problem was: A C function appears to return the value I expected, I saw it by means of printf just before return. But the...

Gtk.main_quit() in Python script doesn't actually quit the Gtk main loop

python,gtk
I have a project that uses a Gtk.FileChooserDialog object to, obviously, allow a user to choose a file. Then, once the file is chosen, the dialog should disappear and the code should continue running. While the dialog does disappear, the code does not continue on from after the Gtk.main() -...

Get access to another window textEntry (Python)

python,gtk,pycharm,glade
I'm using PyCharm and Glade user interface designer. My project contains two windows: Main and Secondary. Secondary window starts from Main. After some manipulation in Secondary window I should close it. But before I'm saving some data in a list. And when Secondary window is closed I want to fill...

Cannot build Anjuta default GTK project

build,gtk,anjuta
I've just installed Anjuta on Ubuntu. I tried building the auto-made GTK(simple) project but I get the following error : "Error: Directory `/home/cookie . Cie' does not look like the top-level package directory" My project directory is named "PSE Anjuta Cie" so the mentionned directory looks like the end of...

Async Function in Vala - Yield & Callback

function,asynchronous,gtk,vala
I'm developing a project written in Vala and GTK +, I need to implement an asynchronous function, therefore I set out to make an example of test ... and for some reason I get the following error: async.vala:31.3-31.20: error: Access to async callback `asyncProc.callback' not allowed in this context asyncProc.callback...

In gtk3+ for python how to get selected menuitem or index of menuitem selected?

python,gtk,gtk3
def search(self,button): print 'search clicked' self.popup_menu=Gtk.Menu() s=self.search_field.get_text() if s: href, title, size, seeders, leechers= scrape_test.main() for i in range(len(href)): i1 = Gtk.MenuItem(str(i+1)+'. '+title[i]+' '+size[i]+' '+seeders[i]+' '+leechers[i]) self.popup_menu.append(i1) print ' ' self.popup_menu.show_all() self.popup_menu.popup(None, None, None, None, 0, Gtk.get_current_event_time()) popup shows up the menu but what i want to get the selected...

Adding 2 different widgets on single window GTK+

c++,gtk
I want to add 2 Widgets on same window one is of type gtk_drawing_area_new (); for using Cairo and other is of fixed to add some buttons. Is there anyway I can do this on same Window? I'm new to GTK+....

Getting “format not a string literal and no format arguments” warning while using GTK+2

c,security,gcc,gtk,gcc-warning
I am getting an error like this: warning: format not a string literal and no format arguments [-Wformat-security] GTK_BUTTONS_OK, (const gchar*)message); ^ because of this function: static void show_message (gchar *message, GtkMessageType type) { GtkWidget *dialog = gtk_message_dialog_new(NULL, 0, type, GTK_BUTTONS_OK, message); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); } How can I fix it?...

Logging messages to pygtk.entry

python,python-2.7,logging,gtk,pygtk
I am currently developing gtk GUI for my python Application. I want to implement simple text entry which will contain all logging messages of application (something like console logging window in GUI). Unfortunately, I was only able to create logging handler that will print logging messages to a file or...

GTK Python display message for given time

python-3.x,gtk,pygtk
I am doing a simple GUI for Python program. In one function, I want to display a text message for a few seconds and then continue. My code for this part is: self.message.set_text('This is a message') time.sleep(3) self.message_box.destroy() # call another function My issue is, the program firstly sleep and...

GtkTreeView does not show all rows when in a GtkBox

c,gtk,gtk3
I have the following MWE: #include <gtk/gtk.h> //#define USE_BOX int main(int argc, char *argv[]) { gtk_init(&argc, &argv); GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); GtkTreeStore *ts = gtk_tree_store_new(1, G_TYPE_STRING); GtkWidget *tv = gtk_tree_view_new_with_model(GTK_TREE_MODEL(ts)); GtkCellRenderer *renderer = gtk_cell_renderer_text_new(); gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW(tv), -1, "title", renderer, "text", 0, NULL ); gtk_window_set_default_size(GTK_WINDOW(window), 500, 400);...

Homogeneous children in ButtonBox

python,python-3.x,gtk,gtk3
I added a few children to a ButtonBox, and I wanted them not the be homogeneous. So I called ButtonBox.set_homogeneous(False) and mostly it worked. But when I resize the window bellow the minimum size, and a vertical scrollbar appears, I see there is a lot of empty space bellow the...

Gtk notifications don't display body holding '<'

python,notifications,gtk,pygobject
I'm trying to display notifications with the Notification module of pygobject (version 3.16) in python. My code works well, except when there is a < in the body message. In this case, the body is not displayed. For example with this code, all is OK: from gi.repository import Gtk, Notify...

Pygtk mount file through sftp without username and password dialog?

gtk,sftp,pygtk
I am trying to mount a directory via sftp in pygtk. Since I already have the username and password stored in variables, I don't want to get a dialog box asking for the username and password. I am using the following code: def error_printer(o,r) try: o.mount_enclosing_volume_finish(r) except gio.Error, e: print...

GtkSource module not importing in Python

python,gtk,gtksourceview
I am trying to build a source code editor using python and gtk, and I get the following error when I run my script: AttributeError: 'gi.repository.Gtk' object has no attribute 'Source' Below is my code, I have installed all dependencies (That I have researched) on Homebrew, still I can't import...

Open existing window in Gtk#

c#,.net,mono,gtk,gtk#
I have added a new window to the project and the name of the window is Actwindow. How can I open this window? I tried using Actwindow=new Window(); but it does not work. The window code is: using System; namespace myproject { public partial class Actwindow : Gtk.Window { public...

GTK+2.0 Combo Box - How to get the position of an entry?

c++,c,gtk
#include <gtk/gtk.h> //Defined a comboBox like this combo = gtk_combo_box_new_text(); //Added entries like this gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "string"); //How to get a particular entry deleted from the list of entries in the ComboBox combo? How do I delete a particular entry in the comboBox? For example - The ComboBox dropdown has entries...

How to hide a Gtk+ FileChooserDialog in Python 3.4?

python,gtk,gtk3
I have a program set up so that it displays a FileChooserDialog all by itself (no main Gtk window, just the dialog). The problem I'm having is that the dialog doesn't disappear, even after the user has selected the file and the program has seemingly continued executing. Here's a snippet...

GTK Main blocking Others threads.How to solve

gtk,main
I have 2 threads 1)Holds the GTK main and gtk screen display codes (code is explained below) 2)generates key events according to user rquirement if() block i ported into my code. but result is same. Once the signal is generated .after that its not coming to 2nd thread(signal generation thread)....

How to style a GtkLabel with CSS?

css,c,gtk,gtk3
I'm trying to use CSS to style a GtkLabel. I would like to change the color and font size of the label. Here is my C code: #include <gtk/gtk.h> int main(int argc, char *argv[]) { gtk_init(&argc, &argv); GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); GtkWidget *label = gtk_label_new("Label"); GtkCssProvider *cssProvider = gtk_css_provider_new(); gtk_css_provider_load_from_path(cssProvider,...

Difference between Gdk.Window, GtkWindow and GWindow in lablgtk

gtk,ocaml
In Lablgtk, there are (at least) three types of window-named modules: Gdk.Window GtkWindow GWindow What's the difference between them, and how can I go from one to another?...

pyGTK image type error (save pixmap)

python,gtk,pixmap
How can I save a pixmap as a .png file? I do this: image = gtk.Image() image.set_from_pixmap(disp.pixmap, disp.mask) pixbf=image.get_pixbuf() pixbf.save('path.png') I get this error: pixbf=image.get_pixbuf() ValueError: image should be a GdkPixbuf or empty ...

Python (GTK) : Can someone explain the difference between TreeStore, Listmodel and all the rest?

python,postgresql,gtk
I'm trying to get my head around the following concepts but all the documentation I've read bundles the whole lot in together without explaining what any of them really are and as a result I don't know how to use any of them properly. If someone could give some kind...

Vertical Scroll Bar in PyGTK

python,user-interface,gtk,pygtk
I made a combined text editor-terminal in Python using GTK. I want users to be able to control the amount of vertical space each occupies in the same window. I don't know how to do that, I need help, the suggested solutions I've searched online have not worked. # UI...

Widgets in window title Qt

c++,qt,gtk
Is in Qt something like GTK.headerbar or any other possibility to add wiget (button for example) in window title? Thanks in advance....

Making GTK# Window non resizable

c#,mono,gtk,gtk#
I have a GTK# Window i need to prevent user from resizing it.seen this answer How to set a fixed windows size in GTK and C but i cannot find the correponding method for gtk_window_set_resizable (GTK_WINDOW(mainWindow), FALSE); for C# here http://docs.go-mono.com/?link=T%3aGtk.Window

Autostart of GTK application failing

linux,gtk,debian,beagleboneblack
I have a GTK application that runs perfectly when run from the desktop or a terminal window. I created a myprog.desktop file in ~/.config/autostart: [Desktop Entry] Type=Application Name=MyName Path=~/...blah../MyApp Exec=./myapp NoDisplay=false Hidden=false X-GNOME-Autostart-enabled=true This creates an icon which I can double-click, and the code runs. However it does not run...

Is it possible to disable, fade or make a button inside a dialog unclickable in GTK?

c,gtk
I have a dialog like this: GtkWidget *dialog = gtk_dialog_new_with_buttons("Spell Checking", NULL, 0, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, GTK_STOCK_ADD, GTK_RESPONSE_APPLY, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL); After adding all the other necessary elements it'll look like this: What I want to do is to disable the OK button if the list of correct words is empty....

How to generate keypress event programmatically

c,gtk
I am trying to develop a GTK application in Linux. In this scenario I do not have a keyboard attached, and I need to generate key_press_event for GTK. I have written a multithreaded program to generate key press, but it works only once; after that the keypress is not getting...

Gtk2Hs set local format in a program or a widget

haskell,localization,gtk,gtk2hs
I'm trying to set the locale format of a spin button. The decimal mark on my system is a comma , and I would like it to become a dot .. Is there a function in GTK or Glib to set the locale formatting globally or locally on a widget....

manipulate python variable inside a GTK action listener

python,checkbox,gtk
I'm trying to an action listener that is attached to a checkbox button. My goal is to toggle the variable value ( 0 or 1 ) whenever the checkbox is checked/unchecked. I come from a C background and am fairly new to python. I've also been reading up on global...

Creating dir and loading file from relative path

c,gtk
I am using C and gtk, I need to create a dir at /home/demo/.config and load a file from this dir uisng a relative path. I am writing in C and gtk 2.0. I use g_build_filename for the moment, but this will only work if the dir exists, it won't...

Gtk “subtle” Progress Bar

gtk,gtk3
I am wondering how to achieve a progressbar / loader indicator similiar to the one Epiphany (aka Gnome Web) is using. See the provided screenshot: ...

How can I record the position where the user pressed the mouse button with Python and GTK?

python,gtk,gtk3
I would like to let the user of my application draw something. Which signal / event do I use for that? This is what I've got so far: #!/usr/bin/env python import gtk class DrawingAreaExample: def __init__(self): window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.set_title("Drawing Area Example") window.set_default_size(800, 600) window.connect('button-press-event', self.callback) window.connect("destroy", lambda w: gtk.main_quit())...

Python GTK+ 3 pull up just a file chooser dialog?

python,gtk
I'm trying to create a program that uses the Gtk FileChooserDialog dialog. I followed the tutorial here, and it works. However, I would like to just have the dialog pop up and not have to deal with the actual Gtk window. I've tried taking the code that, in the tutorial,...

Invalid UTF-8 string

c,gtk
I trying to swap the window title with the label inside the window on keypress. Below is my code : #include<gtk/gtk.h> static gboolean key_press_event(GtkWidget*,GdkEvent*,gpointer); int main(int argv, char* argc[]) { GtkWidget *window,*label; gtk_init(&argv,&argc); window=gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window),"Sajith"); gtk_widget_set_size_request(window,300,100); label=gtk_label_new("Sam"); gtk_label_set_selectable(GTK_LABEL(label),TRUE);...

(dlang, GtkD) Using menubar

gtk,d,ubuntu-14.04,dmd,gtkd
I copied the code in this site(https://sites.google.com/site/gtkdtutorial/#chapter2_2) and compiled it by dmd2. import gtk.MainWindow; import gtk.Box; import gtk.Main; import gtk.Menu; import gtk.MenuBar; import gtk.MenuItem; import gtk.Widget; import gdk.Event; void main(string[] args) { Main.init(args); MainWindow win = new MainWindow("MenuBar Example"); win.setDefaultSize(250, 200); MenuBar menuBar = new MenuBar(); menuBar.append(new FileMenuItem()); Box box...

Chain up to 'Gtk.Box.new' not supported

oop,gtk,vala
I'm new to Vala and so far I think it's pretty cool but I'm having trouble understanding inheritance. I read here that I should use base() to call the parents constructor. Alright, cool, seems understandable but It din't work for me. I kept getting the error on the title. Here...

Java 1.6 -> 1.7 JNLP = SIGSEGV

java,linux,gtk,java-web-start,jnlp
When i try to run JNLP in Red Hat Enterprise Linux Server release 6.4 (Santiago) app from Java 1.6(1.6.0_36 ) i get: [[email protected] ~]$ strace -e open /opt/tex/lib/java/jdk1.6.0_35/bin/javaws /tmp/app.jnlp >> /home/wojtek/6.txt open("/etc/ld.so.cache", O_RDONLY) = 3 open("/usr/lib64/libX11.so.6", O_RDONLY) = 3 open("/lib64/libnsl.so.1", O_RDONLY) = 3 open("/lib64/libc.so.6", O_RDONLY) = 3 open("/lib64/libdl.so.2", O_RDONLY) =...

Why is GTK spewing a ton of (seemingly) irrelevant warnings?

c,gtk,warnings
Here is a very simple GTK application that creates an application indicator: #include <gtk/gtk.h> #include <libappindicator/app-indicator.h> int main() { AppIndicator *indicator; GtkWidget *menu; GtkWidget *item1; GtkWidget *item2; GtkWidget *separator; indicator = app_indicator_new("testapp", "distributor-logo", APP_INDICATOR_CATEGORY_APPLICATION_STATUS); menu = gtk_menu_new(); app_indicator_set_menu(indicator, GTK_MENU(menu)); app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ACTIVE); item1 =...