Re: Changing GTK+ theme colors

2013-02-14 Thread Tomasz Jankowski
-radius: 10px;
 border-width: 1px;
 }

 .scrollbar.slider.horizontal:hover,
 .scrollbar.slider.horizontal:hover:active {
 background-image: -gtk-gradient (linear, left top, left bottom,
 from (shade (@bg_color, 0.85)),
 to (shade (@bg_color, 0.7)));
 border-color: shade (@bg_color, 0.6);
 }

 .scrollbar.slider:insensitive {
 background-color: shade (@bg_color, 0.9);
 }

 .scrollbar.trough:insensitive {
 background-color: shade (@bg_color, 1.06);
 }

 /* Fixes a bug in Opera */
 .scrollbar.button {
 background-image: -gtk-gradient (linear, left top, left bottom,
 from (transparent),
 to (transparent));
 background-color: transparent;
 }

 /* overlay scrollbar */
 OsThumb {
 color: shade (@fg_color, 1.6);
 }

 OsThumb:selected,
 OsScrollbar:selected {
 background-color: @selected_bg_color;
 }

 OsThumb:active,
 OsScrollbar:active {
 background-color: shade (@bg_color, 0.6);
 }

 OsThumb:insensitive,
 OsScrollbar:insensitive {
 background-color: shade (@bg_color, 0.85);
 }

 /***
  * scrolled window *
  ***/
 .ubuntu-online-accounts.frame,
 GtkScrolledWindow.frame {
 border-top-color: shade (@bg_color, 0.84);
 border-right-color: shade (@bg_color, 0.76);
 border-bottom-color: shade (@bg_color, 0.86);
 border-left-color: shade (@bg_color, 0.76);
 border-radius: 0;
 border-style: solid;
 }

 .ubuntu-online-accounts.frame {
 border-top-width: 0;
 }



 

 a  tutorial   for  Css  in Gtk  3.4



 http://www.gtkforums.com/viewtopic.php?f=3t=988start=15








 2013/2/13 Tomasz Jankowski tomc...@gmail.com

 Hello,

 How can I change color of focus line (e.g. displayed around GtkHScale
 when it's selected)?

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


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


Changing GTK+ theme colors

2013-02-13 Thread Tomasz Jankowski
Hello,

How can I change color of focus line (e.g. displayed around GtkHScale
when it's selected)?

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


Change background color in GtkTreeView

2012-11-29 Thread Tomasz Jankowski
Hello,

I'm working on UI for embedded system using GTK+ 2.24. I want to
change GtkTreeView background (area behind rows, which is by default white)
to match default color of window area (grey by default).
I retrieved GtkStyle associated with GtkWindow and looked for this
particular tint of gray color in GdkColor arrays in GtkStyle instance
(gb, fg, base arrays). Then I assigned these colors to GtkTreeView
using gtk_wdget_modify_base(), but I was unable to find the same color. Any
idea?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


g_type_init (), GMainLoop and fork ()

2011-07-14 Thread Tomasz Jankowski
Hello!

I'm working on linux program, which works as background (daemon)
or foreground (regular) application. I would like to know if it's safe to
call g_type_init () and create instance of GMainLoop before fork (), so that
child process can properly use GObject system type and
run previously created GMainLoop loop?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Equivalent number values for Pango markup's font sizes

2011-03-05 Thread Tomasz Jankowski
Hello!

I want to change font size for text cell renderer objects in my tree view.
One way is to set strings via markup property, but it's inconvenient. What
are number equivalents of Pango markup sizes like small, large,
x-large? I want to avoid using nonstandard font sizes in my application.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Question about GtkCellAreaBox

2010-12-27 Thread Tomasz Jankowski
Hello!

So far (GTK+ 2.91.7) we can easily pack renderers vertically or horizontally
in single GtkTreeViewColumn using GtkCellAreaBox. I want to achieve mixed
structure of renderers, something like this (this is single row model):

-
||   B  |
|   A   |---|
||   C  |
-

were A, B and C are some cell renderers.

I can implement my own class based on GtkCellRenderer to do this, but maybe
you (I mean GTK+ team) are going to implement something like
GtkCellAreaTable or make it possible to pack GtkCellAreaBox inside other
GtkCellAreaBox object?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


New to GSettings

2010-11-26 Thread Tomasz Jankowski
Hello!

I'd like to take advantage of GSettings in my application, but I have some
questions about it. Ther's a tutorial based on gnome-utils, but it doesn't
explain everything.

   1. What's the purpose of 'path' attribute? When browsing Baobab's source
   code I saw, that it set 'path' with '/apps/baobab/', so it's not a file
   system path, but some abstract representation of settings hierarchy, right?
   Are there some common categories of paths: 'apps', 'system', 'desktop' or
   other?
   2. When using GSettings I need to install my schemas somewhere. In
   Baobab's configure.ac they use pkg-config to obtain path: pkg-config
   --variable gsettingsschemadir gio-2.0 . The problem is, that on my Ubuuntu
   (glib v2.26.x) there's no such variable...
   3. What happens with settings stored using GSettings API, when user will
   remove my application from system? Will they stay in backend's settings
   database or after removing schema from schemas directory backend will remove
   settings related to it from it's storage?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Developing application with well-known service name using GDBus

2010-11-26 Thread Tomasz Jankowski
Hello!

I 'm working on daemon application, which use GDBus. Because my program is a
daemon, external appliactions should be able to start it by calling

org.freedesktop.DBus.StartServiceByName'

D-Bus method.

To do this I have to provide '*.service' file, which tells D-Bus session bus
how to run my program. How to obtain destination folder for this file? When
using low-level dbus-1 libbrary it's simple, because dbus-1 provides
'session_bus_services_dir' variable via pkg-config. However because GDBus is
standalone implementation, how can I retrieve path to this folder? i don't
want to depend my program on dbus-1 only because one variable required by
Autotools...
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Question about GSettings and dconf in KDE

2010-10-05 Thread Tomasz Jankowski
Hello!

New GNOME will use dconf as preferences manager and it will provide dconf's
backend for GSettings. What about KDE? Is there or will be there any
GSettings backend for KDE's preferences manager? I want to avoid situation,
when user in KDE session have to run dconf daemon to handle preferences in
my application, which will use GSettings. Or maybe I misunderstand
something...
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


How to destroy GFile objects?

2010-06-13 Thread Tomasz Jankowski
Hello!

What should I do with GFile objects (GFile *) ? What are they, regular
GObject objects which I can destroy using g_object_unref() or maybe they're
managed internally by GIO?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Segfault when adding new row to tree view

2009-06-08 Thread Tomasz Jankowski
Hello!

My program crashes in this function (I removed error handling, to make
listings shorter):

void add_file_button_clicked  (GtkButton *button, PrepareSendDialog *object)
{
PrepareSendFileChooserDialog  dialog;
gint  return_value;

return_value = dialog.run_dialog ();
if (return_value == GTK_RESPONSE_OK)
{
GObject  *tmp_object;
GtkListStore *list_store;
GtkTreeIter   iter;
GFile*selected_file;
GFileInfo*selected_file_info;
GIcon*selected_file_icon;
GError   *error = NULL;
gint  return_value;
gchar*selected_file_name = NULL;
gchar*selected_file_size_text = NULL;
guint64   selected_file_size;

// Obtain selectd file information
tmp_object = dialog.get_object (prepare_send_file_chooser_dialog);
selected_file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER
(tmp_object));
selected_file_icon = g_file_icon_new (selected_file);
selected_file_info = g_file_query_info (selected_file,
standard::size,standard::display-name, G_FILE_QUERY_INFO_NONE, NULL,
error);
if (selected_file_info != NULL)
{
selected_file_name = (gchar *) g_file_info_get_attribute_string
(selected_file_info, standard::display-name);
selected_file_size = g_file_info_get_attribute_uint64
(selected_file_info, standard::size);
selected_file_size_text = (gchar *) g_format_size_for_display
(selected_file_size);
// Add file to list
tmp_object = object-get_object (files_tree_view);
list_store = GTK_LIST_STORE (gtk_tree_view_get_model
(GTK_TREE_VIEW (tmp_object)));
gtk_list_store_append (list_store, iter);
gtk_list_store_set (list_store, iter, 0, selected_file_icon, 1,
selected_file_name, 2, selected_file_size_text, NULL);

// Free resources
g_free (selected_file_size_text);
}

// Free resources
g_object_unref (selected_file);
g_object_unref (selected_file_icon);
g_object_unref (selected_file_info);
}
}

This is how I created files_tree_view tree view:

list_store = gtk_list_store_new (3, G_TYPE_ICON, G_TYPE_STRING,
G_TYPE_STRING);
gtk_tree_view_set_model (GTK_TREE_VIEW (tmp_object), GTK_TREE_MODEL
(list_store));
// File icon column
renderer = gtk_cell_renderer_pixbuf_new ();
column = gtk_tree_view_column_new_with_attributes (NULL, renderer,
gicon, 0, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tmp_object), column);
// File name column
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_(File name),
renderer, text, 1, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tmp_object), column);
// File icon column
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_(Size), renderer,
text, 2, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tmp_object), column);

I cant find bug in this code, however I have never used tree view to display
something other, then pure text, so I may be doing something wrong...

I use Ubuntu 9.0 with GTK+ 2.16.1

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


Segfault when adding new row to tree view

2009-06-07 Thread Tomasz Jankowski
Hello!

My program crashes in this function (I removed error handling, to make
listings shorter):

void add_file_button_clicked  (GtkButton *button, PrepareSendDialog *object)
{
PrepareSendFileChooserDialog  dialog;
gint  return_value;

return_value = dialog.run_dialog ();
if (return_value == GTK_RESPONSE_OK)
{
GObject  *tmp_object;
GtkListStore *list_store;
GtkTreeIter   iter;
GFile*selected_file;
GFileInfo*selected_file_info;
GIcon*selected_file_icon;
GError   *error = NULL;
gint  return_value;
gchar*selected_file_name = NULL;
gchar*selected_file_size_text = NULL;
guint64   selected_file_size;

// Obtain selectd file information
tmp_object = dialog.get_object (prepare_send_file_chooser_dialog);
selected_file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER
(tmp_object));
selected_file_icon = g_file_icon_new (selected_file);
selected_file_info = g_file_query_info (selected_file,
standard::size,standard::display-name, G_FILE_QUERY_INFO_NONE, NULL,
error);
if (selected_file_info != NULL)
{
selected_file_name = (gchar *) g_file_info_get_attribute_string
(selected_file_info, standard::display-name);
selected_file_size = g_file_info_get_attribute_uint64
(selected_file_info, standard::size);
selected_file_size_text = (gchar *) g_format_size_for_display
(selected_file_size);
// Add file to list
tmp_object = object-get_object (files_tree_view);
list_store = GTK_LIST_STORE (gtk_tree_view_get_model
(GTK_TREE_VIEW (tmp_object)));
gtk_list_store_append (list_store, iter);
gtk_list_store_set (list_store, iter, 0, selected_file_icon, 1,
selected_file_name, 2, selected_file_size_text, NULL);

// Free resources
g_free (selected_file_size_text);
}

// Free resources
g_object_unref (selected_file);
g_object_unref (selected_file_icon);
g_object_unref (selected_file_info);
}
}

This is how I created files_tree_view tree view:

list_store = gtk_list_store_new (3, G_TYPE_ICON, G_TYPE_STRING,
G_TYPE_STRING);
gtk_tree_view_set_model (GTK_TREE_VIEW (tmp_object), GTK_TREE_MODEL
(list_store));
// File icon column
renderer = gtk_cell_renderer_pixbuf_new ();
column = gtk_tree_view_column_new_with_attributes (NULL, renderer,
gicon, 0, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tmp_object), column);
// File name column
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_(File name),
renderer, text, 1, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tmp_object), column);
// File icon column
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_(Size), renderer,
text, 2, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tmp_object), column);

I cant find bug in this code, however I have never used tree view to display
something other, then pure text, so I may be doing something wrong...

I use Ubuntu 9.0 with GTK+ 2.16.1

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


Writing custom widgets

2009-05-25 Thread Tomasz Jankowski
Hello!

I'm going to learn how to create custom widgets using GTK+, but I read
somewhere, that core of GTK+ (way how widgets are managed by GTK+) is going
to be changed in version 3.0, is this true? I read something about realize
and expose methods.

I don't want to spend my time learning some more advanced parts of curren
GTK+ version if it's going to change quite soon.

Thank you for help ;!
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Ho to implement new GSource?

2009-03-26 Thread Tomasz Jankowski
Hello!

I'm working on MT application, which perform some tasks in separated
threads. My application also use GTK+ and it should work on Windows, so I
need to deal somehow with running all functions, which change GUI from one
thread.

I run one thread with GTK's main loop and i want to implement new source,
which will check GAsysnQueue for new elements (passed to it by other
threads) and perform some actions (like updating progress bars).

I went to GLib documentation and i stuck there. I'm unable to figure out how
main loop works and how can I correctly implement new source type. I cannot
use idle source, because I want to check my async queue more often. On the
other hand I want to understand how main loop works in GLib.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


problem with gtk-doc

2008-04-06 Thread Tomasz Jankowski
Hi!

Like in topic. Everything works great, gtk-doc builds types tree, generates
descriptions for functions, structures, enumerations and properties. The
only thing, which doesn't is generating descriptions for signals. There is
no information about signals in output html files. I used comment style
described gtk-doc reference (i found it on library.gnome.org ). What can be
the problem? I'm using gtk-doc v1.9 . If you want to see some files of my
project just let me know

I sent this message to gtk-doc mailing list few days ago too, but I hadn't
received any response, that's why I'm sending it here.

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


Problem with gtk-doc

2007-11-07 Thread Tomasz Jankowski
Hello!

I have problem with gtk-doc. I configured it in my project an everything was
fine (i had object hierarchy etc.). Now I added two new source files which
decalre two new objects. Gtk-doc sees these new source files, it added
symbols to *unused.tx file, but it did not build new documentation pages for
them. Morover since I added new files gtk-doc doean's add new symbols to
documenattion, even if there are in old files.
-- 
Cya!
Tom
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


What to do with private structure when object is destructed?g_type_class_add_private

2007-11-06 Thread Tomasz Jankowski
Hi!

I added private structure to my class using g_type_class_add_private . When
object is destructed I need to free memory allocated by this structure on my
own in XXX_finalize method or GType will for me?

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


How can I access to main loop in GTK+ apps?

2007-10-31 Thread Tomasz Jankowski
Hello!

I'm searching through API references for GLib and GTK+, for functions which
let me to attach new GSource to programs's main loop. I have no idea how to
get a pointer to main loop run with gtk_main_init. Can someone help me with
it?

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


Creating object based on GObject

2007-08-13 Thread Tomasz Jankowski
Hello!

I want to do such thing: Object, during create process, should be added to
objects' table (GHashTable). In this table I use one of objects' properties
as key (each object have other value of this property). This property is set
only during 'g_object_new' execution and it can't be changed later by user.
The problem is that object should be added to that list during
'g_object_new' call too and I don't know how can I do it. I tried to do it
in 'instance_init', but it was bad idea, because properties are still set
with default values, they are set with values passed to 'g_object_new' after
'instance_init'.

Is there any way to do it during 'g_object_new' run?

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


Which OS are supported by GLib?

2007-08-05 Thread Tomasz Jankowski
Hello!

Where can I find information about operating systems supported by GLib?

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


Question about signals in GObject

2007-07-29 Thread Tomasz Jankowski
Hello again! ;)

I need to know how signals in GObject are called, because I pass dynamically
allocated memory as one of callback's arguments and I need to know, when i
can free it. I need to know, when exactly callback function is called. Is it
called during  'g_signal_emit ()' or it's added to GMainLoop or something?
My code looks like this, please tell me if it may occur any memory
allocation errors:

A = g_alloca ();
g_signal_emit(..., A and other args);
g_free (A);

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


Re: Question about signals in GObject

2007-07-29 Thread Tomasz Jankowski
2007/7/29, David Nečas (Yeti) [EMAIL PROTECTED]:

 If you call g_free() on g_alloca()-allocated memory, errors
 will occur.

 Yeti



My mistake, I use g_malloc. I don't know why i wrote  g_alloca ;P

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

Direct access to object's private variables

2007-07-28 Thread Tomasz Jankowski
Hello!

I have an object based on GObject system. I added to this object it's
private structure using 'g_type_class_add_private ()'. Now need to access to
this private data very often, so it isn't good idea to use macro
SOME_OBJECT_GET_PRIVATE all the time. It's waste of CPU time in my
situation. Is there any pointer, which goes directly to this structure?
Something like object-private-my_variable ?

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


Performance of GMainLoop

2007-07-26 Thread Tomasz Jankowski
Hello!

I'm working on network application (both server and client). I decided to
implement asynchronous socket in my code. I want do this using GMainLoop to
avoid writing multi thread application. I will add new GSource to main
GMainContext, which will handle each socket or add one GSource, which will
handle many sockets. Of course all sockets will be non-blocking. I'd like to
now how many sockets GMainLoop can handle to avoid problems with
performance. Were there any test made for that?

Second thing is GMainLoop's code. I'd like to know how it works. I read
code, but it isn't to understand it for me. Are there any articles about it
or so interesting threads in mailing list's archive? If i will find
something interesting in archive, please tel me where and around which date
should I search for it.

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


Is GObject threadsafe?!

2007-07-04 Thread Tomasz Jankowski
Hello again!

Maybe you will ban me on this mailing list for sending many mails about
similar topic - I'm desperate ;P I only want to know, if GObject system is
thread safe. It's very important to me, to know if I can safety use
g_object_set and g_object_get from many threads without providing my own
thread protection. I found something on web but it wasn't clear for me.

http://mail.gnome.org/archives/gtk-devel-list/2001-November/msg00075.html

We can read there:

  GObject isn't thread-unsafe, it just uses the normal glib locking 
  convention,
  of the user having to pay attention to lock hist structs before using them.
  that can't be done for the type system of course, so we do fine grained 
  locking
  there.

It's quite involved sentence. As I understand Tim Janik, said, that GObject
type system is thread safe. Help, I'm really confused :|

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


Re: g_object_set / g_object_get and multi thread program

2007-07-03 Thread Tomasz Jankowski
Ok, maybe i'll ask i  other way. In my object I have property, which
describe current object status. This property is changed all the time by
internal code, and whole object is locked for e few seconds by a couple of
functions in my library. While object is locked by one this functions other
threads should be able to check object's status all the time. To do that I'm
going to use GStaticRWLock. The problem is that, I'm not sure where how can
I mix functions used to deal with GStaticRWLock with my object's
implementation. I have no idea (and I didn't found any documentation) how
g_object_set and g_object_get behave in multi thread program, so I wrote
code you see in above and I'm not sure if it's good solution.


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


g_object_set / g_object_get and multi thread program

2007-07-02 Thread Tomasz Jankowski
Hello!

Are functions above thread safe? Or maybe I need to provide some protection
system on my own? If I do, can you tell me if something like that will be a
good idea:

static void
socket_set_property (GObject *object, guint prop_id, const GValue *value,
GParamSpec *pspec)
{
g_return_if_fail (IS_SOCKET (object));

SocketPrivate*priv_data = SOCKET_PRIVATE (SOCKET (object));

g_static_rw_lock_writer_unlock (priv_data-rw_mutex);
switch (prop_id){
   /*...*/
}
g_static_rw_lock_writer_lock (priv_data-rw_mutex);
}

static void
socket_get_property (GObject *object, guint prop_id, GValue *value,
GParamSpec *pspec)
{
g_return_if_fail (IS_SOCKET (object));

SocketPrivate*priv_data = SOCKET_PRIVATE (SOCKET (object));

g_static_rw_lock_reader_unlock (priv_data-rw_mutex);
switch (prop_id){
   /*...*/
}
g_static_rw_lock_reader_lock (priv_data-rw_mutex);

}

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


Re: Designing objects with GObject

2007-06-29 Thread Tomasz Jankowski


 You will use g_object_class_override_property() anyway.
 Doesn't it allow to make a READABLE proeprty READWRITE?


No, this function doesn't allow to change property behavior. It only
implements property defined in interface. Any other idea please? ;)

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


Re: Designing objects with GObject

2007-06-29 Thread Tomasz Jankowski
 You can do this, as you control set_property().  The problem
 is that this is a hack invisible to inspection, therefore it
 can lead to all sorts of odd behaviour.


So it's exactly as I thought. I'll implement those properties separately for
both objects. I don't want to make any surprises to my code.


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


Designing objects with GObject

2007-06-28 Thread Tomasz Jankowski
Hi!

I have such situation. I have two objects A and B and interface C, which
should be implemented by both of them. The problem is that some of
properties of interface C should be writable and readable in object A and
only readable in object B. Is there any way to keep them in interface C and
don't do any ugly tricks to go around GObject rules? I really don't want to
implement separately for both objects.

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


Re: Question about GStaticRWLock and GStaticMutex

2007-06-10 Thread Tomasz Jankowski
Ok, I read API reference again i I found answer on second question - All of
the g_static_rw_lock_* functions can be used even if g_thread_init() has not
been called.. However it isn't fully clear for me. I'm working on library,
which use GStaticRWLock in it's structures. I want to provide library, which
will be usable both i single and multi thread programs. Does the sentence,
which I quoted mean, that all g_static_rw_lock_* functions will be enabled
or disabled at compile time depending if g_thread_init () was called or
maybe it is done dynamically at program's runtime? Can someone tell my what
should I do to make my library usable in both types of programs?

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


multi thread app and often variable accessing

2007-06-07 Thread Tomasz Jankowski
Hi!

I'm working on small multi thread application based on Gobject. In one of my
objects I have integer variable, which determine current object's status.
The problem is, that I need to read it's status really often, so it will be
to expensive to lock and unlock mutex all the time. Can I use there atomic
operations provided by GLib instead of mutex locking and unlocking system? I
mean, if g_atomic_get and g_atomic_set would not occur any problems, when I
will try to access the same variable from two thread at the same time?

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


Shared or dynamic?!

2007-05-30 Thread Tomasz Jankowski
Hello!

I'm going to write network library hardly based on GLib to improve my
programming skills. However I haven't wrote any library so far, so I haven't
got any experience with it. :( After reading libtool documentation I became
a bit confused, because I don't know what kind of library should I build. My
library should be linked with program while compilation process, not loaded
during runtime, so I thought, that I must build a static library, but
libraries such as GTK+ or GLib in /usr/lib directory have *.so prefix. I
don't understand it... :( Can someone explain it for my? What kind of
library should I build?

(Sorry for posting it on this mailing list, but i don't know any reliable
source of information. Moreover we can say, that it's someway linked to GTK+
apps programming, because I'm using GLib ;P)

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


GTK+ and LATEX

2007-03-18 Thread Tomasz Jankowski
Hi!

I'm wondering if I'm able to display latex symbols using GtkTextView. I need
to display some math symbols. Maybe I should get into Pango?

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


GMutex vs GStaticMutex

2007-02-05 Thread Tomasz Jankowski
Hi!

I'm not sure if I understood difference between these two types of mutexes.
Can someone explain it for me more clearly, that it is in GLib's
documentation ;) Next thing, I have program, which will run few threads (one
thread - one object), so each object need to have it's own mutex, which will
be better for me GMutex or GStatisMutex?

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


Question about properties in GObject

2007-02-03 Thread Tomasz Jankowski
Hi!

I have short question. I installed G_TYPE_STRING property in my object. Will
it free allocated memory when object will be destroyed or i should do it on
my own?
-- 
Cya!
Tom
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Installing property in interface

2007-01-31 Thread Tomasz Jankowski
2007/1/31, David Nečas (Yeti) [EMAIL PROTECTED]:

 On Wed, Jan 31, 2007 at 10:02:26PM +0100, Tomasz Jankowski wrote:
  I'm trying to install property into main interface, but when I run
 program
  it always display me this warning:
 
  (lt-goofysender:10709): GLib-GObject-WARNING **: When installing
 property:
  type `GoofyFileTransfer' already has a property named `transfer-status'

 The interface base init function can be called multiple
 times (at least once every time a class implementing this
 interface is initialized), but it obviously has to install
 the property only once.  Therefore it must remember it has
 been already called and do nothing in subseqent calls.  See
 Interface Initialization in


 http://developer.gnome.org/doc/API/2.0/gobject/gtype-non-instantiable-classed.html

 There is even an example...

 Yeti


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


Please don't say me, that I was so stupid all the time :| Let say that we
have such function:

static void
maman_ibaz_base_init (gpointer g_iface)
{
  static gboolean initialized = FALSE;

  if (!initialized) {
/* create interface signals here. */
initialized = TRUE;
  }
}

I'm quite young programmer (it's my hobby only), but I'm almost sure, that
all variables declared inside function are destroyed when function execution
if finished. Does 'static' keyword changes this behavior?!

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

Problem with gtk-doc tool

2007-01-30 Thread Tomasz Jankowski
Hi!

I'm writing library based on GObject and I have problem with generating API
reference for it. Here piece if header file, which occur problems :

/***
 *goofy-socket.h
 *
 *  ...about GPL license...
 ***/

G_BEGIN_DECLS

#define GOOFY_SOCKET_ERROR_QUARK g_quark_from_static_string
(goofy-socket-error-quark)
#define GOOFY_SOCKET_INTERNAL_ERROR_QUARK g_quark_from_static_string
(goofy-socket-internal-error-quark)

typedef enum {
GOOFY_SOCKET_ERROR_DESTROYED
}  GoofySocketError;

typedef enum   {
GOOFY_SOCKET_ERROR_INTERNAL_UNKNOWN = 1, /* defined for error's codes
unknown on given platform */
#ifdef G_OS_WIN32
GOOFY_SOCKET_ERROR_INTERNAL_EINTR = WSAEINTR,
GOOFY_SOCKET_ERROR_INTERNAL_EACCES = WSAEACCES,
   /* ...other errors... */
GOOFY_SOCKET_ERROR_INTERNAL_SYSCALLFAILURE = WSASYSCALLFAILURE,
#else
GOOFY_SOCKET_ERROR_INTERNAL_EINTR = EINTR,
GOOFY_SOCKET_ERROR_INTERNAL_EACCES = EACCES,
/* ...other errors... */
GOOFY_SOCKET_ERROR_INTERNAL_SYSCALLFAILURE =
GOOFY_SOCKET_ERROR_INTERNAL_UNKNOWN,
#endif /* G_OS_WIN32 */
}  GoofySocketInternalError;

#define GOOFY_TYPE_SOCKET(goofy_socket_get_type ())
#define GOOFY_SOCKET(obj)(G_TYPE_CHECK_INSTANCE_CAST((obj),
GOOFY_TYPE_SOCKET, GoofySocket))
#define GOOFY_SOCKET_CLASS(klass)(G_TYPE_CHECK_CLASS_CAST ((klass),
GOOFY_TYPE_SOCKET, GoofySocketClass))
#define GOOFY_IS_SOCKET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
GOOFY_TYPE_SOCKET))
#define GOOFY_IS_SOCKET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),
GOOFY_TYPE_SOCKET))
#define GOOFY_GET_SOCKET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),
GOOFY_TYPE_SOCKET, GoofySocketClass))

typedef struct _GoofySocket GoofySocket;
typedef struct _GoofySocketClass GoofySocketClass;

struct _GoofySocket {
GObject   parent;

/* Variables */
};

struct _GoofySocketClass {
GObjectClassparent_class;
};

/* Some function prototypes */

G_END_DECLS

And this is 'make' output:

Cannot parse enumeration member #ifdef G_OS_WIN32
GOOFY_SOCKET_ERROR_INTERNAL_EINTR = WSAEINTR at
/usr/share/gtk-doc/data/gtkdoc-common.pl line 287, INPUT line 120.
Cannot parse enumeration member #else
GOOFY_SOCKET_ERROR_INTERNAL_EINTR = EINTR at
/usr/share/gtk-doc/data/gtkdoc-common.pl line 287, INPUT line 120.
Cannot parse enumeration member #endif
 at /usr/share/gtk-doc/data/gtkdoc-common.pl line 287, INPUT line 120.
=
WARNING: 6 unused declarations.
  These can be found in libgoofy-unused.txt.
  They should be added to libgoofy-sections.txt in the appropriate place.
=
touch tmpl-build.stamp
make[2]: *** Brak reguł do zrobienia obiektu `tmpl/*.sgml', wymaganego przez
`sgml-build.stamp'. Stop.
make[2]: Opuszczenie katalogu `/home/tomek/Desktop/libgoofy/reference'
make[1]: *** [all-recursive] Błąd 1
make[1]: Opuszczenie katalogu `/home/tomek/Desktop/libgoofy'
make: *** [all] Błąd 2

Like I can see gtk-doc doesn't recognize C preprocessor directives :(

Can someone help me solving this problem? This library is (I mean it will
be) available on Linux and win32, so it's very important for me to have my
own, platform independent errors declarations.

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

Basic GObject question

2006-12-28 Thread Tomasz Jankowski
Hi!

Please don't laugh at me ;P Can someone explain me what reference counting
is for?

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


GObject question

2006-12-26 Thread Tomasz Jankowski
Hello!

Can someone explain me, what abstract classes are and where I can use them?

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


Problem with GtkProgressBar and multi thread application

2006-12-23 Thread Tomasz Jankowski
Hello!

This is simple code:
#include gtk/gtk.h

gboolean pulse_it (gpointer data)   {
gtk_progress_bar_pulse (data);
return TRUE;
}

gint thread_fun (gpointer data) {
gint source_id = g_timeout_add (100, (GSourceFunc) pulse_it, data);

g_usleep (500);

g_source_remove (source_id);

gdk_threads_enter ();
gtk_progress_bar_set_text (data, lol!);
gdk_threads_leave ();
}

int main( int   argc,
  char *argv[])
{
GtkWidget*window;
GtkWidget   *pbar;

gtk_init (argc, argv);

g_thread_init (NULL);

window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
pbar = gtk_progress_bar_new ();

gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (pbar));

gtk_widget_show_all (window);

g_thread_create (thread_fun, pbar, FALSE, NULL);

gdk_threads_enter ();
gtk_main ();
gdk_threads_leave ();

return 0;
}


It doesn't work form me. Progress bar is pulsing, but when event source is
removed something weird starts happening. Whole application still works, but
GUI doesn't update (new progress bar's text doesn't display). Any idea how
to solve this?! Maybe I'm too stupid...

I use Ubuntu with GTK+v.2.10.6, GLib 2.12.4 and GCC 4.1

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


Weird problem with GTK+ 2.10.6

2006-12-19 Thread Tomasz Jankowski
Hi there!

Maybe problem, which affect isn't a bug in GTK+, maybe it's occurred by
something else, I don't know. Here's short description. I write small multi
thread application in C language. Whole code is based on GTK+/GLib and
GObject. I have problem with dealing with GtkProgressBar. Window, which
contains GtkProgressBar widget is created in separated thread. Firstly i
make this progress bar pulsing for a while using g_timeout_add () and after
few seconds I remove this source and try to set progress bar's fraction to
0.0. after executing gtk_progress_bar_set_fraction () GUI starts behaving
very funny. Whole program still works, it creates new windows but it doesn't
show widget inside those windows and doesn't update already existing widgets
(when I move mouse pointer on already existing button etc.), it looks like
this:

http://img509.imageshack.us/img509/5880/zrzutekranury1.png

This is normal behavior (when gtk_progress_bar_set_fraction () is removed
from code):

http://img217.imageshack.us/img217/4130/zrzutekranu6vj6.png

when in situation on first screenshot I click in place, where normally is
OK button, program behaves normally ?!

Here's some code:

*this function creates window: **

GtkWidget   *goofy_gui_get_progress_dlg  (GoofyFile  *file)  {
GladeXML*xml;
GtkWidget   *dialog;
GtkWidget   *tmp_widget;
gchar   *size_string = goofy_file_size_to_string (file-file_size);

xml = glade_xml_new (GUI_FILE_PATH, progress_dlg, NULL);
dialog = glade_xml_get_widget (xml, progress_dlg);

/* Set labels etc. in window */
tmp_widget = goofy_gui_get_widget (dialog, file_name_lb);
gtk_label_set_text (GTK_LABEL (tmp_widget), file-file_name);
tmp_widget = goofy_gui_get_widget (dialog, file_size_lb);
gtk_label_set_text (GTK_LABEL (tmp_widget), size_string);
tmp_widget = glade_xml_get_widget (xml, progress_bar);
gtk_progress_bar_set_pulse_step (GTK_PROGRESS_BAR (tmp_widget), 0.05);

/* Connect signals */
g_signal_connect (dialog, delete-event, G_CALLBACK
(on_send_progress_dlg_delete_event), file);
tmp_widget = goofy_gui_get_widget (dialog, cancel_but);
g_signal_connect (tmp_widget, clicked, G_CALLBACK
(on_send_progress_cancel_but_clicked), file);
tmp_widget = goofy_gui_get_widget (dialog, close_but);
g_signal_connect (tmp_widget, clicked, G_CALLBACK
(on_send_progress_close_but_clicked), file);


/* allocated memory */
g_free (size_string);

/* Show window */
goofy_gui_show_widget (dialog);

return dialog;
}

* this make progress bar pulsing *

voidgoofy_gui_set_progress_bar_pulsing  (GtkProgressBar*pbar,
 gboolean   status)
{
guintsource_id;
if (status == TRUE) {
source_id = g_timeout_add (100, (GSourceFunc)
_goofy_gui_progress_bar_pulsing, pbar);
g_object_set_data (G_OBJECT (pbar), pulse-source-id,
GINT_TO_POINTER (source_id));
}
else   {
source_id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (pbar),
pulse-source-id));
g_source_remove (source_id);
/* Clear progress bar */
gtk_progress_bar_set_fraction (pbar, 0.0);
}
}

**   This code deal with window in separated thread
/
gdk_threads_enter ();
dialog = goofy_gui_get_progress_dlg (GOOFY_FILE (file_send));
tmp_widget = goofy_gui_get_widget (dialog, main_lb);
gtk_label_set_markup (GTK_LABEL (tmp_widget), _(span
size=\x-large\bSending file/b/span));
tmp_widget = goofy_gui_get_widget (dialog, name_host_ip_lb);
gtk_label_set_text (GTK_LABEL (tmp_widget), _(Destination host's IP:));
tmp_widget = goofy_gui_get_widget (dialog, host_ip_lb);
gtk_label_set_text (GTK_LABEL (tmp_widget), GOOFY_SOCKET
(file_send)-ip_address);
gdk_threads_leave ();

/* some code here   */

gdk_threads_enter ();
tmp_widget = goofy_gui_get_widget (dialog, progress_bar);
goofy_gui_set_progress_bar_pulsing (GTK_PROGRESS_BAR (tmp_widget), TRUE);
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (tmp_widget),
_(Connecting...));
gdk_threads_leave ();

/* ... other code... */
gdk_threads_enter ();
tmp_widget = goofy_gui_get_widget (dialog, progress_bar);
goofy_gui_set_progress_bar_pulsing (GTK_PROGRESS_BAR (tmp_widget), FALSE);
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (tmp_widget), _(Connected));
gdk_threads_leave ();


**this sis 'goofy_gui_show_widget ' function, which is workaround
for problem with dealing with GTK under win32   **
voidgoofy_gui_show_widget   (GtkWidget  *widget){
g_timeout_add (5, _goofy_show_widget, widget);
}

static gboolean_goofy_show_widget   (gpointer  data){
gtk_widget_show (GTK_WIDGET (data));
gdk_flush ();

return FALSE;
}



The most suprising thing is that this problem occurs only on my Ubuntu
6.10(GTK+
v2.10.6). On Ubuntu 5.10 on Windows XP (both with GTK+v2.10.6) it works
normally. When I remove gtk_progress_bar_set_fraction () from code it 

Re: Weird problem with GTK+ 2.10.6

2006-12-19 Thread Tomasz Jankowski
Update:
I was wrong - the same situation occurs on all platforms
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Mutex or atomic operations for multithread app?

2006-11-11 Thread Tomasz Jankowski
Hi there!

I looking for someone, who will say if my idea is bad or good ;)
I have an object based on GObject, which have quite many int variables. This
object is used by many threads and i'm wondering if I really need to use
mutex when I want to access those variables. Can I use atomically access to
int variables using g_atomic* functions instead using mutex? Is it a good
solution or it may occur memory access problems?
-- 
Tom
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Question about multithreads

2006-10-31 Thread Tomasz Jankowski
Hi!

I generaly know how to write multithreads applications (so far code, which I
wrote works fine). However I'm not sure if I should always lock and unlock
mutex when I'm accesing some global data from thread. I know, that i'm
obligated to sorround with mutex's lock and unlock each part of code, which
acces some global variables, but I wonder if I can omit mutex locking when I
do such fast thing like reading drom integer variable. Can I do it?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


GObject + signals + threads... i have a question

2006-10-11 Thread Tomasz Jankowski
Hi!

I have a problem and I need to know such thing to solve it:
Let say, that we have a multi thread program with two threads: A and B. Now
in A thread we declare and create an new object based on GObject and connect
FOO signal to it. Later, in B thread we use this object and for we try to
emit FOO signal using 'g_signal_emit' on it. Now the most important thing
for me, in which thread signal FOO will be executed, in thread A or in
thread B?

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


Re: (Easy?) Newbie enquiry re: pointers

2006-10-10 Thread Tomasz Jankowski
06-10-10, Samuel Cormier-Iijima [EMAIL PROTECTED] napisał(a):

 Yea, I wasn't sure whether to put a :-( or a :-)   ( :-) ). The thing
 is, strings getting copied around so often seems like memory waste to
 me... when it passes the text to Pango, does that keep a pointer
 itself? freetype? how many times is the same text kept multiple times
 in memory? i guess for strings it doesnt really matter because it's
 not that much memory wasted. Still, gnome/gtk's memory usage seems
 pretty high (see ReducingMemoryUsage on the wiki)


GTK+ is basen on GObject, which stores most of parameters with GValue. If
you will look how GObject's objects works, you will see, that if they are
well implemented, they will release used memory every time, when we will try
change value of some parameter, which is allocating memory (like strings in
GtkLabel).

Moreover I must say, that you aren't completely right saying, that GTK+
based programs  leaks memory, or that their memory usage is high. If you are
working with some GTK+ application, you can see, that whole program
allocates pretty much memory, that is right. However it doesn't mean, that
this program uses whole allocated memory whole the time, because it doesn't,
it use only some part of it and rest is treated as buffer for future memory
usage. Such behave makes GLib based programs (GTK+ is based on GLib, but
GLib  provides memory management subsystem, so GLib is responsible for
memory usage) faster, because they doesn't need time for physical allocating
and releasing memory. Programs are faster (at least theoretically), but they
allocate more memory then non GLib programs, so for some of us it will be
waste of memory and for rest not.

Note, that Pango uses GLib too.


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

GIOChannel and win32?

2006-10-02 Thread Tomasz Jankowski
Hi!

Some time ago I created a thread on this mailing list and someone (I don't
remember his name now) said, that he read on GTK+ devel list, that
GIOChannel may not work under the Microsoft Windows? Is that true, or not?

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


I lose in threads + GTK+, looking for help

2006-09-27 Thread Tomasz Jankowski
Welcome!

So far I wrote a few small applications, which were a multithread programs
based on GTK+. However now I'm working on something bigger and after 10
days of fighting with code and stupidity of win32 platform I fell now like
total noob... :|

What I should do, if I want execute function, which call some gtk_*
functions form GTK+ callback function? How I should use gtk_threads_enter ()
and gdk_threads_leave ()? Should it look like this, or not:

void some_function (void) {
gdk_threads_enter ();
/* Some gtk_* functions here */
gdk_threads_leave ();
}

void example_gtk_callback_function (void) {
gdk_threads_leave ();
some_function ();
gdk_threads_enter ();
}


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


Error in GTK+ v2.10.3 for win32?

2006-09-25 Thread Tomasz Jankowski
Hi!

Have enyoone used GTK+ v2.10.3 for win32? I tried to use it and i think,
that I found a bug in GtkFileChooser widget (here are more information:
http://bugzilla.gnome.org/show_bug.cgi?id=357195). So far my bug wasn't
confirmed by anyone beside me. Can someone check if this bug occurs on his
computer please?

My Windows need to be reinstalled, so it may happens be because of it,
however I'd like to have sure.

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


Trying to make some workaround for win32 + gtk + threads bug

2006-09-10 Thread Tomasz Jankowski
Hi!

I've already wrote some code, which make me able to create widgets from
diffrent threads and it seems to be working (I used GAsyncQueue for it). Now
I want to know, what I can do with widgets created in main thread. I noted,
that I can't show/hide widgets from various threads, are there some more
things, which I can't do with widgets from varoius threads on Win32?

Was this bug even in small piece solved since gtk+ v2.8?

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


Re: Storing GObject in GtkListStore

2006-08-03 Thread Tomasz Jankowski
Thank you for help! :)

I decided to read more about GtkTree* stuff in gtk and now I understand it
much beter!

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


Storing GObject in GtkListStore

2006-08-02 Thread Tomasz Jankowski
Hi!

Generally it isn't a problem, I'm only nosy :P I'd like to know if there is
some other (more recommended) way to store, for example GObject in
GtkListStore/GtkTreeStore. So far I do it, by creating column with type
G_TYPE_INT and storing there pointer to object.

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


GObject - problem, as usual

2006-08-01 Thread Tomasz Jankowski
Hi!

I'm writing some application based on GObject and I have problem when I'm
trying to destroy object. I have two object A and B, A derives from GObject
and B derives from A. I declared my own finalize methods for both objects,
but when I'm destroying B object only B finalize function is executed. When
I remowe B finlize function declaration from B_class_init () A finalize
function is executed normaly. Why B finalize method overrides A finalize
method and what should I do to remoe this overriding? Maybe some parts od my
code will be helpful:

GType A_get_type   (void)   {
   /*PRINT_DBG_IN_FUN_NAME*/

   static GType type = 0;
   if (type == 0) {
  static const GTypeInfo info = {
 sizeof (AClass),
 NULL,   /* base_init */
 NULL,   /* base_finalize */
 A_class_init,   /* class_init */
 NULL,   /* class_finalize */
 NULL,   /* class_data */
 sizeof (A),
 0,  /* n_preallocs */
 NULL/* instance_init */
  };
  type = g_type_register_static (G_TYPE_OBJECT,
 AType,
 info, 0);
   }
return type;
}

GType B_get_type   (void)   {
   /*PRINT_DBG_IN_FUN_NAME*/

   static GType type = 0;
   if (type == 0) {
  static const GTypeInfo info = {
 sizeof (BClass),
 NULL,   /* base_init */
 NULL,   /* base_finalize */
 B_class_init,   /* class_init */
 NULL,   /* class_finalize */
 NULL,   /* class_data */
 sizeof (B),
 0,  /* n_preallocs */
 NULL/* instance_init */
  };
  type = g_type_register_static (A_TYPE,
 BType,
 info, 0);
   }
return type;
}

static void B_class_init(gpointer g_class,
  gpointer class_data)
{
   PRINT_DBG_IN_FUN_NAME
   GObjectClass   *class = G_OBJECT_CLASS (g_class);
   GParamSpec *spec;

   g_type_class_add_private (class, sizeof (BPrivate));

   class-constructor = B_constructor;
   class-dispose = B_dispose;
   class-finalize = B_finalize;
   class-set_property = B_set_property;
   class-get_property = B_get_property;
   /* other code */
}

static void A_class_init   (gpointer g_class,
 gpointer class_data)
{
   PRINT_DBG_IN_FUN_NAME
   GObjectClass   *class= G_OBJECT_CLASS (g_class);
   GParamSpec *spec;

   class-finalize = A_finalize;
   class-set_property = A_set_property;
   class-get_property = A_get_property;
   /* other code */
}

I changed objects names, to make it more legible. PRINT_DBG_IN_FUN_NAME is a
macro, which display function name in console. Here is otput of running
'g_object_unref (g_object_new (A_TYPE, NULL))'. This is program output:

Function: A_class_init
Function: B_class_init
Function: B_constructor
Function: B_dispose
Function: B_finalize

I noticed, that in both *_class_init fnctions I use GObjectClass to declare
finalize, constructor etc. functions on it, is this main reason of my
problem?

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


Building module compatiable with GModule

2006-07-23 Thread Tomasz Jankowski
Hie!

I can't find any information about building plugins, which can be loaded by
GModule under Linux. How can I build plugin? Should I use libtool to do it,
or there is other way? If libtool is good tool for that, should I build
plugin wth some specific libtool's options?

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


Re: New to GObject, few questions

2006-07-22 Thread Tomasz Jankowski
Thanks! Now GObject is much clear for me. If I understood you good I should
use methods, which will affect on propertys of concrete object and Interface
should be defined to be able to work with many object (classes) - like
GtkTreeModel can work with GtkListStore and GtkTreeStore. Interfaces are
only something like protoyypes for methods, am I right?

Oh, and the last thing, I can't find examples for GObject tutorial, they
aren't provided with this tutrial and I can't find them on gtk.org :| I used
google too. Maybe some of you have them? It will be great is someone cloud
send me this source examples or link to them on e-mail
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


New to GObject, few questions

2006-07-21 Thread Tomasz Jankowski
Hi!

Well, I'm working with GTK+ quite long, but I have never tried to get inside
it's code. Now I'm trying to understood how GObject works and I must say,
that it isn't as easy as I tought ;)

I read few times Gobject tutorial provided with GLib's documentation but I
don't understood it enouhg good, maybe because I don't like (and know)
object languages, I know only C++ basics. So these are my questions:

I. What the Interfaces are? I don't understood their predestination? I
understood them as other type of Methods, but I'm know, that Interfaces
aren't Methods, can someone explain me it?

II. For example, object XXX inherits from object ZZZ and I defined
*_finalize () functions for object ZZZ, but I didn't define any *finalize
functions for object XXX. What will happen if I'll try to destroy XXX
object? Will ZZZ's *_finalize functions will be used?

III. What 'GTypeInstance' is?
-- 
Pozdrawiam!
Tom
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list