gtk

How to center a GNOME pop-up notification?

To display a GNOME pop-up notification at (200,400) on the screen (using Python): import pynotify n = pynotify.Notification("This is my title", "This is my description") n.set_hint('x', 200) n.set_hint('y', 400) n.show() I'm a gtk noob. How can I make this Notification show up centered on the screen, or at the bottom-center of the s...

What is the best/fastest way to learn GLADE with C?

I just downloaded and installed GLADE. What are some good tutorials for the C language? ...

How to get GTK syntax highlighting in GEdit?

I just started using GTK to develop my GUI applications. I'm using GEdit as my text-editor, so how can I get the following to be included in the syntax highlighting: GtkWidget *window; GtkWidget *button GtkWidget *box1; gtk_init(&argc, &argv); as if it were like this: int x = 3; ...

What is the difference between GTK# and Windows Forms?

Hello, What is the difference between GTK# and windows forms? Are they totally different? Thanks ...

GTK applications fail to start - xfs restart needed Options

Sorry, not really programming question, but I am not sure where else I could find some help. After a recent update (Xorg was updated among other things), GTK apps stopped running in my kde4. I have a Debian unstable, updated around 22 April. When I try to run them I get the following error: ga@grzes:~$ iceweasel The program 'firefox-...

How do I find out what GDK events are required for a GTK+ signal?

I'm using Glade-3 for my GUI design, but I keep hitting this problem. I don't see anything in the GTK+ documentation mapping signals to events or in Glade-3 (3.4.5). Is there a place in the GTK+ source code to find this information? Note: It is important in this question to recognize that events and signals are NOT the same thing in GTK...

Preventing gtk FileChooserDialog calling stat on all files in the directory?

Opening a gtk FileChooserDialog is painfully slow for nfs directories containing many files. strace shows a lot of time calling "stat". About 5 calls for each of the files in the directory. How can we switch off the calls to 'stat' and just show a list of filenames without the modification time? We're using operating Redhat enterprise 4...

Gtkmm Tutorial?

Where can I find a Gtkmm tutorial? I'm primarily a C# programmer, but I also know C++. ...

Which is the best GUI designer for GTK apps?

I want a visual GUI designer that will produce XML output in the format used by GtkBuilder. Glade seems to be the most powerful, although Gazpacho is more lightweight. Stetic (included with MonoDevelop) seems to be good but I don't believe it supports GtkBuilder yet. ...

Making a Grid in GTK+

I'm not asking for a code implementation, but given GTK+'s skillset, what would be from an abstract perspective the best way to implement a grid such that each square is clickable and the like? ...

GtkDialog in shell

I'm using gtkdialog in shell script but I got stuck.I tried "use-markup" to format the font,however it appears does not work.Is not there anything like ? And if the program has several widgets the layout always be disorderly... Is there a solution?Or a good tutorial on gtkdialog?(I searched but could not find one besides the user-manual)...

How to get the height of the gtktreeview header?

I've looked in the gtk source code and the header height is private. I've tried something but it didn't work as wanted (the heightWithHeader is 1?!) Glib::RefPtr<Gdk::Window> pWindow = treeView.get_bin_window(); treeView.set_headers_visible(true); pWindow->get_size(width, heightWithHeader); treeView.set_headers_visible(false); pWindo...

C GUI, with a C++ backbone?

I have a simple (and also trivial) banking application that I wrote in C++. I'm on ubuntu so I'm using GNOME (GTK+). I was wondering if I could write all my GUI in C/GTK+ and then somehow link it to my C++ code. Is this even possible? Note: I don't want to use Qt or GTKmm, so please don't offer those as answers. ...

How to catch clicks in a Gtk.TreeView?

I'm trying to catch a double-click event in a TreeView's empty area to create a new node. Unfortunately standard way doesn't work. I've tried attaching ButtonPressEvent to both TreeView and the ScrolledWindow in which T.V. is hosted. I don't get any callbacks to my function. How can I solve this? ...

Why is the first toolbar button automatically selected when my gtk application loads?

When my gtk application loads, the first item on the toolbar is automatically selected (it is highlighted, it is pressed when it hit enter). This is just a minor problem, but I would prefer for nothing to be selected by default. Here is some basic sample code: import gtk import gtk.glade window_tree = gtk.glade.XML('testtoolbar.glade'...

Handling key presses in GTK+ (gtkD)

I'm playing around with gtkD (a D binding for GTK+) I have a window object, instance of gtk.MainWindow. I want to handle keypresses on it. How? How do I deal with special keys (e.g. arrow keys, pgup/pgdn etc)? PS I know these kinds of questions can be answered with google and stuff, but I've seen much "simpler" questions on stack...

get/set text from input field in Gtk+ window using C#

I was able to get/set text from input fields in Win32 another application windows by traversing the windows using FindWinodwEx, finding the field, and then using SendMessage to send WM_GETTEXT/WM_SETTEXT to set/get text from that input field. This works great as long as I am working with Win32 windows of course. However, Gtk+ application...

Why does a newly added widget have no allocation?

I want to add a widget to the bottom of a scrolled window, then scroll to the bottom of that window. However, the window thinks it is already at the bottom, because the widget has still not been allocated. I.e., this returns -1: widget.get_allocation().y Why is this? Is there any way to force the widget to be allocated immediately, so...

How to remove the GtkTreeView sorting arrow?

I need to remove the sorting arrow from a column header. This can be done by calling set_sort_indicator(false) on the column. The arrow isn't displayed, but the space for it seems to still be reserved. If the title of the column is big enough to fill all the header, the last part is clipped (where the arrow should be). Is there a way ...

How to debug PYGTK program

When python raise an exception in the middle of a pygtk signal handling callback, the exception is catched by the gtk main loop, its value printed and the main loop just continue, ignoring it. If you want to debug, with something like pdb (python -m pdb myscript.py), you want that when the exception occure PDB jump on it and you can sta...