gtk+

GTK+ widgets/windows being (randomly) corrupted, with what seems to be timers.

Hi, I have recently implemented a scrolling text across an area of limited screen estate using a timers repeating every 100ms, and some simple string appending. However, after this very implementation, I have come to realise that my GUI is getting randomly bugged/corrupted after a certain while. That is to say that some widgets/windows...

Refresh text shown in a GTK+ widget?

Being resonably new to using GTK+, im not fully aware of all its functionality. Basically, I have a GtkTreeView widget that has 4 Columns. I need to update the text displayed in the 4 columns every couple of seconds, but im not aware how to do this in GTK+. I'm aware that I could flush the data using gtk_tree_store_clear, but I'm not ...

Does destroying GtkBuilder destroy all created widgets?

Hi, Question regarding GtkBuilder. When we unref builder pointer does it destroys all the screens/widgets the builder had created? if( builder_ptr ) g_object_unref(G_OBJECT(builder_ptr)); Suppose we have created one screen using Glade/XML with some 2-3 top_level windows in it gtk_builder_add_from_file(builder_ptr, "Test.glade...

GTK+-based graph?

I want to be able to make a line graph using GTK+ but I'm unsure how to approach this. Has anyone got any hints or tips? ...

Difference between focus and focus-in(out)-event signals

Hello What's the difference between "focus" and "focus-in(out)-event" signals in GTK+? Which one is emitted firs? How are they related to keyboard(TAB) & mouse clicks. Do they depend on each other? I'm asking this because I want to keep track of currently focused widget within toplevel window and I don't want to test HAS_FOCUS flag of ...

How to set default name to GtkComboBox?

I want to set my GtkComboBox to have some default value/name, on it as follows: +---------------+---+ | Image Options | X | +---------------+---+ | Image Option 1 | +-------------------+ | Image Option 2 | +-------------------+ | Image Option 3 | +-------------------+ "Image Options" will be just a ...

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

GdkEventKey. Key value question

Hi How to translate GdkEventKey.keyval with level > 0 to key value with level == 0? For example: GDK_ISO_Left_Tab ==> GDK_Tab? Of course not using switch/case for every key. I need to get particular key, not a character. ...

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

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

Any way to make GtkProgressBar have a transparent background?

So far I've not been able to find any way to make the background of a GtkProgressBar transparent. I've tried setting a transparent image as the background, but the alpha channel is ignored. Can this be done? ...

Triggering a Gtk+ menu bar on hover

I've writing a Gnome window-switcher applet in PyGtk+ using menu items to represent the different applications running on the desktop. One thing I'd like to do is to activate the menu item under the cursor when I hover over the menubar. I can connect to the 'enter-notify-event' on the menu bar, but I don't know what to when it is trigger...