[Glade-users] Click Button send text to List : Problem (Sorry sent plain text first one and it may be unreadable)



Hi Dave, 

I'm a rookie my self, but I'll tell you what I've figured out, I'm using 
GLADE 0.5.11

The only file I'm edited in my programs is the callbacks.c.  I had to modify 
the main window once because it opened all the dialog boxes at the wrong 
start of the program, but that's the only time.  (though I haven't compleated 
a progject yet.


I haven't messed with the GtkCombo box yet, but here is what my book says the 
code should be...

gchar * selectedvalue;
selectedvalue = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(combo) -> entry));

I think you were missing the  ' ->entry' part.


If this doesn't help you, I try getting it to work on my end and help you 
out.  I'm been able to get all the other widgets to work for me for the most 
part.

My book that I'm using, which is really good for my level is titled

Beginning GTK+/Gnome Programming, by Peter Wright

it has a glade tutor which shows you how to make a simple calculater.  There 
is a bunch of sample code, which you can get online, www.wrox.com.

Another useful resorce is the the GTK+ resference web page,
http://developer.gnome.org/doc/API/gtk/index.html


Hope that helps,
-jeff







On Monday 09 July 2001 22:51, you wrote:

I thought I could figure this out, I have a little background in C
programming, but I can't figure out what to do. Seems that most
tutorials I find must be using an older version of Glade (using
glade-0.6.2-1mdk).

I am using Glade to build the interface, I have been able to print  out
text in a combo box if I open with a terminal, the text will print
out.  I have tried numerous examples but can't make it print to the
list  widget. From most stuff I read it says to edit the  CALLBACK.C
file.  I  have shown one part of it below, with the print part left out
that I had  in before.
-----------------------------------------------------------------

void
on_man_ok_button_clicked               (GtkButton       *button,
                                                              gpointer
      user_data)
{
  GtkWidget *combo_man_entry;
  gchar *man_cmd;
  combo_man_entry = lookup_widget(GTK_WIDGET(button), "combo_man_entry");
  man_cmd = gtk_entry_get_text(GTK_ENTRY(combo_man_entry));


}

----------------------------------------------------------------

Could someone please help me on what to do next. Do I have to edit
another file? Add another signal and handler for the  Less (ie List)
Widget? I so, how do I tie it back to the specific button clicked?

I have several buttons that do the same thing, they take a command that
I have listed in a ComboBox Widget , when the specific OkButton  Widget
is pressed it is  suppose to send it to the List Widget I created. It
will never show, I have never gotten anything to show up in  the List
Widget.

Help Please.  Thanks.

----------------------------------------
Content-Type: message/rfc822; charset="us-ascii"; name="Click Button send 
text to List : Problem"
Content-Transfer-Encoding: 7bit
Content-Description: 
----------------------------------------





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