gtk

How to remove "selected" border around GtkButton?

In GTK+, how to remove this dotted border around a GtkButton, which gets drawn after we click the button? ...

Using GtkMenu in Gtk+-2.14.0

I am building an application which has GtkMenu widget. I am using Glade RAD tool to develop UI and while creating project in Glade I have specified version of GTK as 2.16 which supports GtkMenu and GtkMenuItems. So I used GtkMenu everywhere in app (for File Menu and for Right Click Menu). But I tried this application on my target platf...

In Gtk, how do I make a Button with just a stock icon?

I want to create a button with the stock "Remove" icon on it, but without the text "Remove". If I use Button button = new Button(Stock.Remove);, I get the opposite: just the text, and no icon. I will have many of these buttons, and the text makes it look cluttered. How do I get just the icon? Note: these are regular buttons, not toolbar...

How to Restore Gtk Widget's default color?

If i am setting GtkEventBox bg color to some custom color on some event like button click. // Set Window Background color GdkColor color; gdk_color_parse("red", &color); gtk_widget_modify_bg(GTK_WIDGET(myEvtBox), GTK_STATE_NORMAL, &color); and after another click i need to restore it to original state/color how to do this? do i need t...

Problem while adding GtkVBox component to GtkScrolledWindow

I am having following code/function which adds list of components to the GtkScrolledView. It first adds GtkButton (with GtkLabel+GtkImage in it) to GtkVBox and GtkVBox to GtkScrolledWindow: void displayTestNameList() { // Get Scrolled Window from Builder. GtkWidget *scrolled_window = GTK_WIDGET( gtk_builder_get_object( myBuil...

How do I get the selected text in desktop application using python-dbus?

For example, I open a pdf file or a web page in gnome, use mouse double click some text, so a word is selected, how can I get this word in a background running daemon written with python-dbus? Some simple but working piece of script is appreciated greatly. Thanks! ...

Pointers in Lisp?

I've started learning Lisp recently and wanted to write a program which uses gtk interface. I've installed lambda-gtk bindings (on CMUCL). I want to have putpixel/getpixel ability on a pixbuf. But I found that I'm unable to direct access memory. (or just don't know how) Function (gdk:pixbuf-get-pixels pixbuf) returns me a number - memor...

How to hide Gtk Popup Window when user clickes outside the window.

I have developed one popup window (Non decorated) using GTK+ and glade tool in C. It popup on its parent window when a button clicked. I want to destroy or hide this popup window when user clicks out side this window. User can click on parent window or any other window. I have tried to capture GDK_FOCUS_CHANGE event but I am not able t...

gtk beginner app won't work with assertion fail

I've done this simple app in Gtk, just to test things out... I come from swing so redefining a draw event function is normal for me... Anyway seems not to work: #include <gtk-2.0/gtk/gtk.h> #include <gtk-2.0/gdk-pixbuf/gdk-pixbuf.h> #include <stdlib.h> #include<string.h> #include<stdio.h> #include <iostream> GdkPixbuf *imm; void destr...

display a image from the internet in gtk

I wanna display a image from the internet how can I put it? ...

lambda-gtk negative pointer

I was trying to write my own put-pixel on (Gdk) pixbuf in Lisp. When I finally realized how I can operate on C pointers in CL, new obstacle came along - (gdk:pixbuf-get-pixels pb) returns me negative number. My question is: can I convert it somehow to a valid pointer? My attempts to use cffi:convert-from-foreign and cffi:translate-from-f...

Which is the best way to handle GtkMenu activate callback?

I have created a GtkMenu with 10 GtkMenuItems in it, and attached activate event to each menu item, but in callback function how should I get to know which menu item was actually selected? I have added Call back to GtkMenuItem as follows: gtk_signal_connect_object( GTK_OBJECT(menu_items), "activate", GT...

Under Gtk+/Glib are there any utility functions, where we can read and write config File?

I have a config file in which I have keys and values, like this: key1=value1 key2=value2 key3=value3 So is there any utility functions in Gtk/Glib that can read this file and retrieve the value corresponds to key? ...

How to escape characters in Pango markup?

My program has a gtk.TreeView which displays a gtk.ListStore. The gtk.ListStore contains strings like this: "<span size='medium'><b>"+site_title+"</b></span>"+"\n"+URL Where URL is (obviously) a URL string. Sometimes there are characters in URL that cause pango to fail to parse the markup. Is there a way to escape URL as a whole so...

How to set visible border to Gtk Image.

I am having GtkImage to which i want to set visible border like a frame... so when ever i set any image it will come with default border/frame, which will look good. :) ...

How to refresh image in gtk ?

Sorry everyone my english is poor , i'm still learning. Let me say this as plainly as I can this is my question. if i create a application , like this. -------------------------------- image 1|image 2|image 3| (button) -------------------------------- i wanna if i clicked button,the application image will be change -----------------...

How to check if image exists before setting it?

I am trying to update a GtkImage with gtk_image_set_from_file(), but how can I check if this image exists? ...

How to Set Call Back For Enter key of GtkTextView?

Really fed-up how can i set call back on enter key of GtkTextView Widget. For which event i can listen? Thanks. ...

gtk: how to hide a window when the application loses focus

Hi, I want to duplicate the behaviour of tool windows in OpenOfice. When the application loses focus, the tool windows (if they are not docked) are hidden. So, I have a main window, and another utility window (win_dock). I want to hide win_dock when all the windows of the application loses focus and show it again if a window gain focus...

How to change background color of GtkTextView?

How to change background color of GtkTextView? I tried with normal widget set bg functionality but gtk is just changing border color of GtkText View. Plus can some some please explain me with simple example, that how to change Text Color/Font/Text Size in GtkTextView (Whole text in GtkTextView)? I fond some examples but they are not wo...