gtk

Dynamic resize with MPlayer and PyGTK

Hi everyone; I've wrote a piece of code in python and pygtk for an embeded mplayer in a gui. I assume I use GtkSocket and the slave mode of mplayer with the -wid option. But I've got an issue, when the size of my GTK window is smaller than my stream, the stream appears to be cropped. And when the size of my window is bigger than my stre...

Clear the system clipboard using the GTK lib, in C

I'm calling the following function to try to clear the system clipboard: GtkClipboard *clipboard; clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); gtk_clipboard_clear(clipboard); however it's not cleaning anything. I've searched the Gnome and GTK+ documentations and countless sample code snippets and I've no idea how to do thi...

Getting values from Multiple Text Entry using Pygtk and Python

On a click of a button named "Add Textbox" it calls a function which creates a single textbox using (gtk.Entry) function. So each time i click that button it creates a textbox. I have a submit button which should fetches all the values of the text boxes(say 10 textboxes) generated with the name of "entry". It works for one textbox but no...

"Gtk-WARNING **: cannot open display: " when using execve to launch a Gtk program on ubuntu

Hi, I have the following c program which launches a Gtk Program on ubuntu: #include <unistd.h> int main( int argc, const char* argv[] ) { char *args[2] = { "testarg", 0 }; char *envp[1] = { 0 }; execve("/home/michael/MyGtkApp",args,envp); } I get "Gtk-WARNING **: cannot open display: " and my program is not launched. I ...

In Gtk#, why might VALID_ITER fail even after I check it with IterIsValid?

I have a convenience function in my TreeView that looks something like this: Card GetCardFromPath (TreePath path) { TreeIter iter; if (path == null || !Model.GetIter (out iter, path)) return null; if ((Model as TreeModelSort).IterIsValid (iter)) return (Card) Model.GetValue (iter, 0); return null; } M...

GTK:Button onHover effect different on Linux and Windows

Hi, I have a GTK button on my GUI app, however, the hover effects are different for both Linux and Windows: Heres Linux: http://imgur.com/DKAy6 Heres Windows: http://imgur.com/v0FFU I did not do anything fancy to the animations, in fact, the animation is default, how can I make it uniform? Thank you. ...

How can I find out where is my code causing GLib-GObject-CRITICAL

Hi, When I c/c++ application fails with the following CRITICAL, can you please tell me how can I find out where is the code causing the error? I have tried to run it in Debugger, trying to do a 'bt when the program fails. But it does not show where is the code causing the CRITICAL: (process:3155): GLib-GObject-CRITICAL **: /build/build...

How can I setup my ubuntu environment to run a linux application on framebuffer

Hi, Can you please tell me how can I setup my ubuntu environment with a framebuffer? And then how can I run my gtk program with it? I am using gnome as my window manager in my ubuntu environment. So if I run my gtk linux program with it, do I expect to see anything on screen? Thank you for any help/pointers. ...

Can I avoid a threaded UDP socket in Python dropping data?

...

pygtk - dynamically update the widgets taking input from the gtk combo box

On selecting value from 1 to 10 from gtk combox box it should populate the checkbox by taking combo box value as an input. Say for example if i select 5 then 5 checkbox will be generated. It works.. But the issue is after i selected 5 now im selecting next value as 3 from combo box then there 8 checkboxes are displayed. The old 5 checkbo...

Retrieving Gtk::Widget's relative position: get_allocation() doesn't work

I need to retrieve the position of a Gtk::Widget relative to its parent, a Gtk::Table. Most sources (e.g. http://library.gnome.org/devel/gtk-faq/stable/x642.html) say that one needs to call Gtk::Widget::get_allocation(). However, the returned Gtk::Allocation object always contains x = -1, y = -1, width = 1, height = 1. I have to note th...

How do I handle button presses in Gtk2::Image objects?

I've been trying to get an Gtk2::Image object in this Perl Gtk2 application to get to react to button presses, but to no avail. The image shows as expected but the button events don't get handled. What am I missing? my $img = Gtk2::Image->new_from_file( $file ); $img->set_property( sensitive => 1 ); $img->can_focus( 1 ); $img->...

Detect user logout / shutdown in Python / GTK under Linux - SIGTERM/HUP not received

OK this is presumably a hard one, I've got an pyGTK application that has random crashes due to X Window errors that I can't catch/control. So I created a wrapper that restarts the app as soon as it detects a crash, now comes the problem, when the user logs out or shuts down the system, the app exits with status 1. But on some X errors i...

Portable C Compiler (pcc) with GTK+ in Code::Blocks

I had some problems when trying to compile a GTK+ program with Portable C Compiler (pcc) using Code::Blocks in Windows. When I tried to build the default GTK+ project in Code::Blocks, I get these errors: -------------- Build: Debug in cb-temp2 --------------- Compiling: main.c C:\CMPITG\gtk\include\glib-2.0/glib/gutils.h, line 423: par...

Gtk Change Font and font color for an application.

I am having one Gtk+ and C application in which i want to set the font to some XYZ font type and font color to blue, for all the labels and text in the application how can i do this in one go, I have developed all the screen using Glade RAD tool, and currently i am doing this by calling following function for each label. gtk_label_set_m...

GTK+ (GTKSharp) poor performance in Windows

Hi, In my Mono (C#) project that is meant to be cross-platform, I am using the GTK for the UI. However one thing I noticed is, on my netbook in Archlinux, the performance is really speedy, so events such as mouse hover, and redrawing of widgets, etc, are really fast. Compared to windows (7) on dual core CPUs, the performance is really ...

Replace the callback for a GtkItem created from a GtkItemFactoryEntry

I'm writing a plugin that's modifying an existing UI. One thing I want to do is change what an existing menu item does. This is all using the Gtk library. The menu item (a GtkItem) is created from a GtkItemFactoryEntry (which is out of my control), and has its current behaviour defined by the callback in the GtkItemFactoryEntry. I ...

How to set "toggle-spacing" style property to GtkMenuItem in gtk+?

Hi, How can I set "toggle-spacing" style property to GtkMenuItem in gtk+? I have added five GtkImageMenuItem(gtk_image_menu_item_new_with_label) to GtkMenu. Now I want to provide spacing between Image and label of this GtkImageMenuItem. There is a style property (toggle-spacing) in GtkMenuItem to provide spacing between image and lab...

Forwarding keypresses in GTK

I'm writing a bit of code for a Gedit plugin. I'm using Python and the interface (obviously) is GTK. So, the issue I'm having is quite simple: I have a search box (a gtk.Entry) and right below I have a results box (a gtk.TreeView). Right after you type something in the search box you are presented a bunch of results, and I would like th...

Use regular expressions with Glib

Hello, I would like to find all comment blocks(/*...*/) but the function g_regex_match_full always returns true. Here is the code : // Create the regex. start_block_comment_regex = g_regex_new("/\*.*\*/", G_REGEX_OPTIMIZE, 0, &regex_error); //Search the regex; if(TRUE == g_regex_match_full(start_block_comment_regex, current_line, -1, 0...