gtk

Python/X11: find out if user switches virtual desktops

Hello everyone, I'm looking for a way to determine if the user switches virtual desktops under X11. I'm using Python with X11 libraries and PyGTK. I found some working examples in C, but I lack the expertise to translate them into Python, and I read the source code of several X11 pager applications (fbpanel, pypanel), but I can't seem ...

How to copy or duplicate gtk widgets?

How to copy or duplicate gtk widgets? In my application I have one huge GtkComboBox created with one long for loop which eats up so much of time and I am using this combo at two places in one single screen. So, what I want to do is create this combo for one time and duplicate/copy it in another one so it will save my time. If I try to ...

Gtk, How to update GtkViewPort with GtkVBox.

I am having one GtkVbox and I am adding it to GtkViewPort. View port is created from Glade file. Now the problem is that my vbox keeps updating on every second (I keep adding widgets to vbox on every second) this vbox but my screen did not get updated as add widgets to my vbox. I can't create new vbox every time as I need to keep previ...

Sort data in GtkTreeView non-alphabetically?

I'm trying to sort a column of data in a GTK tree view non-alphabetically. I can't seem to find a function in the GTK+ libraries that cant do such a thing. Does anyone here know of a way to do this? UPDATE: Below is the code im currently trying to use: column = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(column, "Mem...

how to compile a program with gtkmozembed.h

Hi, i have written a program under ubuntu, in which i include gtkmozembed.h. I am facing a problem in compiling the program.Below is the simplest form of a program which uses gtkmozembed. #include <gtk/gtk.h> #include <stdio.h> #include <gtkmozembed.h> int main(){ GtkWidget *mozEmbed; mozEmbed = gtk_moz_embed_new();...

Painting on GtkScrolledWindow or GtkEventBox

Using GTK, I'm trying to overlay a "More" prompt (but it could just as well be any drawing object) in the corner of a GtkTextView contained within a GtkScrolledWindow. I draw the prompt in the handler for the expose signal of the text view. It works, but when I scroll the window I get artifacts: the prompt is moved along with the content...

Getting X error while runing GTK+ application

I have written a GTK+ application but I am getting the following X Window error while running it: The program 'TestApp' received an X Window System error. This probably reflects a bug in the program. The error was 'BadMatch (invalid parameter attributes)'. (Details: serial 222 error_code 8 request_code 2 minor_code 0)...

How set opacity to GtkWindow inside GtkEventBox.

I want to set opacity of GtkWindow inside GtkEventBox. gtk_event_box_set_visible_window(GTK_EVENT_BOX(eventbox), TRUE); gtk_window_set_opacity(event_top->window, 1); I am getting Following Error: enter code here`Gtk-CRITICAL **: gtk_window_set_opacity: assertion `GTK_IS_WINDOW (window)'failed Am i doing it write way? Thanks, P...

How to retrive GtkWindow Inside GtkEventBox?

I want to retrieve GtkWindow inside GtkEventBox. So I used event_box->window, it is not giving any error but i am getting error GTK_IS_WINDOW fails. or do i have to do it in the expose event? ...

Gtk how to calculate width of the string in pixels.

Gtk how should I calculate width of the string in pixels. I have created a markup string using g_markup_printf_escaped and I want to calculate width of the string in pixels not in chars. Does Pango provides any function to calculate string length in pixels? Depending on font type, size and weight. Thanks, pp. ...

Totally fed-up with get Gtk widget height and width.

Trying to get Height and Width of GtkEventBox. Tried following Things. GtkRequisition requisition; gtk_widget_get_child_requisition(widget, &requisition); // Getting requisition.height 0 ---------------------------------------------------------- widget->allocation-x //getting 0 widget->allocation-height //getting -1 ------------...

g_signal_connect error invalid use of member

Hi Guys, More GTK questions, im trying to compile some code and im getting the following error: error: invalid use of member (did you forget the ‘&’ ?) This is comming from the g_signal_connect call: g_signal_connect ((gpointer) Drawing_Area_CPU, "expose-event", G_CALLBACK (graph_expose), NULL); Drawing_Area_CPU is a GtkW...

Gtk, How to scroll at bottom of viewport list?

I have created one list with GtkVBox and GtkViewPort. and i am doing the scroll by two up/down GtkButtons. GtkAdjustment* adjustment; adjustment = gtk_viewport_get_vadjustment(GTK_VIEWPORT(viewport_ptr)); gtk_adjustment_set_value(adjustment, gtk_adjustment_get_value(adjustment)+(gdouble)SCROLL_SIZE); gtk_widget_show_al...

Conditional CellRenderCombo in pyGTK TreeView

I have a two column TreeView attached to a ListStore. Both columns are CellRenderCombo combo boxes. When the user selects an entry in the first box, I need to dynamically load a set of options in the second. For example, the behavior I want is: On row 0, the user selects "Alphabet" in the first column box. The second column box ...

Stuck on scrolling GtkViewPort to end.

I am adding one GtkVBox to GtkViewPort. And I am doing scrolling for GtkViewPort based on two Up/Down Buttons. I need to display last item in VBox as we do in Message Chat Screens (Message Chat list displays/adds newest chat message at bottom of the list) i doing exact thing. so for scrolling at the bottom of the GtkViewPort i am doi...

Where is the PyGTK event stack?

You can know if the event stack is empty calling the gtk.events_pending() method, but I want to manipulate the pending events and filter it before the next gtk loop cycle, this data must be stored somewhere, but where? Thanks. ...

GTK TextView automatically resizing

I'm messing around with GTK and glade for the first time, and I've run across a really annoying issue. When I enter text into a TextView, the TextView automatically resizes larger, pushing other widgets away. This is a really annoying behavior. I do not want my TextView changing size depending on the amount of text within it. Does anyo...

Gtk: How can I get a part of a file in a textview with scrollbars relating to the full file

I'm trying to make a very large file editor (where the editor only stores a part of the buffer in memory at a time), but I'm stuck while building my textview object. Basically- I know that I have to be able to update the text view buffer dynamically, and I don't know hot to get the scrollbars to relate to the full file while the textvie...

is it possible to control the windows of an external app

I want to take the control of the window for exmple i want to force to external app to start minimized I mean when i enter this command myapp Firefox Firefox starts but minimized firefox is not important I mean i want to do it with any gui application If yes can any body show me the way? ...

BadAlloc X Error

Hi Guys, Im having some problems with a GTK program im trying to build. When i compile it i keep getting this error: This probably reflects a bug in the program. The error was 'BadAlloc (insufficient resources for operation)'. (Details: serial 195 error_code 11 request_code 53 minor_code 0) Ive traced it down to the following comman...