specify which child widget to be on top in GtkFixed?!

2010-02-09 Thread ferar achkar
greetings,
I'm having trouble with GtkFixed and their children, how can I specify
which child widget to be on top. In the code snippet below no matter
were I create the TextEntry it always get drawn on top of the other
widgets! how can specify which child widget to be on top of the others
at run time / or at  compile time.
regards,
ferar

/***
*   Copyright (C) 2009 by ferar   *
*   fe...@druid   *
* *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or *
*   (at your option) any later version.   *
* *
*   This program is distributed in the hope that it will be useful,   *
*   but WITHOUT ANY WARRANTY; without even the implied warranty of*
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *
*   GNU General Public License for more details.  *
* *
*   You should have received a copy of the GNU General Public License *
*   along with this program; if not, write to the *
*   Free Software Foundation, Inc.,   *
*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. *
***/

#include gtk/gtk.h
#include string
using namespace std;
GtkWidget* fixedviewo = NULL;
GtkWidget* FocusEntry = NULL;
GtkWidget* next_cache_page = NULL;
GtkWidget* prev_cache_page = NULL;
gint x=5;
gint y=5;
gint x2=5;

gboolean OnLabelButtonPress ( GtkWidget   *widget, 
GdkEventButton  *event, gpointer user_data )
{

// GList *children = gtk_container_get_children ( GTK_CONTAINER (
fixedviewo ) );
//
// while ( children )
// {
// string typeo (g_type_name( GTK_WIDGET_TYPE( children-data ) ));
// if(typeo == GtkButton)
// {
// gint xx, yy;
// gdk_window_get_origin(((GtkWidget*)( children-data
))-window,xx,yy);
// const gchar* labelo = gtk_button_get_label ((GtkButton*)(
children-data )) ;
// printf(Type: %s, Label is: %s\n,typeo.c_str(), labelo);
// }
//
// children = g_list_next ( children );
// }
x+=4;
x2+=6;
gtk_fixed_move ( GTK_FIXED ( fixedviewo ), next_cache_page, x++, y++ );
gtk_fixed_move ( GTK_FIXED ( fixedviewo ), prev_cache_page, x2, y );
return FALSE;
}

int
main ( intargc,
   char **argv )
{
/* Initialization */
gtk_init ( argc, argv );

GtkWidget* splash_widget = gtk_window_new ( GTK_WINDOW_TOPLEVEL );
gtk_window_set_position ( GTK_WINDOW ( splash_widget ),
GTK_WIN_POS_CENTER_ALWAYS );
gtk_window_set_gravity ( GTK_WINDOW ( splash_widget ),
GDK_GRAVITY_CENTER );
g_signal_connect ( G_OBJECT ( splash_widget ), destroy, G_CALLBACK
( gtk_main_quit ), NULL );
GtkWidget* vbox = gtk_vbox_new ( FALSE, 0 );
gtk_container_add ( ( GtkContainer* ) splash_widget, vbox );
GtkWidget* progress_spitout = gtk_button_new_with_label ( move the
buttons up );
g_signal_connect ( ( gpointer ) progress_spitout, pressed,
   G_CALLBACK ( OnLabelButtonPress ),
   NULL );
fixedviewo = gtk_fixed_new ();
gtk_widget_show ( fixedviewo );
gtk_container_add ( GTK_CONTAINER ( vbox ), fixedviewo );

FocusEntry = gtk_entry_new ();
gtk_fixed_put ( GTK_FIXED ( fixedviewo ), FocusEntry, 10, 0 );

prev_cache_page = gtk_button_new_with_label ( GTK_STOCK_GO_BACK );
gtk_fixed_put ( GTK_FIXED ( fixedviewo ), prev_cache_page, 30, 0 );
// gtk_widget_set_size_request ( prev_cache_page, 60, 26 );
gtk_widget_show ( prev_cache_page );

next_cache_page = gtk_button_new_from_stock ( GTK_STOCK_GO_FORWARD );
gtk_fixed_put ( GTK_FIXED ( fixedviewo ), next_cache_page, 100, 0 );
// gtk_widget_set_size_request ( next_cache_page, 60, 26 );
gtk_widget_show ( next_cache_page );




gtk_container_add ( GTK_CONTAINER ( vbox ), progress_spitout );

gtk_widget_show_all ( splash_widget );

gtk_main();

return ( 0 );
}

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


Re: specify which child widget to be on top in GtkFixed?!

2010-02-09 Thread Tristan Van Berkom
Widgets dont overlap in GTK+, instead one widget is packed into another
widget and sits along side other widgets inside its container - who packs
them in a way that they will not overlap.

FYI, GtkFixed is a special case widget you dont want to be using if your
application has any resize capabilities at all (yes, GtkFixed places widgets
on top of eachother when you forgot to place them with enough space between
them, because GtkFixed assumes you are using all the width/height available;
but there is no conceptual Z coordinate).

If you need to have widgets that overlap, you might consider using a canvas
api (like goocanvas for instance), or maybe use clutter.

Cheers,
  -Tristan

On Tue, Feb 9, 2010 at 9:21 AM, ferar achkar fachkar.dataw...@gmail.com wrote:
 greetings,
 I'm having trouble with GtkFixed and their children, how can I specify
 which child widget to be on top. In the code snippet below no matter
 were I create the TextEntry it always get drawn on top of the other
 widgets! how can specify which child widget to be on top of the others
 at run time / or at  compile time.
 regards,
 ferar

 /***
 *   Copyright (C) 2009 by ferar   *
 *   fe...@druid   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***/

 #include gtk/gtk.h
 #include string
 using namespace std;
 GtkWidget* fixedviewo = NULL;
 GtkWidget* FocusEntry = NULL;
 GtkWidget* next_cache_page = NULL;
 GtkWidget* prev_cache_page = NULL;
 gint x=5;
 gint y=5;
 gint x2=5;

 gboolean OnLabelButtonPress ( GtkWidget       *widget,
 GdkEventButton  *event,     gpointer         user_data )
 {

 //     GList *children = gtk_container_get_children ( GTK_CONTAINER (
 fixedviewo ) );
 //
 //     while ( children )
 //     {
 //         string typeo (g_type_name( GTK_WIDGET_TYPE( children-data ) ));
 //         if(typeo == GtkButton)
 //         {
 //             gint xx, yy;
 //             gdk_window_get_origin(((GtkWidget*)( children-data
 ))-window,xx,yy);
 //             const gchar* labelo = gtk_button_get_label ((GtkButton*)(
 children-data )) ;
 //             printf(Type: %s, Label is: %s\n,typeo.c_str(), labelo);
 //         }
 //
 //         children = g_list_next ( children );
 //     }
    x+=4;
    x2+=6;
    gtk_fixed_move ( GTK_FIXED ( fixedviewo ), next_cache_page, x++, y++ );
    gtk_fixed_move ( GTK_FIXED ( fixedviewo ), prev_cache_page, x2, y );
    return FALSE;
 }

 int
 main ( int    argc,
       char **argv )
 {
    /* Initialization */
    gtk_init ( argc, argv );

    GtkWidget* splash_widget = gtk_window_new ( GTK_WINDOW_TOPLEVEL );
    gtk_window_set_position ( GTK_WINDOW ( splash_widget ),
 GTK_WIN_POS_CENTER_ALWAYS );
    gtk_window_set_gravity ( GTK_WINDOW ( splash_widget ),
 GDK_GRAVITY_CENTER );
    g_signal_connect ( G_OBJECT ( splash_widget ), destroy, G_CALLBACK
 ( gtk_main_quit ), NULL );
    GtkWidget* vbox = gtk_vbox_new ( FALSE, 0 );
    gtk_container_add ( ( GtkContainer* ) splash_widget, vbox );
    GtkWidget* progress_spitout = gtk_button_new_with_label ( move the
 buttons up );
    g_signal_connect ( ( gpointer ) progress_spitout, pressed,
                       G_CALLBACK ( OnLabelButtonPress ),
                       NULL );
    fixedviewo = gtk_fixed_new ();
    gtk_widget_show ( fixedviewo );
    gtk_container_add ( GTK_CONTAINER ( vbox ), fixedviewo );

    FocusEntry = gtk_entry_new ();
    gtk_fixed_put ( GTK_FIXED ( fixedviewo ), FocusEntry, 10, 0 );

    prev_cache_page = gtk_button_new_with_label ( GTK_STOCK_GO_BACK );
    gtk_fixed_put ( GTK_FIXED ( fixedviewo ), prev_cache_page, 30, 0 );
 //     gtk_widget_set_size_request ( prev_cache_page, 60, 26 );
    gtk_widget_show ( prev_cache_page );

    next_cache_page = gtk_button_new_from_stock ( 

GLib 2.23.3 released

2010-02-09 Thread Matthias Clasen
GLib 2.23.3 is now available for download at:

  ftp://ftp.gtk.org/pub/glib/2.23/
  http://download.gnome.org/sources/glib/2.23/

md5 sums:
c7b0f512892c5459e42b378762eec5b6  glib-2.23.3.tar.bz2
c57e3c75e98d333dc0efa6edd97ea6c9  glib-2.23.3.tar.gz

sha1 sums:
9ba908954fbcab7f8b74faf483f83b7ef8d28cf9  glib-2.23.3.tar.bz2
69cfd1221ed731e1e561e2f783c415a948255260  glib-2.23.3.tar.gz

This is the a development release leading up to GLib 2.24.

Notes:

 * This is unstable development release. While it has had
  a bit of testing, there are certainly plenty of bugs
  remaining to be found. This release should not be used
  in production.

 * Installing this version will overwrite your existing
  copy of GLib 2.22. If you have problems, you'll need
  to reinstall GLib 2.22.

 * GLib 2.24 will be source and binary compatible with
  the GLib 2.22 series; however, the new API additions
  in GLib 2.23 are not yet finalized, so there may be
  incompatibilities between this release and the final
  2.24 release.

 * Bugs should be reported to http://bugzilla.gnome.org.


About GLib
==

GLib is the low-level core library that forms the basis for projects
such as GTK+ and GNOME. It provides data structure handling for C,
portability wrappers, and interfaces for such runtime functionality as
an event loop, threads, dynamic loading, and an object system.

More information about GLib is available at:

 http://www.gtk.org/

An installation guide for the GTK+ libraries, including GLib, can
be found at:

 http://developer.gnome.org/doc/API/2.0/gtk/gtk-building.html


Overview of Changes from GLib 2.23.2 to GLib 2.23.3
===

* GLib now has a facility for locks that consume only one bit of
  storage inside an integer: g_bit_lock()

* GVariant: The serializer has been merged, with more API to follow

* Bugs fixed
 548967 1 bit mutex lock
 604967 2.22.3 libasyncns build fails on HP-UX 11.11
 608602 G_VALUE_COLLECT_INIT variables shadow those in G_VALUE_COLLECT
 608743 Crash in g_hostname_to_ascii visiting certain website...
 599197 array ref and unref functions crash on NULL array.
 608159 mem leak in g_io_modules_scan_all_in_directory

* Translation updates
 Brazilian Portuguese
 Czech
 French
 Norwegian bokmål
 Slovenian
 Spanish
 Thai

Thanks to all contributors:
Martin Pitt
Javier Jardón
Christian Dywan
Behdad Esfahbod
Ryan Lortie
Andre Klapper
Philip Withnall
Dan Winship
Tor Lillqvist
River Tarnell
Krzesimir Nowak
Hans Breuer
Tim-Philipp Müller


February 9, 2010
Matthias Clasen


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

Regarding GTK Entry keys

2010-02-09 Thread AshokKumar G
Hi,
 I am new to GTK+ programming. I have created a test application
with GtkEntry on embedded system based on ARM and backend target is
DirectFB-1.2.9. I am able to enter the text into GtkEntry field. But when I
use BackSpace, Delete, Arrow Keys (left or right for navigation), no action
is taken. In my test application I have registered call back key-press-event
to verify whether event is coming or not, when I press backspace the event
is coming and I am returning FALSE from that call back function. But no
character is getting deleted on backspace/delete key press.
 But when I run my same test application on PC GTK+same version with
backend target X11, then all the actions are performing as expected.
 Could some one help me on this?

Thanks  Regards,
AshokKumar.G
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


RE: How I can do Double Buffer whether OpenGl Ext?

2010-02-09 Thread Shawn Bakhtiar


From the logo example:


/*
 * Configure OpenGL-capable visual.
 */

/* Try double-buffered visual */
glconfig = gdk_gl_config_new_by_mode (GDK_GL_MODE_RGB|
  GDK_GL_MODE_DEPTH  |
  GDK_GL_MODE_DOUBLE);
if (glconfig == NULL)
{
g_print (*** Cannot find the double-buffered visual.\n);
g_print (*** Trying single-buffered visual.\n);

/* Try single-buffered visual */
glconfig = gdk_gl_config_new_by_mode (GDK_GL_MODE_RGB   |
  GDK_GL_MODE_DEPTH);
if (glconfig == NULL)
{
g_print (*** No appropriate OpenGL-capable visual found.\n);
exit (1);
}
}

..

/* Set OpenGL-capability to the widget. */
gtk_widget_set_gl_capability (drawing_area,
  glconfig,
  NULL,
  TRUE,
  GDK_GL_RGBA_TYPE);



This function first tries to create a glconfig using double buffered, if fails, 
uses single buffer). This works on OS X 10.6 Snow Leopard. 




 EMAILING FOR THE GREATER GOOD
Join me

 Date: Tue, 9 Feb 2010 04:41:12 -0300
 Subject: How I can do Double Buffer whether OpenGl Ext?
 From: grojas@gmail.com
 To: gtk-app-devel-list@gnome.org
 
 Hi,
 
 I'm trying to do a double buffer with pixbuf and draw area, whether to use
 OpenGL Ext, but i don't know if it is posible or not.
 
 Any idea?
 
 Thanks.
 
 Gustavo R.
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
  
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list