GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Sep 01, 2016 3:38 am

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: grab focus on widget
PostPosted: Mon Sep 02, 2013 9:45 am 
Familiar Face

Joined: Thu Nov 22, 2012 3:46 pm
Posts: 29
0 down vote favorite

In my app I have preferences dialog (modal to main) where can insert value in GTK_LIST_STORE[GTK_TREE_VIEW].

This entry are send to GTK_COMBO_BOX_TEXT as menu select.

When press button to open preferences dialog to edit values, I want automaticaly GTK_TREE_VIEW scroll to cell reference selected in main.


|   YELLOW   |

preferences dialog ( GTK_TREE_VIEW )

|   BLUE     | 10 |
|   YELLOW   | 50 |
|   RED      | 60 |

For example:

If in main window I select YELLOW when open preferences dialog, grab focus widget in YELLOW row


when add new entry I use:

pst = malloc(sizeof(preset));
pst->name = g_strdup(_("unnamed"));
pst->value = rint(gtk_adjustment_get_value(adj)) / STEPS;
settings.presets = g_list_append(settings.presets, (gpointer) pst);
buffer = g_strdup_printf("%.2f", pst->value);

gtk_list_store_append(list_store, &iter);
gtk_list_store_set(GTK_LIST_STORE(list_store), &iter, 0, pst->name, 1, buffer, -1);


v_scb = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(list_view));
gtk_adjustment_set_value(v_scb, gtk_adjustment_get_upper(v_scb));

gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(preset_combo), pst->name);

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: Google [Bot], Google Adsense [Bot], Yahoo [Bot] and 3 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group