Re: changing colour of widget

2013-10-03 Thread Mahesh Chaudhari
Thanks Vest V for reply 
I can able to draw circles using GtkDrawingArea and cairo 
but is there any alternative to GIO as I have to use CentOS-5.3 (glib version 
2.10) and I think GIO is not supported in this version
  OR 
from where do I install GIO library  
 


 From: Vest V. vest...@gmail.com
To: gtk-app-devel-list@gnome.org gtk-app-devel-list@gnome.org 
Sent: Thursday, 26 September 2013 4:11 AM
Subject: Re: changing colour of widget
  

Hello Mahesh,

It depends on which approach you want to use: draw LEDs manually, or
display images. The first possible widget is GtkDrawingArea:
https://developer.gnome.org/gtk3/3.2/GtkDrawingArea.html,the second is
GtkImage: https://developer.gnome.org/gtk3/3.2/GtkImage.html

Regarding the event: probably you need GIO library (especially the
GFileMonitor: https://developer.gnome.org/gio/unstable/GFileMonitor.html)

Kind regards,
Vlad


On Thu, Sep 26, 2013 at 12:17 PM, Mahesh Chaudhari 
mahesh.chaudh...@ymail.com wrote:

 Hi List,
 I am very new to GTK+ programming and got a task of developing user
 interface (GUI) to one of our embedded board
 I went through basics of GTK searching for any widget that could represent
 on board LEDs, which can glows (basically changes colour)
 Also, is it possible to generate an event whenever file is updated instead
 of user (mouse clicks, keyboard press)


 Any Help
 ___
 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
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: changing colour of widget

2013-10-03 Thread Vest V.
Hello Mahesh,

I did not know that you use the old version. Actually, Gnome VFS is
deprecated, but on your Linux it should be still available. This library
has a similar monitor:
https://developer.gnome.org/gnome-vfs/stable/gnome-vfs-2.0-gnome-vfs-monitor.htmlProbably,
this should suit you the most.
There is also another library that you can try to use:
http://en.wikipedia.org/wiki/Inotify
If you do not want to add additional libraries (I assume there are more
solutions like proposed above), you can write a custom function to get
information about the file in the main loop or in a separate thread. If the
information, such as changed date and size, changes, you can send a custom
event.

Kind regards,
Vlad



On Thu, Oct 3, 2013 at 12:13 PM, Mahesh Chaudhari 
mahesh.chaudh...@ymail.com wrote:

 Thanks Vest V for reply
 I can able to draw circles using GtkDrawingArea and cairo
 but is there any alternative to GIO as I have to use CentOS-5.3 (glib
 version 2.10) and I think GIO is not supported in this version
   OR
 from where do I install GIO library

*From:* Vest V. vest...@gmail.com
 *To:* gtk-app-devel-list@gnome.org gtk-app-devel-list@gnome.org
 *Sent:* Thursday, 26 September 2013 4:11 AM
 *Subject:* Re: changing colour of widget

 Hello Mahesh,

 It depends on which approach you want to use: draw LEDs manually, or
 display images. The first possible widget is GtkDrawingArea:
 https://developer.gnome.org/gtk3/3.2/GtkDrawingArea.html,the second is

 GtkImage: https://developer.gnome.org/gtk3/3.2/GtkImage.html

 Regarding the event: probably you need GIO library (especially the
 GFileMonitor: https://developer.gnome.org/gio/unstable/GFileMonitor.html)

 Kind regards,
 Vlad


 On Thu, Sep 26, 2013 at 12:17 PM, Mahesh Chaudhari 
 mahesh.chaudh...@ymail.com wrote:

  Hi List,
  I am very new to GTK+ programming and got a task of developing user
  interface (GUI) to one of our embedded board
  I went through basics of GTK searching for any widget that could
 represent
  on board LEDs, which can glows (basically changes colour)
  Also, is it possible to generate an event whenever file is updated
 instead
  of user (mouse clicks, keyboard press)
 
 
  Any Help
  ___
  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



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


Re: GSettings on Windows

2013-10-03 Thread Geert Janssens
On Monday 30 September 2013 16:30:11 Geert Janssens wrote:
 I'm working on converting GnuCash from using GConf to GSettings.
 
 I'm currently at a point that the code doesn't call GConf anymore. The
 keys and paths still contain underscores instead of dashes, because
 on linux I'm still testing with gconf as gsettings backend.
 
 On linux this works fine. So I wanted to test the same on our Windows
 port. On that platform I am using the default backend (ie I don't
 explicitly specify a backend). Compilation works fine and the program
 starts, but no settings are stored or loaded from the gsettings
 backend.
 
 As far as I can see, I did everything according to the migration guide
 and I am unsure how to proceed to get this working.
 
 The schema files are found alright. Otherwise the program would have
 crashed. But I don't see a GSettings section appearing in the
 registry. I have created it manually just to test, but no keys are
 stored below it.
 
 GnuCash is using GLib 2.28.8 on Windows. I verified that version comes
 with a gregistrysettings backend. I have no idea though if it's
 actually used.
 
 How to proceed from here ?
 
 Thanks,
 
 Geert
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

A follow-up on my own post...

I got this working. It turns out my the code I wrote to interact with gsettings 
was never called 
on Windows due to an issue that has nothing to do with gsettings.

As soon as I fixed that issue, my gsettings wrapper got used and gsettings 
worked out of the 
box on Windows.

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


Icon/image in menu with GtkUIManager and GtkAction in GTK+ 3.10

2013-10-03 Thread Sébastien Wilmet
Hello,

Since the deprecation of GtkUIManager, GtkAction, GtkStock etc, it seems 
that gtk_action_set_always_show_image() doesn't work anymore.

I don't have the time to port my application to GMenu (and I think some 
features are missing, that I use with GtkUIManager). And I need icons in 
menus. For example some menu items permit to insert international 
accents. The image is really useful to know which accent it is.

To enable icons in menus, I use this code (in Vala):

foreach (Gtk.ActionGroup action_group in ui_manager.get_action_groups ())
{
foreach (Gtk.Action action in action_group.list_actions ())
{
action.set_always_show_image (true);
}
}

It works fine with GTK+ 3.8, but not with GTK+ 3.10.

I openened this bug:
https://bugzilla.gnome.org/show_bug.cgi?id=708651

I hope this is not intentional (which means it is an API break, without 
.so version bump…).

And, if it is intentional, is there another easy way to force to show 
icons in menus? (Without lots of manual code, I mean, because the menu 
is big).

Thanks in advance,
Sébastien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Icon/image in menu with GtkUIManager and GtkAction in GTK+ 3.10

2013-10-03 Thread Allin Cottrell

On Thu, 3 Oct 2013, Sébastien Wilmet wrote:

Since the deprecation of GtkUIManager, GtkAction, GtkStock etc, it seems 
that gtk_action_set_always_show_image() doesn't work anymore.


It's a problem for me too. The following is somewhat tongue-in-cheek 
but pretty accurately reflects my experience as an app developer 
(much as I like GTK and am grateful to its developers).


When some GTK API is marked as deprecated we understand this to 
mean:


This is no longer the recommended way of doing things in GTK. 
Unless hell freezes over it will be gone in the next major-number 
release of GTK. If you have plenty of time on your hands and want 
your application to work with the next major version -- and you 
don't care about maintaining compatibility with older major GTK 
versions (or older minor versions of the current major) -- you 
should start using the newly intoduced and now recommended API in 
newly written code, and figure out how to replace all existing 
instances of calls to the deprecated API at your leisure.


Fair enough, in a sense, but it goes a step beyond if deprecating an 
API is considered a license to make it stop doing what it was 
initially advertised to do, effective immediately. Like Sébastien, I 
hope that's not the case.


--
Allin Cottrell
Department of Economics
Wake Forest University
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

how to label a cairo drawings in gtk+-2.0

2013-10-03 Thread Mahesh Chaudhari
Hi List,
I have drawn five circles in GtkDrawingArea as below :
 
#include gtk/gtk.h
#include cairo.h
#includemath.h

    GtkWidget* window;
    GtkWidget* darea;
static gboolean on_expose_event(GtkWidget *widget, GdkEventExpose *event, 
gpointer data)
    {
    cairo_t *cr;
    cr = gdk_cairo_create(darea-window);
    cairo_arc(cr,50,60,20,0,2*M_PI);
    cairo_arc(cr,110,60,20,0,2*M_PI);
    cairo_arc(cr,170,60,20,0,2*M_PI);
    cairo_arc(cr,230,60,20,0,2*M_PI);
    cairo_arc(cr,300,60,20,0,2*M_PI);
    cairo_set_source_rgba (cr, 0.5, 0, 0, 0.5);
    cairo_fill(cr);
    }
int main(int argc, char **argv)
    {
    gtk_init(argc, argv);
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_default_size(GTK_WINDOW(window), 400, 100);
    darea = gtk_drawing_area_new();
    gtk_container_add(GTK_CONTAINER(window), darea);
    g_signal_connect(darea, expose-event,
  G_CALLBACK(on_expose_event), NULL);

    gtk_widget_show_all(window);
    gtk_main();
    return 0;
    }
 
I want to put label(text) above each circle, Also colour should be change after 
few seconds 
How can I do this ? I have to use CentOS-5.3 which has gtk+-2.10.0 
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list