Re: Using Glib::KeyFile

2008-12-12 Thread Tadej Borovšak
Hi.

GKeyFile does not automatically updates file on a disk. When you open
your file with load_from_file method, file is parsed and stored in
memory as a structure. And when you edit you key file, you are
actually editing your memory copy of it. To write changes to your
file, you need to dump your memory file into string with to_data
method and then save the resulting ustring to file.


2008/12/12 Ravee Kondrakunta ravee_kondraku...@phoenix.com:
 Hi,

 I was trying to use Glib::KeyFile to parse and also to edit it.

 I was able to parse the file and read information from it, but I was not able 
 to set it using that. Its not updating my config file. I crossed the 
 permissions given on the file too.

 Here is the piece of the code for reference.

 Glib::KeyFile key;

 try
 {
 key.load_from_file(/home/localuser/RnD/DateTime/datetime.config);
 }
 catch(Glib::KeyFileError ex)
 {
 std::cout  ex.what()  std::endl;
 }
 key.set_comment(PREFERENCES, DateTimeApp Settings);

 I tried using set_string, set_integer to set the the new value for a key. But 
 nothing worked out.

 -Ravee
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




-- 
Tadej Borovšak
00386 (0)40 613 131
tadeb...@gmail.com
tadej.borov...@gmail.com
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

答复: directfb-users Digest, Vol 46, Issue 10

2008-12-12 Thread zhenghe zhang
Hi all 
Could you tell me how to configure the environment of gtk-dfb ?
I want to run gtk-demo on the gtk-dfb .
Thanks 

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


gtk_tree_view_scroll_to_cell does not work ?

2008-12-12 Thread Miroslav Rajcic
I am having a method that selects an tree view item and ensures that the 
item is visible.

To ensure the visiblity, I am using the gtk_tree_view_scroll_to_cell method.

I've noticed that this method does not seem to work always. When the tree 
view is populated so much that it needs to be scrolled in order to make cell 
visible, gtk_tree_view_scroll_to_cell will frequently fail to do so!


If someone is interested to test this, you can do with my Notecase project 
(http://notecase.sf.net)


Steps to reproduce:
1. Start notecase and load the help.ncd document
2. Use Tree/Expand All menu item to make sure that the tree view takes 
more space than available (scroll bar appears)

3. Select last item in the tree view
4. Now press Insert key to insert the new node after the selected note

Note that the step 4 should cause the new note to be visible within the tree 
view, but it is not often the case and the tree view is not scrolled to show 
the new note.


Sometimes, 1st try seems to work correctly, but any other subsequent try 
(adding more and more notes with Ins key press) does not work!

Mostly it doesn't work right from the start.

You can find the example code within the Notecase code at callbacks.cpp.
void on_menu_insert_node - method that inserts new node
void SelectNodeByIdx - method that performs actual selection and scrolling

Note that I've tried replacing the gtk_tree_view_scroll_to_cell with the 
following code, but that doesn't work too:

  GdkRectangle rect;
  gtk_tree_view_get_cell_area(treeview, path2, NULL, rect);
  gtk_tree_view_scroll_to_point(treeview, -1, rect.y);

I've tested and can confirm this behaviour both on Linux (Ubuntu 8.10 i386) 
and Windows (latest GTK 2.14.5 from www.gtk.org).


Does anyone have any constructive tip or workaround ?
Can anyone confirm the problem ?

This seems like a major problem to me, because GtkTreeView is one of the 
basic components.


TIA,
 Miroslav Rajcic

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Building custom gtk+ lib then program doesn't follow system's default theme.

2008-12-12 Thread Tristan Van Berkom
On Thu, Dec 11, 2008 at 12:07 AM, Keedi Kim ke...@perl.kr wrote:
 Hi guys,

 I just built gtk+-2.14.5 since 2.14.4 in Ubuntu 8.10 has a
 GtkCellRenderCombo bug
 (http://bugzilla.gnome.org/show_bug.cgi?id=558323)

 Anyway I got brand-new stable release of gtk+.
 and build my program again to linking new gtk+

 Then I run my program, programs looks far more different from another
 programs.
 How could my program follows system's default theme?
 Is there a general way to achieve this?

On ubuntu, to test, I do cp /usr/share/themes/Human/gtk-2.0/gtkrc
/opt/share/themes/Default/gtk-2.0-key/

its probably not right - you have to have gtk installed and then the system
them installed, the way the dist does it, on top.

Cheers,
   -Tristan
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Drag Drop Icon/Tooltip settings?

2008-12-12 Thread Gorshkov
I've implimented DD from a TreeView/ListStore in one app window, to a 
TreeView/TreeStore in another app window.


The DD works properly - that's not the problem.

The problem is that the tooltip (that's what it looks like, anyway) 
that appears under the cursor when dragging is a verbatim copy of 
whatever TreeView row happened to be under the cursor when I start the 
drag, regardless of how many rows are being dragged.


How do I change that tooltip?

I've tried using the gtk_drag_set_icon calls from a drag_begin 
signal callback, but all that results in is having a brief flash, and 
then only a normal cursor, with no 'tooltip' whatsoever, when I start to 
drag.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list