gtk

GTK detecting window resize from the user

In GTK (or pygtk or gtkmm...) How can I detect that an application window has been manually resized by the user, as is typically done by dragging the window's edge? I need to find a way to differentiate manual resizes from resizes that originate from gtk, such as changes in window content. ...

GtkNotebook add-tab button

Is it possible in Gtk+ to have an add-tab button inline with the tabs in a notebook, ala Opera or Google Chrome? I do know that Opera uses Qt and Chrome uses custom tabs, but is it possible in pure Gtk+? ...

Why won't Gtk's button_press_event receive single left clicks?

I am trying to set up an add-tab button in a Gtk::Notebook (gtkmm). I am doing this by drawing a pixmap to a calculated position -- that works just fine. However, when trying to receive events for it, I cannot pick up a single left click. Single middle and single right give both press and release events, and double left gives just a pres...

Stacking widgets in Gtk+

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. ...

Gtk+ mouse pointer leave-area event

I need to detect when the mouse pointer leaves an area in a GtkNotebook. Normally this is possible with the motion_notify event, but if the pointer is moved fast enough, the event is not triggered. Because this is a certain area of pixels in a GtkNotebook, it is not possible to use a GtkEventBox. What is the proper way to do this? ...

Figuring out a C loop

This is one of the default gnome screensavers - "personal slideshow". It displays pictures from some location, pausing ~10s between pictures. Anyone know how it's looping & pausing? I'm trying to increase the delay, but I'm hesitant to add sleep() without first knowing how it's doing it. Thanks #include "config.h" #include <stdio.h> ...

How to handle back and forward buttons in the hildon.Seekbar?

The hildon.Seekbar widget consists of a scale widget and two buttons. What signals does the widget send when the buttons are clicked or how could I find out? Is there a way to monitor all signals/events that a widget sends in PyGTK? ...

A program to change my C/GTK+ code to comply with GEdit's standards

I'm going to be making changes to my version of GEdit. I would also like to submit some of my code to the actual GEdit team (bug fixes and stuff like that). GEdit uses a standard to format code like so: static void hello( GtkWidget *widget, gpointer data ) { g_print ("Hello World\n"); } Which I forget (can't s...

Adding/removing notebook pages in PyGTK/GTK on the fly

How to refresh a notebook on the fly? I have an application which is supposed to have various number of pages according to the data in the underlying model. In order to synchronize the appearance of the Notebook I'd like to refresh it every time a row is added/deleted from the model. I've tried this: ... def get_pagebox(self, ...

I need some new blogs to help learn my new language (it's C).

I'm a BIG blog reader. I can't stop reading blogs. Blogs helped me find this site (in particular Jeff's blog). However I've come to realize that all the blogs I read deal with one language. Coding Horror Fabulous Adventures In Coding Jon Skeet's Blog Scott Hanselman's Blog Did you guess the language? Well now I'm learning C and usi...

Speeding up GTK tree view

I'm writing an application for the Maemo platform using pygtk and the rendering speed of the tree view seems to be a problem. Since the application is a media controller I'm using transition animations in the UI. These animations slide the controls into view when moving around the UI. The issue with the tree control is that it is slow. ...

GLib-GObject-CRITICAL warnings

I'm confused by these two warnings. Can anyone explain how I might have come about triggering them, and how they would be able to be debugged in gdb? (gtkworkbook:24668): GLib-GObject-CRITICAL **: g_cclosure_new: assertion `callback_func != NULL' failed (gtkworkbook:24668): GLib-GObject-CRITICAL **: g_signal_connect_closure_by_id: ass...

gtk.StatusIcon and gtk.Menu on Windows

I have a crossplatform app that has a gtk.StatusIcon sitting in the tray, and a right click context menu. The problem is: on Windows machines the placement of the menu is awful. The top of the menu starts at the mouse pointer and so most of the menu extends below the bottom of the screen. This can then be scrolled up and is usable, but i...

Can GtkMenuItem have colored label

So I am basically doing the following and I want SomeText to have red forground color. How to achieve this: GtkWidget *menu_item =gtk_menu_item_new_with_labelex("SomeText"); I am using GDK 2.0 Thanks ...

gtk_menu_item_new_with_labelex vs gtk_menu_item_new_with_label

what is the difference between these two function calls: menu_item_new_with_labelex vs gtk_menu_item_new_with_label ...

PopupMenu in Gtk#.

I have a Gtk scrolled window that I'm trying to attach a PopupMenuHandler function too like so: this.scrolledwindow1.PopupMenu += HandlePopupMenu; and the HandlePopupMenu looks like so: [GLib.ConnectBefore] public void HandlePopupMenu(object o, PopupMenuArgs args) { Console.WriteLine("test"); Gtk.Menu mbox = new Gtk.Menu(); ...

Why do Java's GtkLookAndFeel Popups have no border?

I have an already written Java Swing app (so no switching UI frameworks) that I would like to look at least decent using the GTKLookAndFeel. I've already accounted for things like font and component size differences across LookAndFeels, but one thing I can't figure out is why my popup menus have no borders at all. It appears they are u...

How to use gtk_widget_add_accelerator ?

I am trying to build a gtk widget which will exists when Escape key is pressed. Here is my code. gtk_signal_connect (GTK_OBJECT(window), "delete-event", GTK_SIGNAL_FUNC(gtk_main_quit), NULL); /* FIXME */ GtkAccelGroup *accels = gtk_accel_group_new(); gtk_window_add_accel_group(GTK_WINDOW(window), accels); gtk_widget_...

Is there an API to do per-pixel Alpha Blend on GTK and OSX ?

I want to draw transparent windows (with alpha channel) on Linux (GTK) and OSX. Is there an API to do that ? Note that I don't want to set a global transparency, the alpha level should be set per pixel. I'm looking for the same kind of API than the UpdateLayeredWindow function on Windows, as in this example: Per Pixel Alpha Blend. ...

Creating native GtkMenu from Firefox extension

Hi SO, Is it possible to create a native GtkMenu (I mean not XUL, but a real GtkMenu) from a Firefox extension? (and add to the firefox window). I would like to make GlobalMenu work with Firefox, which currently doesn't work due to the lack of native GUI. ...