[Glade-users] novice at glade + gnome



I am a novice at using GTK with Glade. I was wondering if anyone knew of an=
 =
example or how to use/manipulate a table.
I need a way where the user can enter n number of information onto the =
table. Is there a table widget I missed=3F I thought there was one.=20

-----Original Message-----
=46rom: glade-users-admin lists ximian com
[mailto:glade-users-admin lists ximian com]On Behalf Of
glade-users-request lists ximian com
Sent: Friday, August 27, 2004 6:31 AM
To: glade-users lists ximian com
Subject: Glade-users digest, Vol 1 #379 - 3 msgs


Send Glade-users mailing list submissions to
        glade-users lists ximian com

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.ximian.com/mailman/listinfo/glade-users
or, via email, send a message with subject or body 'help' to
        glade-users-request lists ximian com

You can reach the person managing the list at
        glade-users-admin lists ximian com

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Glade-users digest..."


Today's Topics:

   1. glade + guppi / glade + gnome canvas (weeliat ong)
   2. Making labels sensitive to click and setting signal
       handler (Sam Jiang)

--__--__--

Message: 1
Date: Thu, 26 Aug 2004 09:37:11 -0700 (PDT)
=46rom: weeliat ong <owl1sg yahoo com>
To: glade-users lists ximian com
Subject: [Glade-users] glade + guppi / glade + gnome canvas

--0-690820007-1093538231=3D:559
Content-Type: text/plain; charset=3Dus-ascii

Dear All,
=20
I am new to glade but i have tried and coded some simple UIs.  One thing =
that i am trying to do is to plot a path taken by a toy car with position =
=66eedback.  I think i can use gnome canvas but is there any examples =
available for me to take a look.  I am not sure how to start off.. as in do=
 =
i need to create an item/group etc...
=20
One other thing is how can i use guppi with glade=3F Has anyone successfull=
y=
 did that=3F  I think guppi might be really useful for my task but i can ye=
t=
 to find an example code to study.  Can anyone enlighten me=3F
=20
Thanks
=20
wl

        =09
---------------------------------
Do you Yahoo!=3F
Win 1 of 4,000 free domain names from Yahoo! Enter now.
--0-690820007-1093538231=3D:559
Content-Type: text/html; charset=3Dus-ascii

<DIV>Dear All,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I am new to glade but i have tried and coded some simple UIs.&nbsp; On=
e=
 thing that i am trying to do is to plot a path taken by a toy car with =
position feedback.&nbsp; I think i can use gnome canvas but is there any =
examples available for me to take a look.&nbsp; I am not sure how to start =
off.. as in do i need to create an item/group etc...</DIV>
<DIV>&nbsp;</DIV>
<DIV>One other thing is how can i use guppi with glade=3F Has anyone =
successfully did that=3F&nbsp; I think guppi might be really useful for my =
task but i can yet to find an example code to study.&nbsp; Can anyone =
enlighten me=3F</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks</DIV>
<DIV>&nbsp;</DIV>
<DIV>wl</DIV><p>
                <hr size=3D1>Do you Yahoo!=3F<br>
Win 1 of 4,000 free domain names from Yahoo! <a
href=3D"http://us.rd.yahoo.com/evt=3D26640/*http://promotions.yahoo.com/gol=
drush">Enter=
 now</a>.
--0-690820007-1093538231=3D:559--

--__--__--

Message: 2
Date: Fri, 27 Aug 2004 10:47:15 +0800
=46rom: Sam Jiang <jiangjinke 163 com>
To: glade-users lists ximian com
Subject: [Glade-users] Making labels sensitive to click and setting signal
 handler

This is a multi-part message in MIME format.
--------------020901010203040509000700
Content-Type: text/plain; charset=3Dus-ascii; format=3Dflowed
Content-Transfer-Encoding: 7bit


Hi Janmejay,

you can use the following way to set a callback for click
<pre>

   GtkWidget *eventbox;
   GtkWidget *label;
   g_signal_connect ((gpointer) label, "button_press_event",
                     G_CALLBACK (on_label_button_press_event),
                     NULL);
   //be sure to use this if you use only a label,  or you can just add a
   //label to eventbox, eventbox also has this button_press_event
   gtk_label_set_selectable (GTK_LABEL (label), TRUE);

//the callback function
gboolean
on_label_button_press_event           (GtkWidget       *widget,
                                        GdkEventButton  *event,
                                        gpointer         user_data)
{
   //TODO: add you own code here.
   /* you can think that click_event is a button_press_event follow by
      a button_release_event, here you can change a flag that indicates
      the button has been pressed, then process the button_release_event
      to complete a click event callback.
    */

   return FALSE;
}

</pre>

=66or a full event types of GDK, you can refer to the
appendix B in gtk tutorial=20
(http://www.gtk.org/tutorial/app-gdkeventtypes.html)

I've also attached an example code,

Regards,
Sam Jiang

--------------020901010203040509000700
Content-Type: text/x-c;
 name=3D"labeltest.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename=3D"labeltest.c"

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
                                                                           =
 =
   =20
#include <gtk/gtk.h>

/* this program shows how to process button_press_event of eventbox and =
label=20
 * NOTE: THIS PROGRAM IS FOR TEST ONLY, THERE IS ABSOLUTELY NO=20
 * WARRANTY FOR THIS PROGRAM.
 *
 * author: jiangjinke_at_163_dot_com_spam
 *
 * filename: labeltest.c
 * compile with:=20
 * gcc -Wall -O `pkg-config --cflags gtk+-2.0 glib-2.0 \
 * --libs gtk+-2.0 glib-2.0` labeltest.c -o labeltest
 */
gboolean button_pressed=3DFALSE;
gboolean
on_Labeltest_delete_event               (GtkWidget       *widget,
                                         GdkEvent        *event,
                                         gpointer         user_data)
{
  gtk_main_quit();
  return FALSE;
}
                                                                           =
 =
   =20
gboolean
on_Labeltest_destroy_event             (GtkWidget       *widget,
                                        GdkEvent        *event,
                                        gpointer         user_data)
{
  return FALSE;
}
                                                                           =
 =
   =20
gboolean
on_label_button_press_event           (GtkWidget       *widget,
                                       GdkEventButton  *event,
                                       gpointer         user_data)
{
  g_print("label\n");
  button_pressed=3DTRUE;
  return FALSE;
}

gboolean
on_label_button_release_event           (GtkWidget       *widget,
                                         GdkEventButton  *event,
                                         gpointer         user_data)
{
  g_print("released\n");
  if(button_pressed=3D=3DTRUE)
  {
    g_print("clicked\n");
  }
  return FALSE;
}

gboolean
on_eventbox_event                     (GtkWidget       *widget,
                                       GdkEventButton  *event,
                                       gpointer         user_data)
{
  g_print("eventbox\n");
  return FALSE;
}

GtkWidget*
create_Labeltest (void)
{
  GtkWidget *Labeltest;
  GtkWidget *eventbox;
  GtkWidget *label_inside_eventbox;
  GtkWidget *label_outside_eventbox;
  GtkWidget *vbox;

  Labeltest =3D gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (Labeltest), "Label Test");
  gtk_window_set_position (GTK_WINDOW (Labeltest), GTK_WIN_POS_CENTER);
  gtk_window_set_resizable (GTK_WINDOW (Labeltest), FALSE);
  gtk_window_set_destroy_with_parent (GTK_WINDOW (Labeltest), TRUE);

  eventbox =3D gtk_event_box_new ();
  gtk_widget_show (eventbox);

  vbox =3D gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox);
  gtk_box_pack_start(GTK_BOX(vbox), eventbox, TRUE, TRUE, 0);

  gtk_container_add (GTK_CONTAINER (Labeltest), vbox);

  label_inside_eventbox =3D gtk_label_new ("label in eventbox!!!");
  gtk_widget_show (label_inside_eventbox);
  gtk_container_add (GTK_CONTAINER (eventbox), label_inside_eventbox);

  label_outside_eventbox =3D gtk_label_new("label outside box!!!");
  gtk_widget_show (label_outside_eventbox);

  gtk_box_pack_start(GTK_BOX(vbox), label_outside_eventbox, TRUE, TRUE, 0);
  gtk_label_set_selectable (GTK_LABEL (label_outside_eventbox), TRUE);

  gtk_container_add (GTK_CONTAINER (Labeltest), label_outside_eventbox);
   =20
  g_signal_connect ((gpointer) Labeltest, "delete_event",
                    G_CALLBACK (on_Labeltest_delete_event),
                    NULL);
  g_signal_connect ((gpointer) Labeltest, "destroy_event",
                    G_CALLBACK (on_Labeltest_destroy_event),
                    NULL);
  g_signal_connect ((gpointer) label_outside_eventbox, "button_press_event",
                    G_CALLBACK (on_label_button_press_event),
                    NULL);
  g_signal_connect ((gpointer) label_outside_eventbox, =
"button_release_event",
                    G_CALLBACK (on_label_button_release_event),
                    NULL);

  g_signal_connect ((gpointer) eventbox, "button_press_event",
                    G_CALLBACK (on_eventbox_event),
                    NULL);

  return Labeltest;
}

int
main (int argc, char *argv[])
{
  GtkWidget *Labeltest;
                                =20
  gtk_init (&argc, &argv);
  Labeltest =3D create_Labeltest ();
  gtk_widget_set_size_request (Labeltest, 200, 100);
  gtk_widget_show (Labeltest);
                                                                           =
 =
   =20
  gtk_main ();
  return 0;
}


--------------020901010203040509000700--



--__--__--

_______________________________________________
Glade-users mailing list
Glade-users lists ximian com
http://lists.ximian.com/mailman/listinfo/glade-users


End of Glade-users Digest


=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
The contents of this message, together with any attachments, are intended =
only for the use of the person(s) to which they are addressed and may =
contain confidential and/or privileged information. Further, any medical =
information herein is confidential and protected by law. It is unlawful for=
 =
unauthorized persons to use, review, copy, disclose, or disseminate =
confidential medical information. If you are not the intended recipient, =
immediately advise the sender and delete this message and any attachments. =
Any distribution, or copying of this message, or any attachment, is =
prohibited.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]