Re: Accessors vs Properties

2017-01-05 Thread Debarshi Ray
On Tue, Jan 03, 2017 at 10:46:13PM +0100, Tobias Knopp wrote:
> - Is any accessor backuped with a property and vice versa?

Nicola already answered this.

> - Which one is to prefer?

It depends.

For simple setting and getting of values from C, I prefer the
accessors because (a) it lets the compiler do some minimal type
checking (b) accessors are more efficient at returning a C string than
g_object_get. However, you need properties if you want to have a
'parametrized constructor'. ie. pass arguments to a *_new function.

Properties are more convenient from higher-level languages. eg., in
JavaScript, you can use my_obj.prop to access a property.

They also offer extra features:

(a) You can bind a property on one object to another property
elsewhere (see g_object_bind_property*).

(b) Every property comes with its own 'notify' signal that you can use
to listen for changes.

(c) They can be introspected at run-time, which is very useful if you
are writing a tool like the gtk+ inspector, glade or d-feet.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Own Actionable widget

2016-06-09 Thread Debarshi Ray
Hey,

On Tue, Jun 07, 2016 at 08:39:33AM +0200, Ondrej Tuma wrote:
> i try to create my own Actionable widget, but I can't found, how can i
> call the action. When i see source code of other Actionable widgets, i
> found ActionHelper object, which is not documented.

GtkActionHelper is a private class.

Did you look at:
 * g_action_activate
 * gtk_widget_get_action_group
 * gtk_widget_insert_action_group

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


Re: GTK newbie help on G_CALLBACK

2012-05-07 Thread Debarshi Ray
 button = gtk_button_new_with_label (B1);
 
 /* When the button is clicked, we call the callback function
  * with a pointer to button 1 as its argument */
 g_signal_connect (button, clicked,
   G_CALLBACK (callback), (gpointer) B1);

Should be ... G_CALLBACK (callback), button);

 What I want to do is callback to execute another gtk file

What do you mean by execute another gtk file? You don't execute files. You
execute functions.

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

Re: GTK newbie help on G_CALLBACK

2012-05-07 Thread Debarshi Ray
On Mon, May 07, 2012 at 09:06:05AM +, Debarshi Ray wrote:
  button = gtk_button_new_with_label (B1);
  
  /* When the button is clicked, we call the callback function
   * with a pointer to button 1 as its argument */
  g_signal_connect (button, clicked,
G_CALLBACK (callback), (gpointer) B1);
 
 Should be ... G_CALLBACK (callback), button);

Sorry, I misread! Ignore this part. :-)

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

Re: Timed Display of a Dialog

2010-04-15 Thread Debarshi Ray
 Is it possible to display a dialog for a timed interval (a few seconds) and
 have it auto-self-destruct?  If so, please describe the method(s) of such.

You can hide the dialog in a signal handler register using the g_timeout_* API.

Happy hacking,
Debarshi

-- 
Nearly all men can stand adversity, but if you want to test a man's
character, give him power.
-- Abraham Lincoln
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Hover decorations in GtkIconView

2010-03-26 Thread Debarshi Ray
I have a custom GtkCellRendererPixbuf which I am using to render some
thumbnails in a GtkIconView. Now when the mouse passes over a rendered
thumbnail I want to slightly highlight/decorate it. As far as I can
understand from the documentation my render_vfunc should get
GTK_CELL_RENDERER_PRELIT in the flags parameter when the mouse passes
over.

However, the only value that I am getting are 0 and 1 (ie.
GTK_CELL_RENDERER_SELECTED).

Any idea how to do this?

Thanks,
Debarshi
-- 
One reason that life is complex is that it has a real part and an
imaginary part.
-- Andrew Koenig
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Hover decorations in GtkIconView

2010-03-26 Thread Debarshi Ray
 I don't think items in icon view can be in prelit state. They are
 either selected or not. You'll probably need to create custom icon
 view widget to get on-hover effect.

Can this be accomplished with a custom GtkIconView or do I need to
write it from scratch?

Thanks,
Debarshi
-- 
One reason that life is complex is that it has a real part and an
imaginary part.
-- Andrew Koenig
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: threading choices

2010-03-02 Thread Debarshi Ray
 If your programming language
 uses exceptions, remember that leave() call should be inside
 try..finally cleanup, else this will cause deadlocks if an exception
 is thrown in-between.

If you take C++ as an instance of a programming language with
exceptions, then Glibmm offers Glib::Dispatcher for inter-thread
communication.

Cheers,
Debarshi
-- 
One reason that life is complex is that it has a real part and an
imaginary part.
-- Andrew Koenig
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Showing GtkButton in table view

2009-12-22 Thread Debarshi Ray
 Is there a way to show a standard GtkButton in a table view. I can find
 examples for toggle buttons but  I want a standard button in each row.

Try writting your own GtkCellRenderer.

Cheers,
Debarshi
-- 
One reason that life is complex is that it has a real part and an
imaginary part.
-- Andrew Koenig
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list