GtkEntry in GtkCList
- From: "VijayaKumar S. Kale" <vsk telco co in>
- To: gtkl <gtk-list gnome org>,	"gtk-app-devel-list gnome org" <gtk-app-devel-list gnome org>
- Subject: GtkEntry in GtkCList
- Date: Sun, 14 Jan 2001 19:10:30 +0530
Hello all,
Can I have GtkEntry in GtkCList at perticular row and column?
though I can not add any widget in GtkEntry using
gtk_container_add( clist, widget );
Is there any work around method to add widget to clist?
I want to provide cell editing of gtkclist in my application.
I have tried to add widget, the same way title buttons are added to
clist,
but not working.
static void
add_entry_to_clist( GtkWidget *clist, gint x, gint y,  gint width,  gint
height )
{
        GdkWindowAttr attributes;
        attributes.window_type = GDK_WINDOW_CHILD;
        attributes.x = widget->x;
        attributes.y = widget->y;
        attributes.width =  width;
        attributes.height =  height;
        attributes.wclass = GDK_INPUT_OUTPUT;
        attributes.visual = gtk_widget_get_visual ( clist );
        attributes.colormap = gtk_widget_get_colormap ( clist );
        attributes.event_mask = gtk_widget_get_events ( clist );
        attributes.event_mask |= (GDK_EXPOSURE_MASK |
                                               GDK_BUTTON_PRESS_MASK |
                                               GDK_BUTTON_RELEASE_MASK |
                                               GDK_KEY_PRESS_MASK |
                                               GDK_KEY_RELEASE_MASK);
        attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL |
GDK_WA_COLORMAP;
        GdkWindow *entry_window = gdk_window_new (clist->window,
&attributes,  attributes_mask);
        gdk_window_set_user_data (entry_window, clist);
        gdk_window_show (entry_window);
        GtkWidget *entry;
        gtk_widget_push_composite_child ();
        entry = gtk_entry_new ();
        gtk_widget_set_usize( entry, width, height );
        gtk_widget_set_uposition( entry, 0, 0 );
        gtk_widget_pop_composite_child ();
        if (GTK_WIDGET_REALIZED (clist)  &&  entry_window)
                gtk_widget_set_parent_window ( entry,  entry_window);
        gtk_widget_set_parent (entry,  clist );
        gtk_widget_show (entry);
}
Above code only shows me a black gdkwindow at given x, y with given
width and height,
but my gtkentry is not showing.
Does anybody added widget to gtkclist?
any type of help will be greately appreciated.
Thanx in advance.
--
---------------------------------------------------------------------
        VIJAYKUMAR S. KALE
ESG, TTIL, Telco Campus,PUNE - 411 018
email:  vskale telco co in
phone:  (off.)  +91-212-7402049 (Direct)
                +91-212-7402947 (Direct)
        (resi.) +91-212-4358085
----------------------------------------------------------------------
~
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]