Search Results

Search found 13 results on 1 pages for 'gtktextview'.

Page 1/1 | 1 

  • GtkLabel reset and GtkTextView max length

    - by stdio
    I've a NULL gtklabel. Upon the occurrence of an event, I set a text in this label (with gtk_label_set_text). How can I reset the gtklabel after the event (reset to NULL)? How can I set the max length (characters) of a GtkTextView? What's the easiest way to set the distance from the margin of a widget in a GtkTable?

    Read the article

  • Keybindings for individual letter keys (not modifier-combinations) on a GtkTextView widget (Gtk3 and PyGI)

    - by monotasker
    I've been able to set several keybord shortcuts for a GtkTextView and a GtkTextEntry using the new css provider system. I'm finding, though, that I only seem to be able to establish keybindings for combinations including a modifier key. The widget doesn't respond to any bindings I set up that use: the delete key the escape key individual letter or punctuation keys alone Here's the code where I set up the css provider for the keybindings: #set up style context keys = Gtk.CssProvider() keys.load_from_path(os.path.join(data_path, 'keybindings.css')) #set up style contexts and css providers widgets = {'window': self.window, 'vbox': self.vbox, 'toolbar': self.toolbar, 'search_entry': self.search_entry, 'paned': self.paned, 'notelist_treeview': self.notelist_treeview, 'notelist_window': self.notelist_window, 'notetext_window': self.notetext_window, 'editor': self.editor, 'statusbar': self.statusbar } for l, w in widgets.iteritems(): w.get_style_context().add_provider(keys, Gtk.STYLE_PROVIDER_PRIORITY_USER) Then in keybindings.css this is an example of what works: @binding-set gtk-vi-text-view { bind "<ctrl>b" { "move-cursor" (display-lines, -5, 0) }; /* 5 lines up */ bind "<ctrl>k" { "move-cursor" (display-lines, -1, 0) }; /* down */ bind "<ctrl>j" { "move-cursor" (display-lines, 1, 0) }; /* up */ } Part of what I'm trying to do is just add proper delete-key function to the text widgets (right now the delete key does nothing at all). So if I add a binding like one of these, nothing happens: bind "Delete" { "delete-selection" () }; bind "Delete" { "delete-from-cursor" (chars, 1) }; The other part of what I want to do is more elaborate. I want to set up something like Vim's command and visual modes. So at the moment I'm just playing around with (a) setting the widget to editable=false by hitting the esc key; and (b) using homerow letters to move the cursor (as a proof-of-concept exercise). So far there's no response from the escape key or from the letter keys, even though the bindings work when I apply them to modifier-key combinations. For example, I do this in the css for the text-widget: bind "j" { "move-cursor" (display-lines, 1, 0) }; /* down */ bind "k" { "move-cursor" (display-lines, -1, 0) }; /* up */ bind "l" { "move-cursor" (logical-positions, 1, 0) }; /* right */ bind "h" { "move-cursor" (logical-positions, -1, 0) }; /* left */ but none of these bindings does anything, even if other bindings in the same set are respected. What's especially odd is that the vim-like movement bindings above are respected when I attach them to a GtkTreeView widget for navigating the tree-view options: @binding-set gtk-vi-tree-view { bind "j" { "move-cursor" (display-lines, 1) }; /* selection down */ bind "k" { "move-cursor" (display-lines, -1) }; /* selection up */ } So it seems like there are limitations or overrides of some kind on keybindings for the TextView widget (and for the del key?), but I can't find documentation of anything like that. Are these just things that can't be done with the css providers? If so, what are my alternatives for non-modified keybindings? Thanks.

    Read the article

  • Inserting newlines into a GtkTextView widget (GTK+ programming)

    - by Mark Roberts
    I've got a button which when clicked copies and appends the text from a GtkEntry widget into a GtkTextView widget. (This code is a modified version of an example found in the "The Text View Widget" chapter of Foundations of GTK+ Development.) I'm looking to insert a newline character before the text which gets copied and appended, such that each line of text will be on its own line in the GtkTextView widget. How would I do this? I'm brand new to GTK+. Here's the code sample: #include <gtk/gtk.h> typedef struct { GtkWidget *entry, *textview; } Widgets; static void insert_text (GtkButton*, Widgets*); int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *hbox, *vbox, *insert; Widgets *w = g_slice_new (Widgets); gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Text Iterators"); gtk_container_set_border_width (GTK_CONTAINER (window), 10); gtk_widget_set_size_request (window, -1, 200); w->textview = gtk_text_view_new (); w->entry = gtk_entry_new (); insert = gtk_button_new_with_label ("Insert Text"); g_signal_connect (G_OBJECT (insert), "clicked", G_CALLBACK (insert_text), (gpointer) w); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_container_add (GTK_CONTAINER (scrolled_win), w->textview); hbox = gtk_hbox_new (FALSE, 5); gtk_box_pack_start_defaults (GTK_BOX (hbox), w->entry); gtk_box_pack_start_defaults (GTK_BOX (hbox), insert); vbox = gtk_vbox_new (FALSE, 5); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0); gtk_container_add (GTK_CONTAINER (window), vbox); gtk_widget_show_all (window); gtk_main(); return 0; } /* Insert the text from the GtkEntry into the GtkTextView. */ static void insert_text (GtkButton *button, Widgets *w) { GtkTextBuffer *buffer; GtkTextMark *mark; GtkTextIter iter; const gchar *text; buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (w->textview)); text = gtk_entry_get_text (GTK_ENTRY (w->entry)); mark = gtk_text_buffer_get_insert (buffer); gtk_text_buffer_get_iter_at_mark (buffer, &iter, mark); gtk_text_buffer_insert (buffer, &iter, text, -1); } You can compile this command (assuming the file is named file.c): gcc file.c -o file `pkg-config --cflags --libs gtk+-2.0` Thanks everybody!

    Read the article

  • Auto-complete/suggestion popup menu in GtkTextView

    - by Tyler
    I'm trying to create a system that will allow me to respond to the current text and auto-complete/suggest what should come next. For example if the user starts to type "Batm" then the system would respond with a menu showing the full completed word "Batman". Think of an IDE like Eclipse or Visual Studio and you get the idea. I understand how to create a popup menu in Gtk+ but what I don't understand is the following: How do I grab the word that the user is currently typing from a GtkTextView (or SourceView) so that I can do a lookup and offer suggestions? How do I position the menu in such a way that it sits next to the current text item (like it would in an IDE)? If anyone could offer suggestions or even a link to a tutorial or example on how to do this correctly I would be forever grateful. As always thanks for you help! Programming language: C

    Read the article

  • How do I change the background colour of Leafpad?

    - by Lao Tzu
    All the information that google returns says to change ~/.gtkrc2.0-mine. Here is my .gtkrc-2.0: # -- THEME AUTO-WRITTEN BY gtk-theme-switch2 DO NOT EDIT include "/usr/share/themes/Dust/gtk-2.0/gtkrc" include "/home/mars/.gtkrc-2.0.mine" # -- THEME AUTO-WRITTEN BY gtk-theme-switch2 DO NOT EDIT Here is my .gtkrc-2.0.mine: style "default" { GtkTextView::cursor_color = "#ffffff" base[NORMAL] = "#111111" base[ACTIVE] = "#111181" base[SELECTED] = "#808080" text[NORMAL] = "#c0c0c0" text[ACTIVE] = "#c0c0c0" text[SELECTED] = "#111111" } class "GtkTextView" style "default" Still appears with a white background!

    Read the article

  • Problem with 'insert_at_cursor' attribute

    - by mivoligo
    I made something, so after clicking a button, some text should appear in the TextView. Part of my code: def on_button1_clicked(self, builer): self.writetest = self.builder.get_object("textview1") self.writetest.insert_at_cursor("something") Unfortunately, when I click the button I get: AttributeError: 'TextView' object has no attribute 'insert_at_cursor' According to GTK Documentation there is such attribute: http://developer.gnome.org/gtk3/stable/GtkTextView.html#GtkTextView-insert-at-cursor I have the same problem with Entry as well, if I change TextView to Entry. But if I use set_text instead of insert_at_cursor in my code, it works.

    Read the article

  • Painting on GtkScrolledWindow or GtkEventBox

    - by ptomato
    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 contents of the text view and not erased. In order to get rid of the artifacts I trigger a redraw after each scroll. This mostly works, but you can still see the prompt jumping up and down when you scroll quickly. Is there any way to prevent this? It would be nice if the prompt just "floated" on top of the text view. I tried enclosing the scrolled window in a GtkEventBox and painting the prompt on top of that, but that didn't work either; the scrollbars and text view always paint over the prompt, even when you set the event box's window to go in front of its children's windows. UPDATE If I connect the GtkEventBox's expose callback with g_signal_connect_after(), then it is called after the expose callbacks of the GtkScrolledWindow and GtkTextView. The text view still draws over the event box though. I think this is because the scrolling happens asynchronously. Anybody got any idea how I can prevent my drawing from being overwritten?

    Read the article

  • How do I run gtk demos?

    - by Runner
    They are located under: share\gtk-2.0\demo But none of them contains a main function, how can I make the following textscroll.c actually work: /* Text Widget/Automatic scrolling * * This example demonstrates how to use the gravity of * GtkTextMarks to keep a text view scrolled to the bottom * while appending text. */ #include <gtk/gtk.h> #include "demo-common.h" /* Scroll to the end of the buffer. */ static gboolean scroll_to_end (GtkTextView *textview) { GtkTextBuffer *buffer; GtkTextIter iter; GtkTextMark *mark; char *spaces; static int count; buffer = gtk_text_view_get_buffer (textview); /* Get "end" mark. It's located at the end of buffer because * of right gravity */ mark = gtk_text_buffer_get_mark (buffer, "end"); gtk_text_buffer_get_iter_at_mark (buffer, &iter, mark); /* and insert some text at its position, the iter will be * revalidated after insertion to point to the end of inserted text */ spaces = g_strnfill (count++, ' '); gtk_text_buffer_insert (buffer, &iter, "\n", -1); gtk_text_buffer_insert (buffer, &iter, spaces, -1); gtk_text_buffer_insert (buffer, &iter, "Scroll to end scroll to end scroll " "to end scroll to end ", -1); g_free (spaces); /* Now scroll the end mark onscreen. */ gtk_text_view_scroll_mark_onscreen (textview, mark); /* Emulate typewriter behavior, shift to the left if we * are far enough to the right. */ if (count > 150) count = 0; return TRUE; } /* Scroll to the bottom of the buffer. */ static gboolean scroll_to_bottom (GtkTextView *textview) { GtkTextBuffer *buffer; GtkTextIter iter; GtkTextMark *mark; char *spaces; static int count; buffer = gtk_text_view_get_buffer (textview); /* Get end iterator */ gtk_text_buffer_get_end_iter (buffer, &iter); /* and insert some text at it, the iter will be revalidated * after insertion to point to the end of inserted text */ spaces = g_strnfill (count++, ' '); gtk_text_buffer_insert (buffer, &iter, "\n", -1); gtk_text_buffer_insert (buffer, &iter, spaces, -1); gtk_text_buffer_insert (buffer, &iter, "Scroll to bottom scroll to bottom scroll " "to bottom scroll to bottom", -1); g_free (spaces); /* Move the iterator to the beginning of line, so we don't scroll * in horizontal direction */ gtk_text_iter_set_line_offset (&iter, 0); /* and place the mark at iter. the mark will stay there after we * insert some text at the end because it has right gravity. */ mark = gtk_text_buffer_get_mark (buffer, "scroll"); gtk_text_buffer_move_mark (buffer, mark, &iter); /* Scroll the mark onscreen. */ gtk_text_view_scroll_mark_onscreen (textview, mark); /* Shift text back if we got enough to the right. */ if (count > 40) count = 0; return TRUE; } static guint setup_scroll (GtkTextView *textview, gboolean to_end) { GtkTextBuffer *buffer; GtkTextIter iter; buffer = gtk_text_view_get_buffer (textview); gtk_text_buffer_get_end_iter (buffer, &iter); if (to_end) { /* If we want to scroll to the end, including horizontal scrolling, * then we just create a mark with right gravity at the end of the * buffer. It will stay at the end unless explicitely moved with * gtk_text_buffer_move_mark. */ gtk_text_buffer_create_mark (buffer, "end", &iter, FALSE); /* Add scrolling timeout. */ return g_timeout_add (50, (GSourceFunc) scroll_to_end, textview); } else { /* If we want to scroll to the bottom, but not scroll horizontally, * then an end mark won't do the job. Just create a mark so we can * use it with gtk_text_view_scroll_mark_onscreen, we'll position it * explicitely when needed. Use left gravity so the mark stays where * we put it after inserting new text. */ gtk_text_buffer_create_mark (buffer, "scroll", &iter, TRUE); /* Add scrolling timeout. */ return g_timeout_add (100, (GSourceFunc) scroll_to_bottom, textview); } } static void remove_timeout (GtkWidget *window, gpointer timeout) { g_source_remove (GPOINTER_TO_UINT (timeout)); } static void create_text_view (GtkWidget *hbox, gboolean to_end) { GtkWidget *swindow; GtkWidget *textview; guint timeout; swindow = gtk_scrolled_window_new (NULL, NULL); gtk_box_pack_start (GTK_BOX (hbox), swindow, TRUE, TRUE, 0); textview = gtk_text_view_new (); gtk_container_add (GTK_CONTAINER (swindow), textview); timeout = setup_scroll (GTK_TEXT_VIEW (textview), to_end); /* Remove the timeout in destroy handler, so we don't try to * scroll destroyed widget. */ g_signal_connect (textview, "destroy", G_CALLBACK (remove_timeout), GUINT_TO_POINTER (timeout)); } GtkWidget * do_textscroll (GtkWidget *do_widget) { static GtkWidget *window = NULL; if (!window) { GtkWidget *hbox; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_window_set_default_size (GTK_WINDOW (window), 600, 400); hbox = gtk_hbox_new (TRUE, 6); gtk_container_add (GTK_CONTAINER (window), hbox); create_text_view (hbox, TRUE); create_text_view (hbox, FALSE); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else gtk_widget_destroy (window); return window; }

    Read the article

  • What's the solution for this gtk warning?

    - by Runner
    GtkWidget *textview; ... textview = gtk_text_view_new (); ... buffer = gtk_text_view_get_buffer (textview); At the last line I pasted I got this warning: warning C4133: 'function' : incompatible types - from 'GtkWidget *' to 'GtkTextView *' How can I fix that?

    Read the article

  • What is wrong with my gtkrc file?

    - by PP
    I have written following gtkrc file from some other theme gtkrc file. This theme is normal theme with buttons using pixmap theme engine. I have also given background image to GtkEntry. Problem is that, When i use this theme my buttons doesn't show text one them and my entry box does not show cursor. Plus in engine "pixmap" tag I need to specify image name with it's path as I have already mentioned pixmap_path on the top of rc file but why I still need to specify the path in file = "xxx" # gtkrc file. pixmap_path "./backgrounds:./icons:./buttons:./emotions" gtk-button-images = 1 #Icon Sizes and color definitions gtk-icon-sizes = "gtk-small-toolbar=16,16:gtk-large-toolbar=24,24:gtk-button=16,16" gtk-toolbar-icon-size = GTK_ICON_SIZE_SMALL_TOOLBAR gtk_color_scheme = "fg_color:#000000\nbg_color:#848484\nbase_color:#000000\ntext_color:#000000\nselected_bg_color:#f39638\nselected_fg_color:#000000\ntooltip_bg_color:#634110\ntooltip_fg_color:#ffffff" style "theme-default" { xthickness = 10 ythickness = 10 GtkEntry::honors-transparent-bg-hint = 0 GtkMenuItem::arrow-spacing = 20 GtkMenuItem::horizontal-padding = 50 GtkMenuItem::toggle-spacing = 30 GtkOptionMenu::indicator-size = {11, 5} GtkOptionMenu::indicator-spacing = {6, 5, 4, 4} GtkTreeView::horizontal_separator = 5 GtkTreeView::odd_row_color = "#efefef" GtkTreeView::even_row_color = "#e3e3e3" GtkWidget::link-color = "#0062dc" # blue GtkWidget::visited-link-color = "#8c00dc" #purple GtkButton::default_border = { 0, 0, 0, 0 } GtkButton::child-displacement-x = 0 GtkButton::child-displacement-y = 1 GtkWidget::focus-padding = 0 GtkRange::trough-border = 0 GtkRange::slider-width = 19 GtkRange::stepper-size = 19 GtkScrollbar::min_slider_length = 36 GtkScrollbar::has-secondary-backward-stepper = 1 GtkPaned::handle_size = 8 GtkMenuBar::internal-padding = 0 GtkTreeView::expander_size = 13 #15 GtkExpander::expander_size = 13 #17 GtkScale::slider-length = 35 GtkScale::slider-width = 17 GtkScale::trough-border = 0 GtkWidget::link-color = "#0062dc" GtkWidget::visited-link-color = "#8c00dc" #purple WnckTasklist::fade-overlay-rect = 0 WnckTasklist::fade-loop-time = 5.0 # 5 seconds WnckTasklist::fade-opacity = 0.5 # final opacity #makes menu only overlap border GtkMenu::horizontal-offset = -1 #removes extra padding at top and bottom of menus. Makes menuitem overlap border GtkMenu::vertical-padding = 0 #set to the same as roundness, used for better hotspot selection of tabs GtkNotebook::tab-curvature = 2 GtkNotebook::tab-overlap = 4 GtkMenuItem::arrow-spacing = 10 GtkOptionMenu ::indicator-size = {11, 5} GtkCheckButton ::indicator-size = 16 GtkCheckButton ::indicator-spacing = 1 GtkRadioButton ::indicator-size = 16 GtkTreeView::horizontal_separator = 2 GtkTreeView::odd_row_color = "#efefef" GtkTreeView::even_row_color = "#e3e3e3" NautilusIconContainer::normal_icon_color = "#ff0000" GtkEntry::inner-border = {0, 0, 0, 0} GtkScrolledWindow::scrollbar-spacing = 0 GtkScrolledWindow::scrollbars-within-bevel = 1 fg[NORMAL] = @fg_color fg[ACTIVE] = @fg_color fg[PRELIGHT] = @fg_color fg[SELECTED] = @selected_fg_color fg[INSENSITIVE] = shade (3.0,@fg_color) bg[NORMAL] = @bg_color bg[ACTIVE] = shade (0.95,@bg_color) bg[PRELIGHT] = mix(0.92, shade (1.1,@bg_color), @selected_bg_color) bg[SELECTED] = @selected_bg_color bg[INSENSITIVE] = shade (1.06,@bg_color) base[NORMAL] = @base_color base[ACTIVE] = shade (0.65,@base_color) base[PRELIGHT] = @base_color base[SELECTED] = @selected_bg_color base[INSENSITIVE] = shade (1.025,@bg_color) text[NORMAL] = @text_color text[ACTIVE] = shade (0.95,@base_color) text[PRELIGHT] = @text_color text[SELECTED] = @selected_fg_color text[INSENSITIVE] = mix (0.675,shade (0.95,@bg_color),@fg_color) } style "theme-entry" { xthickness = 10 ythickness = 10 GtkEntry::inner-border = {10, 10, 10, 10} GtkEntry::progress-border = {10, 10, 10, 10} GtkEntry::icon-prelight = 1 GtkEntry::state-hintt = 1 #GtkEntry::honors-transparent-bg-hint = 1 text[NORMAL] = "#000000" text[ACTIVE] = "#787878" text[INSENSITIVE] = "#787878" text[SELECTED] = "#FFFFFF" engine "pixmap" { image { function = FLAT_BOX state = NORMAL recolorable = FALSE file = "./backgrounds/entry_background.png" border = { 0, 0, 0, 0 } stretch = TRUE } image { function = FLAT_BOX state = PRELIGHT recolorable = FALSE file = "./backgrounds/entry_background.png" border = { 0, 0, 0, 0 } stretch = TRUE } image { function = FLAT_BOX state = ACTIVE recolorable = FALSE file = "./backgrounds/entry_background.png" border = { 0, 0, 0, 0 } stretch = TRUE } } } #----------------------------------------------- #Chat Balloon Incoming background. style "theme-event-box-top-in" { xthickness = 1 ythickness = 1 GtkEventBox::inner-border = {0, 0, 0, 0} engine "pixmap" { image { function = FLAT_BOX state = NORMAL recolorable = TRUE file = "./backgrounds/chat_in_top.png" border = { 0, 0, 0, 0 } stretch = TRUE } } } style "theme-event-box-mid-in" { xthickness = 1 ythickness = 1 GtkEventBox::inner-border = {0, 0, 0, 0} engine "pixmap" { image { function = FLAT_BOX state = NORMAL recolorable = TRUE file = "./backgrounds/chat_in_mid.png" border = { 0, 0, 0, 0 } stretch = TRUE } } } style "theme-event-box-bot-in" { xthickness = 1 ythickness = 1 GtkEventBox::inner-border = {0, 0, 0, 0} engine "pixmap" { image { function = FLAT_BOX state = NORMAL recolorable = TRUE file = "./backgrounds/chat_in_bot.png" border = { 0, 0, 0, 0 } stretch = TRUE } } } #----------------------------------------------- #Chat Balloon Outgoing background. style "theme-event-box-top-out" { xthickness = 1 ythickness = 1 GtkEventBox::inner-border = {0, 0, 0, 0} engine "pixmap" { image { function = FLAT_BOX state = NORMAL recolorable = TRUE file = "./backgrounds/chat_out_top.png" border = { 0, 0, 0, 0 } stretch = TRUE } } } style "theme-event-box-mid-out" { xthickness = 1 ythickness = 1 GtkEventBox::inner-border = {0, 0, 0, 0} engine "pixmap" { image { function = FLAT_BOX state = NORMAL recolorable = TRUE file = "./backgrounds/chat_out_mid.png" border = { 0, 0, 0, 0 } stretch = TRUE } } } style "theme-event-box-bot-out" { xthickness = 1 ythickness = 1 GtkEventBox::inner-border = {0, 0, 0, 0} engine "pixmap" { image { function = FLAT_BOX state = NORMAL recolorable = TRUE file = "./backgrounds/chat_out_bot.png" border = { 0, 0, 0, 0 } stretch = TRUE } } } style "theme-wide" = "theme-default" { xthickness = 2 ythickness = 2 } style "theme-wider" = "theme-default" { xthickness = 3 ythickness = 3 } style "theme-button" { GtkButton::inner-border = {0, 0, 0, 0} GtkWidget::focus-line-width = 0 GtkWidget::focus-padding = 0 bg[NORMAL] = "#414143" bg[ACTIVE] = "#c19676" bg[PRELIGHT] = "#7f4426" bg[SELECTED] = "#ff0000" bg[INSENSITIVE] = "#434346" fg[NORMAL] = "#ffffff" fg[INSENSITIVE] = "#000000" fg[PRELIGHT] = "#ffffff" fg[SELECTED] = "#ffffff" fg[ACTIVE] = "#ffffff" text[NORMAL] = "#ff0000" text[INSENSITIVE] = "#ff0000" text[PRELIGHT] = "#ff0000" text[SELECTED] = "#ff0000" text[INSENSITIVE] = "#434346" text[ACTIVE] = "#ff0000" base[NORMAL] = "#ff0000" base[INSENSITIVE] = "#ff0000" base[PRELIGHT] = "#ff0000" base[SELECTED] = "#ff0000" base[INSENSITIVE] = "#ff0000" engine "pixmap" { image { function = BOX state = NORMAL recolorable = TRUE file = "./buttons/LightButtonAct.png" border = { 0, 0, 0, 0 } stretch = TRUE } image { function = BOX state = PRELIGHT recolorable = TRUE file = "./buttons/LightButtonRoll.png" border = { 0, 0, 0, 0 } stretch = TRUE } image { function = BOX state = ACTIVE recolorable = TRUE file = "./buttons/LightButtonClicked.png" border = { 0, 0, 0, 0 } stretch = TRUE } image { function = BOX state = INSENSITIVE recolorable = TRUE file = "./buttons/LightButtonInact.png" border = { 0, 0, 0, 0 } stretch = TRUE } } } style "theme-toolbar" { xthickness = 2 ythickness = 2 bg[NORMAL] = shade (1.078,@bg_color) } style "theme-handlebox" { bg[NORMAL] = shade (0.95,@bg_color) } style "theme-scale" { bg[NORMAL] = shade (1.06, @bg_color) bg[PRELIGHT] = mix(0.85, shade (1.1,@bg_color), @selected_bg_color) bg[SELECTED] = "#4d4d55" } style "theme-range" { bg[NORMAL] = shade (1.12,@bg_color) bg[ACTIVE] = @bg_color bg[PRELIGHT] = mix(0.95, shade (1.10,@bg_color), @selected_bg_color) #Arrows text[NORMAL] = shade (0.275,@selected_fg_color) text[PRELIGHT] = @selected_fg_color text[ACTIVE] = shade (0.10,@selected_fg_color) text[INSENSITIVE] = mix (0.80,shade (0.90,@bg_color),@fg_color) } style "theme-notebook" = "theme-wider" { xthickness = 4 ythickness = 4 GtkNotebook::tab-curvature = 5 GtkNotebook::tab-vborder = 1 GtkNotebook::tab-overlap = 1 GtkNotebook::tab-vborder = 1 bg[NORMAL] = "#d2d2d2" bg[ACTIVE] = "#e3e3e3" bg[PRELIGHT] = "#848484" bg[SELECTED] = "#848484" bg[INSENSITIVE] = "#848484" text[PRELIGHT] = @selected_fg_color text[NORMAL] = "#000000" text[ACTIVE] = "#737373" text[SELECTED] = "#000000" text[INSENSITIVE] = "#737373" fg[PRELIGHT] = @selected_fg_color fg[NORMAL] = "#000000" fg[ACTIVE] = "#737373" fg[SELECTED] = "#000000" fg[INSENSITIVE] = "#737373" } style "theme-paned" { bg[PRELIGHT] = shade (1.1,@bg_color) } style "theme-panel" { # Menu fg[PRELIGHT] = @selected_fg_color font_name = "Bold 9" text[PRELIGHT] = @selected_fg_color } style "theme-menu" { xthickness = 0 ythickness = 0 bg[NORMAL] = shade (1.16,@bg_color) bg[SELECTED] = "#ff9a00" text[PRELIGHT] = @selected_fg_color fg[PRELIGHT] = @selected_fg_color } style "theme-menu-item" = "theme-menu" { xthickness = 3 ythickness = 3 base[SELECTED] = "#ff9a00" base[NORMAL] = "#ff9a00" base[PRELIGHT] = "#ff9a00" base[INSENSITIVE] = "#ff9a00" base[ACTIVE] = "#ff9a00" bg[SELECTED] = "#ff9a00" bg[NORMAL] = shade (1.16,@bg_color) } style "theme-menubar" { #TODO } style "theme-menubar-item" = "theme-menu-item" { #TODO bg[SELECTED] = "#ff9a00" } style "theme-tree" { xthickness = 2 ythickness = 1 font_name = "Bold 9" GtkWidget::focus-padding = 0 bg[NORMAL] = "#5a595a" bg[PRELIGHT] = "#5a595a" bg[ACTIVE] = "#5a5a5a" fg[NORMAL] = "#ffffff" fg[ACTIVE] = "#ffffff" fg[SELECTED] = "#ff9a00" fg[PRELIGHT] = "#ffffff" bg[SELECTED] = "#ff9a00" base[SELECTED] = "#ff9a00" base[NORMAL] = "#ff9a00" base[PRELIGHT] = "#ff9a00" base[INSENSITIVE] = "#ff9a00" base[ACTIVE] = "#ff9a00" text[NORMAL] = "#000000" text[PRELIGHT] = "#ff9a00" text[ACTIVE] = "#ff9a00" text[SELECTED] = "#ff9a00" text[INSENSITIVE] = "#434346" } style "theme-tree-arrow" { bg[NORMAL] = mix(0.70, shade (0.60,@bg_color), shade (0.80,@selected_bg_color)) bg[PRELIGHT] = mix(0.80, @bg_color, @selected_bg_color) } style "theme-progressbar" { font_name = "Bold" bg[SELECTED] = @selected_bg_color fg[PRELIGHT] = @selected_fg_color bg[ACTIVE] = "#fe7e00" bg[NORMAL] = "#ffba00" } style "theme-tooltips" = "theme-wider" { font_name = "Liberation sans 10" bg[NORMAL] = @tooltip_bg_color fg[NORMAL] = @tooltip_fg_color text[NORMAL] = @tooltip_fg_color } style "theme-combo" = "theme-button" { xthickness = 4 ythickness = 4 text[NORMAL] = "#fd7d00" text[INSENSITIVE] = "#8a8a8a" base[NORMAL] = "#e0e0e0" base[INSENSITIVE] = "#aeaeae" } style "theme-combo-box" = "theme-button" { xthickness = 3 ythickness = 2 bg[NORMAL] = "#343539" bg[PRELIGHT] = "#343539" bg[ACTIVE] = "#26272b" bg[INSENSITIVE] = "#404145" } style "theme-entry-combo-box" { xthickness = 6 ythickness = 3 text[NORMAL] = "#000000" text[INSENSITIVE] = "#8a8a8a" base[NORMAL] = "#ffffff" base[INSENSITIVE] = "#aeaeae" } style "theme-combo-arrow" = "theme-button" { xthickness = 1 ythickness = 1 } style "theme-view" { xthickness = 0 ythickness = 0 } style "theme-check-radio-buttons" { GtkWidget::interior-focus = 0 GtkWidget::focus-padding = 1 text[NORMAL] = "#ff0000" base[NORMAL] = "#ff0000" text[SELECTED] = "#ffffff" text[INSENSITIVE] = shade (0.625,@bg_color) base[PRELIGHT] = mix(0.80, @base_color, @selected_bg_color) bg[NORMAL] = "#438FC6" bg[INSENSITIVE] = "#aeaeae" bg[SELECTED] = "#ff8a01" } style "theme-radio-buttons" = "theme-button" { GtkWidget::interior-focus = 0 GtkWidget::focus-padding = 1 text[SELECTED] = @selected_fg_color text[INSENSITIVE] = shade (0.625,@bg_color) base[PRELIGHT] = mix(0.80, @base_color, @selected_bg_color) bg[NORMAL] = "#ffffff" bg[INSENSITIVE] = "#dcdcdc" bg[SELECTED] = @selected_bg_color } style "theme-spin-button" { bg[NORMAL] = "#d2d2d2" bg[ACTIVE] = "#868686" bg[PRELIGHT] = "#7f4426" bg[SELECTED] = shade(1.10,@selected_bg_color) bg[INSENSITIVE] = "#dcdcdc" base[NORMAL] = "#ffffff" base[INSENSITIVE] = "#dcdcdc" text[NORMAL] = "#000000" text[INSENSITIVE] = "#aeaeae" } style "theme-calendar" { xthickness = 0 ythickness = 0 bg[NORMAL] = "#676767" bg[PRELIGHT] = shade(0.92,@bg_color) bg[ACTIVE] = "#ff0000" bg[INSENSITIVE] = "#ff0000" bg[SELECTED] = "#ff0000" text[PRELIGHT] = "#000000" text[NORMAL] = "#000000" text[INSENSITIVE]= "#000000" text[SELECTED] = "#ffffff" text[ACTIVE] = "#000000" fg[NORMAL] = "#ffffff" fg[PRELIGHT] = "#ffffff" fg[INSENSITIVE] = "#ffffff" fg[SELECTED] = "#ffffff" fg[ACTIVE] = "#ffffff" base[NORMAL] = "#ff0000" base[NORMAL] = "#aeaeae" base[INSENSITIVE] = "#00ff00" base[SELECTED] = "#f3720d" base[ACTIVE] = "#f3720d" } style "theme-separator-menu-item" { xthickness = 1 ythickness = 0 GtkSeparatorMenuItem::horizontal-padding = 2 # We are setting the desired height by using wide-separators # There is no other way to get the odd height ... GtkWidget::wide-separators = 1 GtkWidget::separator-width = 1 GtkWidget::separator-height = 5 } style "theme-frame" { xthickness = 10 ythickness = 0 GtkWidget::LABEL-SIDE-PAD = 14 GtkWidget::LABEL-PAD = 23 fg[NORMAL] = "#000000" fg[ACTIVE] = "#000000" fg[PRELIGHT] = "#000000" fg[SELECTED] = "#000000" fg[INSENSITIVE] = "#000000" bg[NORMAL] = "#e2e2e2" bg[ACTIVE] = "#000000" bg[PRELIGHT] = "#000000" bg[SELECTED] = "#000000" bg[INSENSITIVE] = "#000000" base[NORMAL] = "#000000" base[ACTIVE] = "#000000" base[PRELIGHT] = "#000000" base[SELECTED] = "#000000" base[INSENSITIVE]= "#000000" text[NORMAL] = "#000000" text[ACTIVE] = "#000000" text[PRELIGHT] = "#000000" text[SELECTED] = "#000000" text[INSENSITIVE]= "#000000" } style "theme-textview" { text[NORMAL] = "#000000" text[ACTIVE] = "#000000" text[PRELIGHT] = "#000000" text[SELECTED] = "#000000" text[INSENSITIVE] = "#434648" bg[NORMAL] = "#ffffff" bg[ACTIVE] = "#ffffff" bg[PRELIGHT] = "#ffffff" bg[SELECTED] = "#ffffff" bg[INSENSITIVE] = "#ffffff" fg[NORMAL] = "#ffffff" fg[ACTIVE] = "#ffffff" fg[PRELIGHT] = "#ffffff" fg[SELECTED] = "#ffffff" fg[INSENSITIVE] = "#ffffff" base[NORMAL] = "#ffffff" base[ACTIVE] = "#ffffff" base[PRELIGHT] = "#ffffff" base[SELECTED] = "#ff9a00" base[INSENSITIVE] = "#ffffff" } style "theme-clist" { text[NORMAL] = "#000000" text[ACTIVE] = "#000000" text[PRELIGHT] = "#000000" text[SELECTED] = "#000000" text[INSENSITIVE] = "#434648" bg[NORMAL] = "#353438" bg[ACTIVE] = "#ff9a00" bg[PRELIGHT] = "#ff9a00" bg[SELECTED] = "#ff9a00" bg[INSENSITIVE] = "#ffffff" fg[NORMAL] = "#000000" fg[ACTIVE] = "#ff9a00" fg[PRELIGHT] = "#ff9a00" fg[SELECTED] = "#fdff00" fg[INSENSITIVE] = "#757575" base[NORMAL] = "#ffffff" base[ACTIVE] = "#fdff00" base[PRELIGHT] = "#000000" base[SELECTED] = "#fdff00" base[INSENSITIVE] = "#757575" } style "theme-label" { bg[NORMAL] = "#414143" bg[ACTIVE] = "#c19676" bg[PRELIGHT] = "#7f4426" bg[SELECTED] = "#000000" bg[INSENSITIVE] = "#434346" fg[NORMAL] = "#000000" fg[INSENSITIVE] = "#434346" fg[PRELIGHT] = "#000000" fg[SELECTED] = "#000000" fg[ACTIVE] = "#000000" text[NORMAL] = "#ffffff" text[INSENSITIVE] = "#434346" text[PRELIGHT] = "#ffffff" text[SELECTED] = "#ffffff" text[ACTIVE] = "#ffffff" base[NORMAL] = "#000000" base[INSENSITIVE] = "#00ff00" base[PRELIGHT] = "#0000ff" base[ACTIVE] = "#f39638" } style "theme-button-label" { bg[NORMAL] = "#414143" bg[ACTIVE] = "#c19676" bg[PRELIGHT] = "#7f4426" bg[SELECTED] = "#000000" bg[INSENSITIVE] = "#434346" fg[NORMAL] = "#ffffff" fg[INSENSITIVE] = "#434346" fg[PRELIGHT] = "#ffffff" fg[SELECTED] = "#ffffff" fg[ACTIVE] = "#ffffff" text[NORMAL] = "#000000" text[INSENSITIVE] = "#434346" text[PRELIGHT] = "#000000" text[SELECTED] = "#000000" text[ACTIVE] = "#000000" base[NORMAL] = "#000000" base[INSENSITIVE] = "#00ff00" base[PRELIGHT] = "#0000ff" base[SELECTED] = "#ff00ff" base[ACTIVE] = "#ffff00" } style "theme-button-check-radio-label" { bg[NORMAL] = "#414143" bg[ACTIVE] = "#c19676" bg[PRELIGHT] = "#7f4426" bg[SELECTED] = "#000000" bg[INSENSITIVE] = "#434346" fg[NORMAL] = "#000000" fg[INSENSITIVE] = "#434346" fg[PRELIGHT] = "#000000" fg[SELECTED] = "#000000" fg[ACTIVE] = "#000000" text[NORMAL] = "#ffffff" text[INSENSITIVE] = "#434346" text[PRELIGHT] = "#ffffff" text[SELECTED] = "#000000" text[ACTIVE] = "#ffffff" base[NORMAL] = "#000000" base[INSENSITIVE] = "#00ff00" base[PRELIGHT] = "#0000ff" base[SELECTED] = "#ff00ff" base[ACTIVE] = "#ffff00" } style "theme-table" { bg[NORMAL] = "#848484" bg[ACTIVE] = "#c19676" bg[PRELIGHT] = "#7f4426" bg[SELECTED] = "#000000" bg[INSENSITIVE] = "#434346" } style "theme-iconview" { GtkWidget::focus-line-width=1 bg[NORMAL] = "#000000" bg[ACTIVE] = "#c19676" bg[PRELIGHT] = "#c19676" bg[SELECTED] = "#c19676" bg[INSENSITIVE] = "#969696" fg[NORMAL] = "#ffffff" fg[INSENSITIVE] = "#ffffff" fg[PRELIGHT] = "#ffffff" fg[SELECTED] = "#ffffff" fg[ACTIVE] = "#ffffff" text[NORMAL] = "#000000" text[INSENSITIVE] = "#434346" text[PRELIGHT] = "#000000" text[SELECTED] = "#000000" text[ACTIVE] = "#000000" base[NORMAL] = "#ffffff" base[INSENSITIVE] = "#434346" base[PRELIGHT] = "#FAD184" base[SELECTED] = "#FAD184" base[ACTIVE] = "#FAD184" } # Set Widget styles class "GtkWidget" style "theme-default" class "GtkScale" style "theme-scale" class "GtkRange" style "theme-range" class "GtkPaned" style "theme-paned" class "GtkFrame" style "theme-frame" class "GtkMenu" style "theme-menu" class "GtkMenuBar" style "theme-menubar" class "GtkEntry" style "theme-entry" class "GtkProgressBar" style "theme-progressbar" class "GtkToolbar" style "theme-toolbar" class "GtkSeparator" style "theme-wide" class "GtkCalendar" style "theme-calendar" class "GtkTable" style "theme-table" widget_class "*<GtkMenuItem>*" style "theme-menu-item" widget_class "*<GtkMenuBar>.<GtkMenuItem>*" style "theme-menubar-item" widget_class "*<GtkSeparatorMenuItem>*" style "theme-separator-menu-item" widget_class "*<GtkLabel>" style "theme-label" widget_class "*<GtkButton>" style "theme-button" widget_class "*<GtkButton>*<GtkLabel>*" style "theme-button-label" widget_class "*<GtkCheckButton>" style "theme-check-radio-buttons" widget_class "*<GtkToggleButton>.<GtkLabel>*" style "theme-button" widget_class "*<GtkCheckButton>.<GtkLabel>*" style "theme-button-check-radio-label" widget_class "*<GtkRadioButton>.<GtkLabel>*" style "theme-button-check-radio-label" widget_class "*<GtkTextView>" style "theme-textview" widget_class "*<GtkList>" style "theme-textview" widget_class "*<GtkCList>" style "theme-clist" widget_class "*<GtkIconView>" style "theme-iconview" widget_class "*<GtkHandleBox>" style "theme-handlebox" widget_class "*<GtkNotebook>" style "theme-notebook" widget_class "*<GtkNotebook>*<GtkEventBox>" style "theme-notebook" widget_class "*<GtkNotebook>*<GtkDrawingArea>" style "theme-notebook" widget_class "*<GtkNotebook>*<GtkLayout>" style "theme-notebook" widget_class "*<GtkNotebook>*<GtkViewport>" style "theme-notebook" widget_class "*<GtkNotebook>.<GtkLabel>*" style "theme-notebook" #for tabs # Combo Box Stuff widget_class "*<GtkCombo>*" style "theme-combo" widget_class "*<GtkComboBox>*<GtkButton>" style "theme-combo-box" widget_class "*<GtkComboBoxEntry>*" style "theme-entry-combo-box" widget_class "*<GtkSpinButton>*" style "theme-spin-button" widget_class "*<GtkSpinButton>*<GtkArrow>*" style:highest "theme-tree-arrow" # Tool Tips Stuff widget "gtk-tooltip*" style "theme-tooltips" # Tree View Stuff widget_class "*<GtkTreeView>.<GtkButton>*" style "theme-tree" widget_class "*<GtkCTree>.<GtkButton>*" style "theme-tree" widget_class "*<GtkList>.<GtkButton>*" style "theme-tree" widget_class "*<GtkCList>.<GtkButton>*" style "theme-tree" # For arrow bg widget_class "*<GtkTreeView>.<GtkButton>*<GtkArrow>" style "theme-tree-arrow" widget_class "*<GtkCTree>.<GtkButton>*<GtkArrow>" style "theme-tree-arrow" widget_class "*<GtkList>.<GtkButton>*<GtkArrow>" style "theme-tree-arrow" ####################################################### ## GNOME specific ####################################################### widget_class "*.ETree.ECanvas" style "theme-tree" widget_class "*.ETable.ECanvas" style "theme-tree" style "panelbuttons" = "theme-button" { # As buttons are draw lower this helps center text xthickness = 3 ythickness = 3 } widget_class "*Panel*<GtkButton>*" style "panelbuttons" style "murrine-fg-is-text-color-workaround" { text[NORMAL] = "#000000" text[ACTIVE] = "#fdff00" text[SELECTED] = "#fdff00" text[INSENSITIVE] = "#757575" bg[SELECTED] = "#b85e03" bg[ACTIVE] = "#b85e03" bg[SELECTED] = "#b85e03" fg[SELECTED] = "#ffffff" fg[NORMAL] = "#ffffff" fg[ACTIVE] = "#ffffff" fg[INSENSITIVE] = "#434348" fg[PRELIGHT] = "#ffffff" base[SELECTED] = "#ff9a00" base[NORMAL] = "#ffffff" base[ACTIVE] = "#ff9a00" base[INSENSITIVE] = "#434348" base[PRELIGHT] = "#ffffff" } widget_class "*.<GtkTreeView>*" style "murrine-fg-is-text-color-workaround" style "murrine-combobox-text-color-workaround" { text[NORMAL] = "#FFFFF" text[PRELIGHT] = "#FFFFF" text[SELECTED] = "#FFFFF" text[ACTIVE] = "#FFFFF" text[INSENSITIVE] = "#FFFFF" } widget_class "*.<GtkComboBox>.<GtkCellView>" style "murrine-combobox-text-color-workaround" style "murrine-menuitem-text-is-fg-color-workaround" { bg[NORMAL] = "#0000ff" text[NORMAL] = "#ffffff" text[PRELIGHT] = "#ffffff"#"#FD7D00" text[SELECTED] = "#ffffff"#"#ff0000"# @selected_fg_color text[ACTIVE] = "#ffffff"#"#ff0000"# "#FD7D00" text[INSENSITIVE] = "#ffffff"#ff0000"# "#414143" } widget "*.gtk-combobox-popup-menu.*" style "murrine-menuitem-text-is-fg-color-workaround"

    Read the article

1