Re: systray icon

2005-12-17 Thread HuamiSoft Hubert Sokolowski
On Sat, 17 Dec 2005 00:53:17 +0100
Fernando ApesteguĂ­a [EMAIL PROTECTED] wrote:

 I've looked for that header file and I have not it installed neither in
 Ubuntu nor in Whitebox. I found the file in a web page of the GNU project,
 but don't I need a lib to link against? I downloaded the header, but then
 Anjuta said the functions I tried to use, were not found.

you can find eggtrayicon sources and an example on using it in
gj_gtk_docklet here
http://cvs.gnome.org/bonsai/rview.cgi?cvsroot=/cvs/gnomedir=gnome-jabber/srcmodule=default

Add eggtrayicon.c to your anjuta project.

-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: systray icon

2005-12-16 Thread HuamiSoft Hubert Sokolowski

HI!

On Fri, 16 Dec 2005 17:42:24 +0100
Fernando ApesteguĂ­a [EMAIL PROTECTED] wrote:

 Hi,
 
 Do you know how to find a simple example to make a systray icon in gnome
 panel?
 If you can tell me the name of the related functions, I'll search for
 documentation.

look for eggtrayicon.h


-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Looking for example to draw a simple red text on my GtkDrawable

2005-12-13 Thread HuamiSoft Hubert Sokolowski


Hi!

You can use 

context = gdk_pango_context_get ();
layout = pango_layout_new (context);
pango_layout_set_alignment (layout, PANGO_ALIGN_LEFT);

pango_layout_set_markup (layout, str, -1);
gdk_draw_layout (drawable, gc, x, y, layout);

where str is pango markup text for example
span foreground='red'some text/span

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


Re: get current time / win32: got UTC instead of local time

2005-12-07 Thread HuamiSoft Hubert Sokolowski
On Wed, 7 Dec 2005 20:47:32 +
Felix Kater [EMAIL PROTECTED] wrote:

 Hi,
 
 to sum up:
 
 With g_get_current_time() / win32 it seems that I get UTC instead of
 the local time. How can I get the local time?
 
 Long version:
 
 I use g_get_current_time() / win32 to set GTimeVal and calculate the
 current hour of the
 day (0-23) like this:
 
 hour_of_the_day=
  my_gtimeval.tv_sec % (3600*24) / 3600
 
 
 My windows timezone is set to UTC+1 == GMT+1 == CET, however, this is
 not respected. What ever I select as the windows timezone the above
 formula calculates the same wrong hour (it seems to be UTC always).
 
 
 How can I get the local time?

did you try with
  time_t t;
  struct tm *lt;

  t = time (NULL);
  lt = localtime (t);
  sprintf (current_time_ret, %04d-%02d-%02d %02d:%02d:%02d,
   lt-tm_year+1900, lt-tm_mon+1, lt-tm_mday,
   lt-tm_hour, lt-tm_min, lt-tm_sec);

it works on windows and linux.


-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Is it possible to put all necessary GTK runtime files in a single directory

2005-10-25 Thread HuamiSoft Hubert Sokolowski
On Tue, 25 Oct 2005 11:56:15 -0500
Douglas Vechinski [EMAIL PROTECTED] wrote:

 I'm sure that would work if I'm allowed to add  bin\bin to the PATH 
 environment variable.  At present that priviledge is not being 
 allowed.   I will probably be able to if there is no other option, but 
 I'm first trying to see if there is an alternative.
then put you exe program in bin\bin and create a batch in bin that does
cd bin
yourprogram.exe
or windows executable that does the same and does not need gtk runtime.
you could then put all gtk runtime and your gtk program in one folder
for example
bin\
myGtkProgram.bat
myGtkProgram\
--etc\
--lib\
--gtk and other dlls
--myGtkProgram.exe

remember that when pango dll is in bin directory it tries to load its
modules from ../lib and not from lib/.

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


GtkTreeModelFilter problems

2005-10-15 Thread HuamiSoft Hubert Sokolowski

Hi!

I am trying to use GtkTreeModelFilter to filter out some rows. it works
great, but I have a problem with a cell which is a toggle.
the code below works for model when all rows are shown, but it does not
work well when some rows are hiden. it is a list, not a tree.
what's wrong with it? this code runs in cell_toggled callback.
gtk+-2.8.6

 child_path = gtk_tree_path_new_from_string (path_string);
 path =
gtk_tree_model_filter_convert_child_path_to_path (filter, child_path);
// here path is NULL when some rows are hiden
gtk_tree_path_free (child_path);
 if (path)
  {
gtk_tree_model_get_iter (smodel, iter, path);
gtk_tree_path_free (path);

col = GPOINTER_TO_INT (data);
gtk_tree_model_get (smodel, iter,
col, bool, -1);

bool ^= 1;
gtk_list_store_set (GTK_LIST_STORE (smodel), iter,
col, bool, -1);
  }

thanks in advance
-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GtkTreeModelFilter problems

2005-10-15 Thread HuamiSoft Hubert Sokolowski


the answer is
gtk_tree_model_filter_convert_path_to_child_path 


On Sat, 15 Oct 2005 09:39:00 +0200
HuamiSoft Hubert Sokolowski [EMAIL PROTECTED] wrote:

 
 Hi!
 
 I am trying to use GtkTreeModelFilter to filter out some rows. it works
 great, but I have a problem with a cell which is a toggle.
 the code below works for model when all rows are shown, but it does not
 work well when some rows are hiden. it is a list, not a tree.
 what's wrong with it? this code runs in cell_toggled callback.
 gtk+-2.8.6
 
  child_path = gtk_tree_path_new_from_string (path_string);
  path =
 gtk_tree_model_filter_convert_child_path_to_path (filter, child_path);
 // here path is NULL when some rows are hiden
 gtk_tree_path_free (child_path);
  if (path)
   {
 gtk_tree_model_get_iter (smodel, iter, path);
 gtk_tree_path_free (path);
 
 col = GPOINTER_TO_INT (data);
 gtk_tree_model_get (smodel, iter,
 col, bool, -1);
 
 bool ^= 1;
 gtk_list_store_set (GTK_LIST_STORE (smodel), iter,
 col, bool, -1);
   }
 
 thanks in advance
 -- 
 HuamiSoft Hubert Sokolowski
 http://www.huamisoft.com/
 tel. 501456743
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 


-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


gtktreeview - hide some rows

2005-10-14 Thread HuamiSoft Hubert Sokolowski

Hi!

I have a treeview which is a list. is it possible to hide some
particular rows? I want to implement some filter on my treeview, so the
user could find quicker some rows.

regards
-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: z-order of gtk windows on win32

2005-10-02 Thread HuamiSoft Hubert Sokolowski
On Sat, 1 Oct 2005 09:56:40 -0400 (EDT)
Allin Cottrell [EMAIL PROTECTED] wrote:

 Starting from my app's main window, the user can create an 
 additional window displaying a graph.  The newly-opened graph window 
 naturally appears above the main window.  It is created using
 
 gtk_window_new(GTK_WINDOW_TOPLEVEL)
 
 From the graph window in turn, the user can call up a graph-editing 
 dialog, which appears on top of the graph.  The dialog is done with
 
 gtk_dialog_new()
 
 When the graph-editing dialog is closed, I expect the graph window 
 to remain above the original, main window.  This is what happens on 
 Linux, but not on win32 (same code).  On Windows, when you close the 
 graph-editing dialog, the app's main window snaps on top of the 
 graph window, which is quite annoying (you can't see the changes you 
 just made, without clicking on the graph window to raise it again).
 
 I have tried explicitly setting the dialog's gtk window as 
 transient for the graph window, but this doesn't change the 
 behavior.
 
 Is there any other gtk window-controlling option that I'm missing 
 here?  Thanks.
 
I also found this bug very annoying, but I don't know about any
solution to this problem.



-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Gtk+, UTF-8 and translations

2005-09-15 Thread HuamiSoft Hubert Sokolowski
On Thu, 15 Sep 2005 12:34:48 +0200
Christian Neumair [EMAIL PROTECTED] wrote:

 Am Dienstag, den 13.09.2005, 21:23 +0200 schrieb HuamiSoft Hubert 
 
  Are Gtk+ .po files in UTF-8?
 
 Yes.
 
  If so, don't you have a problem with
  msgmerge complaining about invalid multibyte sequence?
  I am using gettext in my program and all is fine until when I have to
  merge two .po files with msgmerge which removes all multibyte
  characters from msgstr tags in my original .po file.
 
 I think msgfmt = 0.10.35 doesn't handle multibyte characters correctly.
 You should upgrade to a recent gettext version.
thanks for you reply, but I have found a problem, I didn't add
Content-type header to .po file.

regards
-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Gtk+, UTF-8 and translations

2005-09-13 Thread HuamiSoft Hubert Sokolowski

Hi!

Are Gtk+ .po files in UTF-8? If so, don't you have a problem with
msgmerge complaining about invalid multibyte sequence?
I am using gettext in my program and all is fine until when I have to
merge two .po files with msgmerge which removes all multibyte
characters from msgstr tags in my original .po file.

Regards,
-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: UI manager problem, more concise

2005-09-07 Thread HuamiSoft Hubert Sokolowski
On Wed, 7 Sep 2005 20:51:26 +1000
Nick Watts [EMAIL PROTECTED] wrote:

 Umm, lets see. I have a whole bunch of UImanager code, but none of it causes 
 an error until I get to this:
 
 if (!gtk_ui_manager_add_ui_from_string (ui, ui_info, -1, error))
 {
 g_message (building menus failed: %s, error-message);
 g_error_free (error);
 }
 
 The weird thing is that although I get a bunch of Gtk-CRITICAL errors in the 
 program, the GError error is not set and the message is not 
 displayed. Is there any problem with using the uimanager functions inside 
 the main() or gtk_main() functions of your program?

did you set 'error' pointer to NULL before calling
gtk_ui_manager_add_ui_from_string ?

-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtk_list_store_new(1, G_TYPE_STRING) and retrieving data

2005-09-07 Thread HuamiSoft Hubert Sokolowski
On Wed, 7 Sep 2005 13:52:34 -0400 
Faria, Sydney C [EMAIL PROTECTED] wrote:

 I made a GtkListStore model and populated it with data entries and view it
 via a GtkTreeView no problem.  Now I want to use a button click callback to
 scan through the list
 to access all the items to print them out.  I found
 gtk_tree_model_iter_next(model, iter) and gtk_tree_model_getvalue(model,
 iter, column, value) and thought that might be the way to go:  then I found
 gtk_tree_model_foreach(model, GtkTreeModelForeachFunc, data) and
 GtkTreeModelForeachFunc(model, PATH, iter, data)!  The latter 2 methods look
 like the easier path to follow but the documentation here is very sparse!
 I'm trying to iterate through a list so what does PATH have to do with this?
 I sure would like to see an example of these two techniques so any comments
 and/or skeleton code would certainly be well appreciated.

use
gtk_tree_model_foreach (model, model_foreach, NULL);

static gboolean model_foreach (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data)
{
  gtk_tree_model_get (model, iter,
  COLUMN, value,
  -1);

  return FALSE;
}


-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: rendering text to drawable

2005-08-31 Thread HuamiSoft Hubert Sokolowski

Hi!

On Tue, 30 Aug 2005 23:11:29 +0200
Mateusz Misiorny [EMAIL PROTECTED] wrote:

 Hi,
 
 I just wanted to render some simple strings to a drawable (a pixmap)
 and it seems it requires massive amount of work and code just to get a
 few characters on the screen. I am talking about the new way of
 rendering text - through pango. I have to create many structures and
 fill many fields just to get a plain simple text rendered (which still
 I didn't manage to do since I gave up after I spend way too much time
 on that than I wanted). How do I do it with minimal work?

I do it this way and I think this is the minimal way to do it

PangoLayout *layout;
PangoContext *context;

void draw_init ()
{
  context = gdk_pango_context_get ();
  layout = pango_layout_new (context);
  pango_layout_set_alignment (layout, PANGO_ALIGN_LEFT);
}

void draw_text (GdkPixmap *pixmap, GdkGC *gc, const gchar *str, gint x,
gint y)
{
  pango_layout_set_markup (layout, str, -1);
  gdk_draw_layout (pixmap, gc, x, y, layout);
}


-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Gdk Pixbuf file saving

2005-08-30 Thread HuamiSoft Hubert Sokolowski

Hi!


On Tue, 30 Aug 2005 17:45:53 +1000
Nick Watts [EMAIL PROTECTED] wrote:

 I am trying to create a simple photo resizing app and I can't get the 
 gdk_pixbuf_save() function to work.
 I have gdk_pixbuf_scale_simple() working so I evidently have the gdk
 
 Here is my code:
 
 ==
 static void save_image()
 {
 GdkPixbuf *savepixbuf;
 savepixbuf = gtk_image_get_pixbuf(GTK_IMAGE(img));
 GError *error;

// you should set here error to NULL
  error = NULL;

 gdk_pixbuf_save(savepixbuf, filename, jpeg, error, quality, 100, 
 NULL);
 }
 
 GtkWidget *img;
 img = gtk_image_new_from_file(somephoto.jpg);
 ==
 
 Compiles fine but upon attempting to save the file the GError returns thus:
 
 message: \x08\x7f\xfc
 code: 6770465
 domain: G_FILE_ERROR
 
 I can't figure out what's causing the error, if it's my code or if it is 
 something OS related (using win32 and GTK+ 2.6).
 
 Any help much appreciated,
 -Nick
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 


-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Gdk Pixbuf file saving

2005-08-30 Thread HuamiSoft Hubert Sokolowski
On Tue, 30 Aug 2005 18:35:37 +1000
Nick Watts [EMAIL PROTECTED] wrote:

 Thanks a whole heap man, solved my problem completely.
no problem :)

 
 On 8/30/05, HuamiSoft Hubert Sokolowski [EMAIL PROTECTED] wrote:
  
  
  Hi!
  
  
  On Tue, 30 Aug 2005 17:45:53 +1000
  Nick Watts [EMAIL PROTECTED] wrote:
  
   I am trying to create a simple photo resizing app and I can't get the
   gdk_pixbuf_save() function to work.
   I have gdk_pixbuf_scale_simple() working so I evidently have the gdk
  
   Here is my code:
  
   
  ==
   static void save_image()
   {
   GdkPixbuf *savepixbuf;
   savepixbuf = gtk_image_get_pixbuf(GTK_IMAGE(img));
   GError *error;
  
  // you should set here error to NULL
  error = NULL;
  
   gdk_pixbuf_save(savepixbuf, filename, jpeg, error, quality, 100,
   NULL);
   }
  
   GtkWidget *img;
   img = gtk_image_new_from_file(somephoto.jpg);
   
  ==
  
   Compiles fine but upon attempting to save the file the GError returns 
  thus:
  
   message: \x08\x7f\xfc
   code: 6770465
   domain: G_FILE_ERROR
  
   I can't figure out what's causing the error, if it's my code or if it is
   something OS related (using win32 and GTK+ 2.6).
  
   Any help much appreciated,
   -Nick
   ___
   gtk-app-devel-list mailing list
   gtk-app-devel-list@gnome.org
   http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
  
  
  
  --
  HuamiSoft Hubert Sokolowski
  http://www.huamisoft.com/
  tel. 501456743
  ___
  gtk-app-devel-list mailing list
  gtk-app-devel-list@gnome.org
  http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 
 


-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. 501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GtkTreeView : Drag and drop

2005-08-22 Thread HuamiSoft Hubert Sokolowski

Hi!

On Mon, 22 Aug 2005 00:37:34 +0200
Thym [EMAIL PROTECTED] wrote:

 Hello,
 
 ( I speak french, sorry for my english )
 
 in my GtkTreeView, I activated drag and drop with : 
 gtk_tree_view_set_reorderable(GTK_TREE_VIEW(pTreeView), TRUE);
 
 The DnD works fine, but I would like control if the row may moved.
 
 How can I do it ?

here is some sample code from my app, but this is for a listview, not a
treeview,

typedef struct {
  GtkTreeModel *model;
  GtkTreePath *path;
  int index;
} drag_mrl_t;

static drag_mrl_t drag_mrl = { NULL, NULL, -1 };

 static void _treeview_drag_drop_setup (GtkTreeView *widget)
{
  GObject *object = G_OBJECT(widget);

//  printf (treeview drag drop setup\n);
  g_signal_connect (object, drag-begin,
G_CALLBACK (_drag_start_cb), NULL);
  g_signal_connect (object, drag-data-get,
G_CALLBACK (_drag_data_get_cb), NULL);
  g_signal_connect (object, drag-data-received,
G_CALLBACK (_drop_cb), NULL);
  g_signal_connect (object, drag-end,
G_CALLBACK (_drag_end_cb), NULL);

  gtk_tree_view_enable_model_drag_source (widget, GDK_BUTTON1_MASK,
  target_table, 1,
  GDK_ACTION_COPY |
GDK_ACTION_MOVE); gtk_tree_view_enable_model_drag_dest (widget,
target_table, 1, GDK_ACTION_COPY | GDK_ACTION_MOVE);
}

static void _drag_end_cb (GtkTreeView *widget, GdkDragContext *context,
 gpointer data)
{
//  printf (drag end cb\n);
  if (drag_mrl.model)
  {
drag_mrl.model = NULL;
drag_mrl.index = -1;
gtk_tree_path_free (drag_mrl.path);
  }
}
static void _drop_cb (GtkTreeView *widget,
  GdkDragContext *context,
  gintx,
  ginty,
  GtkSelectionData   *data,
  guint   info2,
  guint time)
{
  gint ins_pos = treeview_get_drop_index (widget, context, x, y);
  GtkTreeIter iter;
  gint id, typ, katalog;
  gchar *nazwa, *path, *table, *q;
  gint ret;

//  printf (drag_drop: drop callback, length=%d, format=%d, pos=%d,%d,
insert=%d\n, // data-length, data-format, x, y, ins_pos);
  if (ins_pos == drag_mrl.index)
return;
  path = g_strdup_printf (%d, ins_pos);
  if (gtk_tree_model_get_iter_from_string (smodel, iter, path))
  {
  }
  g_free (path);

  gtk_drag_finish (context, FALSE, FALSE, time);
}
static int treeview_get_drop_index (GtkTreeView *widget,
GdkDragContext *context,
gint x, gint y)
{
  GtkTreePath *path;
  gint cx, cy, ins_pos = -1;

  gdk_window_get_geometry (gtk_tree_view_get_bin_window (widget),
   cx, cy, NULL, NULL, NULL);
  if (gtk_tree_view_get_path_at_pos (widget, x -= cx, y -= cy,
 path, NULL, cx, cy))
  {
GdkRectangle rect;
/* in lower 1/3 of row? use next row as target */
gtk_tree_view_get_background_area (widget, path,
   gtk_tree_view_get_column
(widget, 0), rect);
if (cy = rect.height * 2 / 3.0)
{
  gtk_tree_path_free (path);
  if (gtk_tree_view_get_path_at_pos (widget, x, y + rect.height,
 path, NULL, cx, cy))
ins_pos = gtk_tree_path_get_indices (path)[0];
}
else
  ins_pos = gtk_tree_path_get_indices (path)[0];
gtk_tree_path_free (path);
  }
  return ins_pos;
}
static void _drag_data_get_cb (GtkTreeView *widget, GdkDragContext
*context, GtkSelectionData *selection, guint info,
   guint time, gpointer data)
{
//  printf (drag drop get cb\n);
  if (drag_mrl.model)
gtk_tree_set_row_drag_data (selection, drag_mrl.model,
drag_mrl.path); }

static void _drag_start_cb (GtkTreeView *widget, GdkDragContext
*context, gpointer data)
{
  GtkTreeSelection *sel = gtk_tree_view_get_selection (widget);
  GtkTreeIter iter;

//  printf (drag drop start\n);
  if (gtk_tree_selection_get_selected (sel, NULL, iter))
  {
drag_mrl.model = gtk_tree_view_get_model (widget);
drag_mrl.path = gtk_tree_model_get_path (drag_mrl.model, iter);
drag_mrl.index = gtk_tree_path_get_indices (drag_mrl.path)[0];
  }
}


-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. (085) 7465779
kom. +48501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GList

2005-08-18 Thread HuamiSoft Hubert Sokolowski

Hi!

On Thu, 18 Aug 2005 00:52:45 -0500
Tristan Sloughter [EMAIL PROTECTED] wrote:

 I am using GLists and want to make sure I am freeing all the memory, and 
 not twice or course.
 
 There are three possible functions for removing an element from the list:
 
 g_list_remove (GList *list, gconstpointer data);
 g_list_remove_link (GList *list, GList *llink);
 g_list_delete_link (GList *list, GList *link_);
 
 typedef struct {
   gpointer data;
   GList *next;
   GList *prev;
 } GList;
 
 So, I want to be sure that /gpointer data/ is freed when I remove the 
 element from the list. If I call/ g_list_remove(...)/ will that take 
 care of freeing data? If so should I use glib allocating functions for 
 allocating the memory that /data/ points to, since it'll probably use 
 /g_free/ to free the /data/, or does it matter?
 
 What is the difference between /remove_link/ and /delete_link/? If I 
 used /remove_link (...)/ I assume I'd have to free the memory pointed to 
 by /data/ on my own, that being the difference between /remove/ and 
 /remove_link/.
 
always when you allocate a memory, you need to free it by your self.
to free a list completely you need to free /data/ by your self if it
points to some memory that you allocated. g_list_remove removes an
element from a list and frees that element (but without freeing /data/).
g_list_remove_link removes an element without freeing it, but also sets
next and prev to NULL. 
g_list_delete_link just removes an element without freeing it, but next
and prev still point where they were pointed.

I hope that it is clear :).

regards
-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. (085) 7465779
kom. +48501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GList

2005-08-18 Thread HuamiSoft Hubert Sokolowski
On Thu, 18 Aug 2005 09:56:10 +0200
David Necas \(Yeti\) [EMAIL PROTECTED] wrote:

 On Thu, Aug 18, 2005 at 12:52:45AM -0500, Tristan Sloughter wrote:
  I am using GLists and want to make sure I am freeing all the memory, and 
  not twice or course.
  
  There are three possible functions for removing an element from the list:
  
  g_list_remove (GList *list, gconstpointer data);
  g_list_remove_link (GList *list, GList *llink);
  g_list_delete_link (GList *list, GList *link_);
 
 And while their names are confusing a bit, because the only
 difference between g_list_remove() and g_list_delete() is
there is no such function g_list_delete().


-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. (085) 7465779
kom. +48501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GList

2005-08-18 Thread HuamiSoft Hubert Sokolowski
On Thu, 18 Aug 2005 20:17:34 +0100
Chris Vine [EMAIL PROTECTED] wrote:

 On Thursday 18 August 2005 08:51, HuamiSoft Hubert Sokolowski wrote:
 
  always when you allocate a memory, you need to free it by your self.
  to free a list completely you need to free /data/ by your self if it
  points to some memory that you allocated. g_list_remove removes an
  element from a list and frees that element (but without freeing /data/).
  g_list_remove_link removes an element without freeing it, but also sets
  next and prev to NULL.
  g_list_delete_link just removes an element without freeing it, but next
  and prev still point where they were pointed.
 
 Actually, g_list_delete_link() does free the link element (it calls 
 _g_list_free_1()).  It is g_list_remove_link() which does not.  
 g_list_remove_link() in effect starts a new list.
 
 To the other poster who said the documentation was quite clear ...
yes, for this function the docs are not very clear.


-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. (085) 7465779
kom. +48501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: drawing area and events win32

2005-08-16 Thread HuamiSoft Hubert Sokolowski
On Tue, 16 Aug 2005 16:40:54 +0530
jaykumar [EMAIL PROTECTED] wrote:

 Hi,
  I am new to gtk development, currently I have used gtk -win32  version
 2.6.7 for creating a video player.
first of all, please use latest stable gtk for windows from Tor's site
http://www.gimp.org/~tml/gimp/win32/ which is 2.6.9.

regards.
-- 
HuamiSoft Hubert Sokolowski
http://www.huamisoft.com/
tel. (085) 7465779
kom. +48501456743
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtk-app-devel-list Digest, Vol 14, Issue 55

2005-06-24 Thread Hubert Sokolowski
 [EMAIL PROTECTED] wrote:

Send gtk-app-devel-list mailing list submissions to
  gtk-app-devel-list@gnome.org

To subscribe or unsubscribe via the World Wide Web, visit
  http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
or, via email, send a message with subject or body 'help' to
  [EMAIL PROTECTED]

You can reach the person managing the list at
  [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than Re: Contents of gtk-app-devel-list digest...


Today's Topics:

   1. Re: Pango GTK+ on Windows (Hubert Soko?owski)
   2. Re: drawing stuff inside the TreeView (Alexei D)
   3. Re: Changing the color of an image/pixbuf (Christopher Anderson)
   4. Re: How can I display the buttons in a dialog's action area
  vertically? (Christopher Anderson)
   5. Re: [GObject, long] Gtype for enum + runtime init or by init
  function. (Uzytkownik)
   6. Re: Toggle Button CellRenderer in GtkTreeView (Daniel K. O.)
   7. Re: drawing stuff inside the TreeView (Maciej Katafiasz)
   8. embedding images into icons while compiile time (mohan kumar)
   9. Re: embedding images into icons while compiile time
  (Brian J. Tarricone)


--

Message: 1
Date: Thu, 23 Jun 2005 18:27:31 +0200
From: Hubert Soko?owski [EMAIL PROTECTED]
Subject: Re: Pango GTK+ on Windows
To: gtk-app-devel-list@gnome.org gtk-app-devel-list@gnome.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=US-ASCII

On Thu, 23 Jun 2005 16:58:37 +0200 (SAST)
Alf C Stockton [EMAIL PROTECTED] wrote:



What I did not point out in my original message is that my program
works
perfectly on my development box but when moved to my clients machine,
where they do not have GTK installed, it fails with the pango message.

On my clients machine the executable I created and all the .dlls that
objdump -p told me about, all exist in the same directory.

From what is being said this does not look like the way my application
should be
installed at my client. Please tell me what the installation should
look like.




please provide the exact directory structure of your program on your
clients machine.



 All executables and .dll's that objdump -p told me about are in c:\temp
 Therefore I have :-
 iconv.dll, intl.dll, libatk-1.0-0.dll, libgdk_pixbuf-2.0-0.dll,
 libgdk-win32-2.0-0.dll, libglib-2.0-0.dll, libgmodule-2.0-0.dll,
 libgobject-2.0-0.dll, libgtk-win32-2.0-0.dll, libpango-1.0-0.dll,
 libpangowin32-1.0-0.dll, MTI.exe and TOA.exe
 all in the same directory. Obviously the MTI.exe  TOA.exe are the
 programs I created.


ok, but where do You have directories like etc, lib, share ? please
provide full directory structure starting from the directory where your
program is installed.



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


Re: Glade C code a bad thing? (was: root windows)

2005-05-31 Thread Hubert Sokolowski

Hi!

 Hello Everyone!
 G'day all.

 I would support the inclusion of Code generation
 in GLADE UI Editor. It is a welcome feature, for those
 who would like it. If its not to be in the main tree
 atleast put the code into a plugin thats enabled
 at default, and users can turn it off, if they prefer.

 I request that code generation not be removed from
 Glade project.

Me too!!!


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


Re: HELP!!!!!!!!!!!!!!!!!!!(html in gtk)

2005-05-09 Thread Hubert Sokolowski
 You have some options, two of which are:
 gtkmozembed (http://www.mozilla.org/unix/gtk-embedding.html)
 gtkhtml
which gives you gtkhtml2 (does not support gnome printing) or gtkhtml3
(does not support CSS), your choice.

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


Re: gtk and hicolor theme

2005-05-05 Thread Hubert Sokolowski
 That said, there's one thing in recent gtk that I'm concerned about.
 It makes sense that gtk should take over some features previously
 supplied by gnome, but I don't like to see a covert gnome dependency
 in gtk.  I'm therefore troubled by this sort of thing: when I open
 my app (gtk2 version, compiled against gtk 2.6.7) on a non-gnome (or
 non-current gnome) system and use the file chooser, I see:

 (lt-gretl_x11:27643): Gtk-WARNING **: Could not find the icon
 'gnome-fs-home'. The 'hicolor' theme
 was not found either, perhaps you need to install it.
 You can get a copy from:
  http://freedesktop.org/Software/icon-theme/releases
Try to set default gtk theme or just remove ~./gtkrc-2.0. I think this
warning comes from a gtk theme stuff.


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


Re: glib installation

2005-04-26 Thread Hubert Sokolowski

Hi!

 hi all,

 I had downloaded glib-2.6.4 and installed it just like the instructions
 said
 to. Still when i run the configure command for an application dependant on
 the latest glib-2.6.4,  it gives an error saying glib-2.0 = glib-2.4
 Could someone please help me.
try to set PKG_CONFIG_PATH to include /usr/local/lib/pkgconfig
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


GtkTreeViewColumn get column id

2005-04-22 Thread Hubert Sokolowski

Hi!

I added a column to a treeview with
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (col_title,
   renderer,
   text,
   column_id,
   NULL);
gtk_tree_view_append_column (treeview, column);


how to get the column id of a GtkTreeViewColumn? I can get a title, but I
see no function to get the column id.

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


gtkhtml3 and CSS

2005-04-21 Thread Hubert Sokolowski

Hi!

sorry for posting to this list, but gtkhtml mailing list seems to be dead.
My question is does gtkhtml3 support CSS?

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


Re: A grid with gtk

2005-04-14 Thread Hubert Sokolowski

Hi.

 Hi, I'm using GtkSheet from GtkExtra because I need to use grids in my
 application. There is another widget like GtkSheet in gtk?

you can always use plain GtkTreeView for grids.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Report Generation

2005-04-12 Thread Hubert Sokolowski

Hi!

 hello

 I need to generate a report which will have images as well as some text
 related to each image  in  a particular format. I also need to print the
 report. Im not sure as to how to go about this problem. I was thinking of
 maybe using GnomeCanvas but im not quite sure. Could someone please give
 me
 a few suggestions of how to go about.


the easiest way is to generate a html page an open it with some external
browser. this approach is very portable.

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


Re: gtk_calendar_get_date once again

2005-03-29 Thread Hubert Sokolowski
 0 is a G_DATE_BAD_MONTH, but gtk_calendar_get_date returns month from
 range 0-11.

 gtk_calendar_get_date stores the month in a user specified location.
 Maybe it uses GDateMonth for internal use and then returns the value
 (GDateMonth - 1) to the user.

but why it returns (GDateMonth - 1) ?
It is not compatible with GDate !
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtk_calendar_get_date once again

2005-03-29 Thread Hubert Sokolowski

 but why it returns (GDateMonth - 1) ?
 It is not compatible with GDate !

 It does not return the date in GDate format anyway, so the
 issue of incompatibility does not arise.
 As the prototype says,
 void gtk_calendar_get_date(GtkCalendar*, guint*, guint*, guint*);

 I guess it is upto the user to get the dd-mm- and then
 convert it to GDate, if such an API exists.
yes but the docs for GtkCalendar does not say it returns month in range
0-11, and it can be confusing. I reported a doc bug for this but it hasn't
been fixed for months.


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


how to align text to right in GtkCellRendererText

2005-03-13 Thread Hubert Sokolowski

Hi!

I add a text column to GtkTreeView using code
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (col_titles[i],
   renderer,
   text,
   cols[i],
   NULL);
gtk_tree_view_column_set_sort_column_id (column, cols_sort[i]);
gtk_tree_view_append_column (treeview, column);

is there a way to display the text in such a column aligned to the right?

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


Re: how to align text to right in GtkCellRendererText

2005-03-13 Thread Hubert Sokolowski
 On Mon, Mar 14, 2005 at 08:16:36AM +0100, Hubert Sokolowski wrote:

 renderer = gtk_cell_renderer_text_new ();
 column = gtk_tree_view_column_new_with_attributes (col_titles[i],
renderer,
text,
cols[i],
NULL);
 gtk_tree_view_column_set_sort_column_id (column, cols_sort[i]);
 gtk_tree_view_append_column (treeview, column);

 is there a way to display the text in such a column aligned to the
 right?

 Set renderer xalign property to 1.0.

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


entering date

2005-02-25 Thread Hubert Sokolowski

Hi!

I use GtkCalendar for choosing date. But I also want to let user enter
date by  hand using only the keyboard. Is there such a widget that parses
and validates the date that was entered by user?

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


keyboard shortcut on entry

2005-02-25 Thread Hubert Sokolowski

Hi!

I need to execute my function when Left arrow key was pressed in GtkEntry.
I can add accelerator for GtkEntry widget that can emit some signal. But I
don't want to emit a signal, just run my function. how to do that?

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