[Glade-users] Re: Glade-users Digest, Vol 14, Issue 4
- From: roulhs at gmail.com (Dim elef)
- Subject: [Glade-users] Re: Glade-users Digest, Vol 14, Issue 4
- Date: Mon Jun 5 14:59:25 2006
glade-users-request lists ximian com wrote:
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-owner 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. Re: Save as... button (Micah Carrick)
2. Re: Save as... button (Micah Carrick)
3. Destroy and rebuild a treeview widget (Guillaume Ruch)
4. Re: Destroy and rebuild a treeview widget (Mehdi Rabah)
----------------------------------------------------------------------
Message: 1
Date: Sun, 04 Jun 2006 13:03:20 -0700
From: Micah Carrick <email micahcarrick com>
Subject: Re: [Glade-users] Save as... button
To: glade-users lists ximian com
Message-ID: <44833C88 1030401 micahcarrick com>
Content-Type: text/plain; charset="iso-8859-1"
Here's a C/GTK+ snippet showing how I used a save as dialog from glade a
while back...
gchar *
save_file_dialog()
{
GladeXML *gxml=NULL;
GtkWidget *dialog=NULL;
GtkResponseType response;
gchar *glade_file;
gchar *filename = NULL;
/* setup glade */
glade_file = gnome_program_locate_file (NULL,
GNOME_FILE_DOMAIN_APP_DATADIR,
GLADE_FILENAME, TRUE, NULL);
g_assert (glade_file);
gxml = glade_xml_new (glade_file, "file_chooser_dialog", NULL);
g_free (glade_file);
/* setup dialog */
dialog = glade_xml_get_widget (gxml, "file_chooser_dialog");
gtk_window_set_title(GTK_WINDOW(dialog), _("Save File As..."));
gtk_window_set_icon_name (GTK_WINDOW(dialog), "gtk-save");
gtk_file_chooser_set_action(GTK_FILE_CHOOSER(dialog),
GTK_FILE_CHOOSER_ACTION_SAVE);
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(dialog),
get_last_filechooser_path ());
/* present user with a file selection dialog */
response = gtk_dialog_run (GTK_DIALOG (dialog));
if (response == GTK_RESPONSE_OK)
{
filename =
gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
}
save_last_filechooser_path (gtk_file_chooser_get_current_folder(
GTK_FILE_CHOOSER(dialog)));
gtk_widget_destroy(dialog);
return filename;
}
Mehdi Rabah wrote:
You create a FileChooser dialog in glade, and in options you choose as
type action "save"
(also "visible" option to false if you want)
Then you load the widget in your application and call the show() and
run() method of this dialog box.
Finally you get the result of the run() to see the type of action the
user did
There is also a method to see what file was choosen
I have a java gnome example if you want
On 6/1/06, *Dim elef* <roulhs gmail com <mailto:roulhs gmail com>> wrote:
Hi everyone i m new to Glade and i want to ask how can i create a
working "save as" button.
_______________________________________________
Glade-users maillist - Glade-users lists ximian com
<mailto:Glade-users lists ximian com>
http://lists.ximian.com/mailman/listinfo/glade-users
------------------------------------------------------------------------
_______________________________________________
Glade-users maillist - Glade-users lists ximian com
http://lists.ximian.com/mailman/listinfo/glade-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20060604/3cd0994c/attachment-0001.html
------------------------------
Message: 2
Date: Sun, 04 Jun 2006 13:03:41 -0700
From: Micah Carrick <email micahcarrick com>
Subject: Re: [Glade-users] Save as... button
To: glade-users lists ximian com
Message-ID: <44833C9D 1050009 micahcarrick com>
Content-Type: text/plain; charset="iso-8859-1"
Here's a C/GTK+ snippet showing how I used a save as dialog from glade a
while back...
gchar *
save_file_dialog()
{
GladeXML *gxml=NULL;
GtkWidget *dialog=NULL;
GtkResponseType response;
gchar *glade_file;
gchar *filename = NULL;
/* setup glade */
glade_file = gnome_program_locate_file (NULL,
GNOME_FILE_DOMAIN_APP_DATADIR,
GLADE_FILENAME, TRUE, NULL);
g_assert (glade_file);
gxml = glade_xml_new (glade_file, "file_chooser_dialog", NULL);
g_free (glade_file);
/* setup dialog */
dialog = glade_xml_get_widget (gxml, "file_chooser_dialog");
gtk_window_set_title(GTK_WINDOW(dialog), _("Save File As..."));
gtk_window_set_icon_name (GTK_WINDOW(dialog), "gtk-save");
gtk_file_chooser_set_action(GTK_FILE_CHOOSER(dialog),
GTK_FILE_CHOOSER_ACTION_SAVE);
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(dialog),
get_last_filechooser_path ());
/* present user with a file selection dialog */
response = gtk_dialog_run (GTK_DIALOG (dialog));
if (response == GTK_RESPONSE_OK)
{
filename =
gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
}
save_last_filechooser_path (gtk_file_chooser_get_current_folder(
GTK_FILE_CHOOSER(dialog)));
gtk_widget_destroy(dialog);
return filename;
}
- Micah
http://www.micahcarrick.com
Mehdi Rabah wrote:
You create a FileChooser dialog in glade, and in options you choose as
type action "save"
(also "visible" option to false if you want)
Then you load the widget in your application and call the show() and
run() method of this dialog box.
Finally you get the result of the run() to see the type of action the
user did
There is also a method to see what file was choosen
I have a java gnome example if you want
On 6/1/06, *Dim elef* <roulhs gmail com <mailto:roulhs gmail com>> wrote:
Hi everyone i m new to Glade and i want to ask how can i create a
working "save as" button.
_______________________________________________
Glade-users maillist - Glade-users lists ximian com
<mailto:Glade-users lists ximian com>
http://lists.ximian.com/mailman/listinfo/glade-users
------------------------------------------------------------------------
_______________________________________________
Glade-users maillist - Glade-users lists ximian com
http://lists.ximian.com/mailman/listinfo/glade-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20060604/201b232d/attachment-0001.html
------------------------------
Message: 3
Date: Mon, 5 Jun 2006 13:26:22 +0200 (CEST)
From: "Guillaume Ruch" <guillaume ruch infini fr>
Subject: [Glade-users] Destroy and rebuild a treeview widget
To: glade-users lists ximian com
Message-ID: <47803 81 51 213 99 1149506782 squirrel ruch infini fr>
Content-Type: text/plain;charset=iso-8859-1
Hello list,
I finally managed to build a treeview like I needed but now, I've got another trouble : How can I
do to destroy my treeview while clicking a button of my app AND rebuild another treeview with for
example not the same numbers of columns (and of course not the same data ) ???
I use libglade and XML, must I create a treeview in my glade interface or build it from scratch in
my code?? I've tried many ways to do that but now, I think I'll kill this damn penguin on the next
GTK:CRITICAL !!! ;-)
Thanks for answers, this list is great for newbies like me
Friendly,
G.Ruch
------------------------------
Message: 4
Date: Mon, 5 Jun 2006 13:31:55 +0200
From: "Mehdi Rabah" <mehdi rabah gmail com>
Subject: Re: [Glade-users] Destroy and rebuild a treeview widget
To: "Guillaume Ruch" <guillaume ruch infini fr>
Cc: glade-users lists ximian com
Message-ID:
<bb663b520606050431j7dfdd22n9fd72081ac2a7cdf mail gmail com>
Content-Type: text/plain; charset="iso-8859-1"
Hi Guillaume,
I'm quite new to gtk/glade but I understand you can't manage the rows of a
treeview from glade2.
So you have to manage treeViewColumn or dataColumn from within your code,
and if you want to remove/add column, you have to use the method of the
treeView class
hth,
Mehdi
On 6/5/06, Guillaume Ruch <guillaume ruch infini fr> wrote:
Hello list,
I finally managed to build a treeview like I needed but now, I've got
another trouble : How can I
do to destroy my treeview while clicking a button of my app AND rebuild
another treeview with for
example not the same numbers of columns (and of course not the same data )
???
I use libglade and XML, must I create a treeview in my glade interface or
build it from scratch in
my code?? I've tried many ways to do that but now, I think I'll kill this
damn penguin on the next
GTK:CRITICAL !!! ;-)
Thanks for answers, this list is great for newbies like me
Friendly,
G.Ruch
_______________________________________________
Glade-users maillist - Glade-users lists ximian com
http://lists.ximian.com/mailman/listinfo/glade-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20060605/98fb2ca9/attachment.html
------------------------------
_______________________________________________
Glade-users mailing list
Glade-users lists ximian com
http://lists.ximian.com/mailman/listinfo/glade-users
End of Glade-users Digest, Vol 14, Issue 4
******************************************
Thanks a lot Mehdi Rabah and Micah Carrick. Also i want to ask you if
you know any book which talking about java and gtk/glade
thanks
Micah Carrick
Mehdi Rabah
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]