How can I update the gdk-pixbuf raw data?
Hello, I am new to GTK and have a problem with gdk-pixbuf, How can I update the pixbuf raw data? There is a pixbuf constructed from an image file, I want to change raw data behind it and upload new data back to pixbuf. I am using the gdk_pIxbuf_save_to_buffer for accessing raw data, but I don't know how to upload the buffer back to the pixbuf! Thanks, in advance, Zahra Zojaji ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
gtk_window_parent issues
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm having some real trouble with gtk_window_parent when running other some other window managers like kwin or blackbox or icewm The first call to gtk_window_reparent works, then I remove the parent so I can fullscreen the window and then after I unfullscreen, I try and reparent and this option fails So the code to go fullscreen looks like this if (GTK_WIDGET_MAPPED(window)) gtk_widget_unmap(window); gdk_window_reparent(window-window, NULL, 0, 0); gtk_widget_map(window); gtk_window_fullscreen(GTK_WINDOW(window)); and the code to go back is like this gtk_window_unfullscreen(GTK_WINDOW(window)); while (gtk_events_pending()) gtk_main_iteration(); if (GTK_WIDGET_MAPPED(window)) gtk_widget_unmap(window); gdk_window_reparent(window-window, window_container, 0, 0); gtk_widget_set_parent_window(window,window_container); gtk_widget_map(window); This works perfectly under metacity, fvwm, and xfwm4... but the others I either get the window in the wrong spot or it turns invisible (it acts like it is under the parent window background (the allocate event fires and I get the correct size of the parent window), but can't see it and can't get it to raise. Any ideas as to what I can do, I'm stuck. I've tried using XReparentWindow, XGrabServer, XMapResize and various other things. I have a bug report you can read also (this is for gnome-mplayer, when running under gecko-mediaplayer control) http://code.google.com/p/gecko-mediaplayer/issues/detail?id=14 Kevin - -- Get my public GnuPG key from http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x7D0BD5D1 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iEYEARECAAYFAkoMib4ACgkQ6w2kMH0L1dFhoACeMxKfj2ua+jvM7WZfMLHQBixx kdYAn0KuXsCWFFraAgKYD5zJnNP5KtO8 =rypZ -END PGP SIGNATURE- ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Gtk+ problem with time-consuming threads
You can't use GTK+ from multiple threads on Windows. That is just how it is. It is a consequence of GTK+ originally being written just for X11. I always thought it was because of how the Windows event model works. Yes, exactly. That is what I mean. With its dichotomy of sending and posting of messages, creator thread -aware windows, etc, it is quite different from X11 which is a network protocol. The GTK+ code was written originally only for X11. That it was possible to port it to Windows is in retrospect a bit surprising, I must say, even though I did it myself. (I don't know how toolkits that have been written from scratch with both X11 and Windows in mind (like presumably Qt) then differ in the general working of their low-level machinery, but I assume they do in some significant way.) --tml ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Native file chooser dialog on Windows
Hi all, is there a plan or any activities regarding using the native file chooser on the Windows platform ? Like the print dialog does. There is already an opened bug about this : http://bugzilla.gnome.org/show_bug.cgi?id=319312 Regards, David ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: Native file chooser dialog on Windows
On Thu, 2009-05-14 at 22:46 -0400, David Cantin wrote: Hi all, is there a plan or any activities regarding using the native file chooser on the Windows platform ? Like the print dialog does. There is already an opened bug about this : http://bugzilla.gnome.org/show_bug.cgi?id=319312 I think my comment #4 there says everything that needs to be said. Not sure why Tor hasn't WONTFIX'ed the bug already. - Owen ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: Native file chooser dialog on Windows
David Cantin wrote: Hi all, is there a plan or any activities regarding using the native file chooser on the Windows platform ? Like the print dialog does. There is already an opened bug about this : http://bugzilla.gnome.org/show_bug.cgi?id=319312 If you want to do it yourself, I've found that calling GetOpenFileName or GetSaveFileName in a different thread works fine. Just call g_idle_add to send the result back to the main thread when the win32 function finishes. This allows the win32 dialog to run without blocking expose events on your GTK+ windows. -- Tim Evans Applied Research Associates NZ http://www.aranz.com/ ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
glist manipulation and reference count
hi, I am new to GTK and is currently studying the memory management of GTK. The reference count issue has been nicely described in http://www.gtkforums.com/about2412.html However, one thing that surprised me is that, when I do g_list_append or g_list_prepend, it does not automatically add the reference count of the stored GObject (unlike objective-C). So do I need to explicitly add the reference count each time the GObject is inserted? and reduce the reference count when the object is removed? That seems quite cumbersome to me. Or can I add some function pointer to generalize this? Is there some kind of best practice on this? Tried to Google around, and seems no luck on this. Any advice is appreciated. Thanks a lot -- View this message in context: http://www.nabble.com/glist-manipulation-and-reference-count-tp23552925p23552925.html Sent from the Gtk+ - Dev - General mailing list archive at Nabble.com. ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: glist manipulation and reference count
[Note that your question is probably more appropriate for gtk-app-devel-list or gtk-list; this list is for the development *of* glib/gtk itself, not about developing apps that *use* glib/gtk.] On 05/14/2009 08:47 PM, walty wrote: However, one thing that surprised me is that, when I do g_list_append or g_list_prepend, it does not automatically add the reference count of the stored GObject (unlike objective-C). GList is a generic container that you can put any kind of pointer into. It doesn't know about GObjects or reference counting. In fact libglib (where GList is implemented) doesn't even link to libgobject. So do I need to explicitly add the reference count each time the GObject is inserted? and reduce the reference count when the object is removed? That seems quite cumbersome to me. That depends on how you want to use it. If you can be sure no one else will destroy the object while you're using it in the list, then no, you don't. I've used both glib/gobject and NSArray/NSDictionary/etc., and personally I don't find either approach to be better or worse. I rarely need to increase refcnts on GObjects when I store them in lists, but perhaps others have different use cases that do require this. Or can I add some function pointer to generalize this? Is there some kind of best practice on this? If you add the objects in one shot, you can do something like this after you've added all objects: g_list_foreach(list, (GFunc)g_object_ref, NULL); Of course that iterates over the entire list, so it would be a bit slow on a large list. You can always ref the objects as you insert them, e.g.: list = g_list_append(list, g_object_ref(obj)); Of course you have to do something similar with _unref() when you remove items from the list or destroy the list. -brian ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: glist manipulation and reference count
Hi Brian, Thanks for the reply. I think I had some confusion here, I thought GObject is part of GLib, and apparently that's not true. The scenario is that I need to temporary update the screen, and store the old widgets on the list. So if I did not explicitly add the ref count, the objects would be destroyed once they are removed from parent (even if I stored the object reference in g_list). I think I would use a general helper function for list insert remove then. Just want to make sure I did not miss something obvious. And I would move my future questions to gtk-app-devel-list :P Thanks again. walty Brian J. Tarricone wrote: [Note that your question is probably more appropriate for gtk-app-devel-list or gtk-list; this list is for the development *of* glib/gtk itself, not about developing apps that *use* glib/gtk.] On 05/14/2009 08:47 PM, walty wrote: However, one thing that surprised me is that, when I do g_list_append or g_list_prepend, it does not automatically add the reference count of the stored GObject (unlike objective-C). GList is a generic container that you can put any kind of pointer into. It doesn't know about GObjects or reference counting. In fact libglib (where GList is implemented) doesn't even link to libgobject. So do I need to explicitly add the reference count each time the GObject is inserted? and reduce the reference count when the object is removed? That seems quite cumbersome to me. That depends on how you want to use it. If you can be sure no one else will destroy the object while you're using it in the list, then no, you don't. I've used both glib/gobject and NSArray/NSDictionary/etc., and personally I don't find either approach to be better or worse. I rarely need to increase refcnts on GObjects when I store them in lists, but perhaps others have different use cases that do require this. Or can I add some function pointer to generalize this? Is there some kind of best practice on this? If you add the objects in one shot, you can do something like this after you've added all objects: g_list_foreach(list, (GFunc)g_object_ref, NULL); Of course that iterates over the entire list, so it would be a bit slow on a large list. You can always ref the objects as you insert them, e.g.: list = g_list_append(list, g_object_ref(obj)); Of course you have to do something similar with _unref() when you remove items from the list or destroy the list. -brian ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list -- View this message in context: http://www.nabble.com/glist-manipulation-and-reference-count-tp23552925p23553156.html Sent from the Gtk+ - Dev - General mailing list archive at Nabble.com. ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: glist manipulation and reference count
I think I had some confusion here, I thought GObject is part of GLib, and apparently that's not true. You are confusing GLib and libglib. The GLib software consists of five (shared) libraries: libglib, libgmodule, libgthread, libgobject and libgio. Sure, with hindsight, it perhaps would have made sense to combine the functionality of the first three into one, or even more, but that can't be changed now. The GObject API is in libgobject, so it is part of GLib, but not of libglib. Hope this helps. --tml ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
How to update Gdk-Pixbuf raw data?
Hello, I am using gdk-pixbuf-0.22 and have a problem: How can I update the pixbuf raw data? There Is a pixbuf constructed from an Image file, I want to change raw data behind It and upload new data back to pixbuf. I am using the gdk_pIxbuf_save_to_buffer for accessing raw data, but I don't know how to upload the buffer back to the pIxbuf! Thanks, in advance, Zahra Zojaji -- View this message in context: http://www.nabble.com/How-to-update-Gdk-Pixbuf-raw-data--tp23517225p23517225.html Sent from the Gtk+ - General mailing list archive at Nabble.com. ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
something like system function
Hi, I need something like function system of stdlib.h, but I need to get the output of the command... example: gchar *returned; returned = system(pwd); and returned must be the folder of the program... Gtk, or glib have something like that? -- Abraço, Frederico Schardong, SOLIS - O lado livre da tecnologia www.solis.coop.br ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: something like system function
--- On Thu, 5/14/09, frederico schardong frede@gmail.com wrote: From: frederico schardong frede@gmail.com Subject: something like system function To: gtk-list@gnome.org Date: Thursday, May 14, 2009, 8:47 AM Hi, I need something like function system of stdlib.h, but I need to get the output of the command... example: gchar *returned; returned = system(pwd); and returned must be the folder of the program... Gtk, or glib have something like that? -- Abraço, Frederico Schardong, SOLIS - O lado livre da tecnologia www.solis.coop.br ___ And why should it be done through gtk+/glib and not through standard C library ? Regards, Sergei. ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: something like system function
I need something like function system of stdlib.h, but I need to get the output of the command... popen()? or g_spawn_command_line_sync(). --tml ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Re: Why there's still ONE element left after g_slist_free () ?
Its old hat to C programmers that you set any object to NULL when you're done with it, which returns the memory used to the heap. That's not necessary with languages that have garbage collection like Java, Python, etc. On May 13, 2009 3:56am, PenT pen...@gmail.com wrote: Thanks to Yeti, tml and Pfeiffer, I finally realized what happend to the GSList. May be I'm spoiled by Python, Java that I had the strange SHOULD-BE-NULL thought, now I know if I need to reuse the GSList* variable, the first thing is to assign NULL to it after g_slist_free (), also surprised g_slist_length() didn't gave a segmentation fault to me, aha. ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Re: Why there's still ONE element left after g_slist_free () ?
Its old hat to C programmers that you set any object to NULL when you're done with it, which returns the memory used to the heap. That's not necessary with languages that have garbage collection like Java, Python, etc. Yes and no. One could say that on the contrary, in languages with garbage collection the only way to (implicitly, eventually) free something is to make sure there are no pointers to it, i.e. set the pointers to NULL or to point to something else. There are no explicit free calls. (Of course, such languages generally don't use the term pointer.) --tml ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Why there's still ONE element left after g_slist_free () ?
american.communist.pa...@gmail.com wrote: Its old hat to C programmers that you set any object to NULL when you're done with it, which returns the memory used to the heap. That's specifically /not/ true in C: You have to explicitly free allocated space--setting a pointer to null doesn't automatically do the freeing and, in fact, can simply lose the pointer making it impossible to subsequently free the space. Sometimes it's useful to set the pointer to null /after/ you free the space just as a flag to yourself that you've freed it. That's not necessary with languages that have garbage collection like Java, Python, etc. On May 13, 2009 3:56am, PenT pen...@gmail.com wrote: Thanks to Yeti, tml and Pfeiffer, I finally realized what happend to the GSList. May be I'm spoiled by Python, Java that I had the strange SHOULD-BE-NULL thought, now I know if I need to reuse the GSList* variable, the first thing is to assign NULL to it after g_slist_free (), also surprised g_slist_length() didn't gave a segmentation fault to me, aha. ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list ** ** ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Re: Why there's still ONE element left after g_slist_free () ?
You should quote the object of the comment ENTIRELY before commenting, shouldn't you? The actual comment by PenT does state as much: to assign NULL to it after g_slist_free ()... AFTER g_slist_free. I don't see that I was mutually exclusive in my reply. On May 14, 2009 11:51am, Chris Moller mol...@mollerware.com wrote: american.communist.pa...@gmail.com wrote: Its old hat to C programmers that you set any object to NULL when you're done with it, which returns the memory used to the heap. That's specifically /not/ true in C: You have to explicitly free allocated space--setting a pointer to null doesn't automatically do the freeing and, in fact, can simply lose the pointer making it impossible to subsequently free the space. Sometimes it's useful to set the pointer to null /after/ you free the space just as a flag to yourself that you've freed it. That's not necessary with languages that have garbage collection like Java, Python, etc. On May 13, 2009 3:56am, PenT pen...@gmail.com wrote: Thanks to Yeti, tml and Pfeiffer, I finally realized what happend to the GSList. May be I'm spoiled by Python, Java that I had the strange SHOULD-BE-NULL thought, now I know if I need to reuse the GSList* variable, the first thing is to assign NULL to it after g_slist_free (), also surprised g_slist_length() didn't gave a segmentation fault to me, aha. ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list ** ** ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Why there's still ONE element left after g_slist_free () ?
On Thu, 14 May 2009 20:27:18 + american.communist.pa...@gmail.com wrote: You should quote the object of the comment ENTIRELY before commenting, shouldn't you? Nobody misquoted you, nor did they strip any of your comment out. And nobody was objecting to your comment as a result of lack of context. The actual comment by PenT does state as much: to assign NULL to it after g_slist_free ()... Yes, that's true, PenT did state the right thing. AFTER g_slist_free. I don't see that I was mutually exclusive in my reply. Well how about this: On May 14, 2009 11:51am, Chris Moller mol...@mollerware.com wrote: american.communist.pa...@gmail.com wrote: Its old hat to C programmers that you set any object to NULL when you're done with it, which returns the memory used to the heap. Now note that the when you're done with it is merely a contextual clause and can therefore be eliminated from the sentence without significantly changing its meaning (simple English grammar 101). Therefore what you wrote was a statement that setting any object to NULL returns the memory to the heap. This is explicitly wrong. Your sentence should have read: It's old hat to C programmers that you set any pointer to NULL when you're done with it and have returned the memory used by the object it referenced to the heap. Though even that isn't strictly correct since the pointer may not reference a heap object, so you should have written: It's old hat to C programmers that you set any pointer to NULL when you're done with it; especially if you have deleted the object it referenced and returned the memory used to the heap. Sorry for the English lesson, but there are enough people reading this who don't _know_ what you must have meant that it really _does_ matter when you actually _say_ something quite different. HTH Rob ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: something like system function
Hi frederico, I suggest you should read about system calls available in C. Visit http://publib.boulder.ibm.com/iseries/v5r2/ic2928/index.htm?info/apis/getcwd.htmfor getting current working directory (pwd). Also visit http://www.softpanorama.org/Internals/unix_system_calls.shtml for the rest of calls. Regards. Chandra Shekhar. On Thu, May 14, 2009 at 9:17 PM, frederico schardong frede@gmail.comwrote: Hi, I need something like function system of stdlib.h, but I need to get the output of the command... example: gchar *returned; returned = system(pwd); and returned must be the folder of the program... Gtk, or glib have something like that? -- Abraço, Frederico Schardong, SOLIS - O lado livre da tecnologia www.solis.coop.br ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list ___ gtk-list mailing list gtk-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Is there anyone out there?
Cowley Harris wrote: I'm just pointing out that the sourceforge site has a ghost-town feel to it. And as it turns up first on a google search, it could be off-putting to people who may be migrating from Perl-Tk who are evaluating the alternatives. I think as I have new eyes I'm going to see the stuff you may be oblivious too. I'm just an occasional user and initially I had many of the same reactions you did. But the group has been very helpful and now I've climbed at least part way up the learning curve. Now you're subscribed to the list you'll soon see the effort that is put into maintenance and enhancements. As well as the gtk-perl documentation, you will need to become familiar with the C documentation, because a lot of the perl docs don't repeat info that is already in the C docs. Start with the doc links at http://www.gtk.org/. Also very helpful is the Python documentation, e.g. http://www.pygtk.org/pygtk2tutorial/ which is more extensive and generally fairly easy to understand in a perl context. I'm also offering to help out with the documentation as per the Intro. If there are broken links on the sourceforge site, I'm sure patches would be welcome, or any other improvements you can suggest. Cheers, Dave ___ gtk-perl-list mailing list gtk-perl-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Re: Is there anyone out there?
Cowley Harris wrote: 1) Is this project still going? Doesn't seem to be much (any) emails coming through on the mailing list. That strikes me as a rather odd observation. A quick look at the mailing list archives ( http://mail.gnome.org/archives/gtk-perl-list/ ) shows a steady stream of messages every month. When I tried to review the archives I got a 404 error. I used the link from the Documents page, not the one on the FAQs page. Oh, dear --- looks like markmail changed the link format. http://perl.markmail.org/search/#query:list%3Aorg.gnome.gtk-perl-list is what you want, i'll get that updated when i get home this evening. Thanks for pointing that out. I understand that that it is volunteer based project and in a stable state, but I've just recently invested a lot of time learning what turned out to be a dead project and would rather not do the same again. At the same time I wanted to start learning the API and migrating to Gtk2 as soon as possible. I think a difference between Tk and Gtk2 is that Gtk2 is based on a modern and active upstream, while Tk is long stable and, well, kinda ugly by comparison. For some examples, there doesn't seem to be any recent tutorials (latest I found with a date was 2006). The main English version for Gtk2-perl is half completed and is still in alpha. The search the list archives link 404s on me. (The one on the documentation page, not the one I just found on the FAQ page). On the main page, the most recent news leads to svn, while at svn.gnome.org you have the message All content on this site is obsolete. You have to admit, the gnome project's switch to git is practically on the heels of their switch to subversion. It took us an embarrassingly long time to get away from sourceforge cvs. I'm just pointing out that the sourceforge site has a ghost-town feel to it. And as it turns up first on a google search, it could be off-putting to people who may be migrating from Perl-Tk who are evaluating the alternatives. I think as I have new eyes I'm going to see the stuff you may be oblivious too. I think you're right, honestly. We should knock down the cobwebs. Please report any broken links here. I'm also offering to help out with the documentation as per the Intro. Excellent. Patches here. Start anywhere you like. -- muppet scott at asofyet dot org ___ gtk-perl-list mailing list gtk-perl-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Re: Can't install on OSX Tiger
On Wed, May 13, 2009 at 1:10 AM, Brian Manning elspicyj...@gmail.com wrote: On Tue, May 12, 2009 at 8:08 PM, Brian McKee brian.mc...@gmail.com wrote: I would like to install gtk2 on Tiger, but when I do so thru CPAN it fails the vast majority of the tests. The link you posted in your previous e-mail recommends Imendio over using MacPorts. Which way are you trying to do it, via MacPorts or Imendio? How are you fitting Gtk2-Perl from CPAN into all of this? Thanks for your reply. I chose the Imendio package because I wanted a 'native' app rather than using X11 As I understood it that Imendio package got me Gtk2, but not the Perl bindings to it. I was trying to use CPAN to get those Perl bits. Here's all the output - all the steps previous to this worked fine. http://pastebin.com/m21548cdc Forcing the install didn't seem like the right answer to me. All comments appreicated, Brian ___ gtk-perl-list mailing list gtk-perl-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Re: Is there anyone out there?
On May 14, 2009, at 5:49 PM, muppet wrote: Cowley Harris wrote: When I tried to review the archives I got a 404 error. I used the link from the Documents page, not the one on the FAQs page. Oh, dear --- looks like markmail changed the link format. Stranger -- it looks like the file somehow got corrupted, with the ht in http for that link changing to some strange non-ascii junk. At any rate, it's fixed, now. -- The Master in the art of living makes little distinction between his work and his play, his labor and his leisure, his mind and his body, his education and his recreation, his love and his religion. He hardly knows which is which. He simply pursues his vision of excellence in whatever he does, leaving others to decide whether he is working or playing. To him he is always doing both. -- Zen Philosophy ___ gtk-perl-list mailing list gtk-perl-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Re: Function to return Gtk2::Table
can you please provide your sscce.glade file? On Fri, May 15, 2009 at 02:42:52PM +1000, Peter E Dennis wrote: Hi All, I am trying to create a function that when a button is clicked it will create a table of widgets laid out in 2 rows x 9 columns and add it to a vbox. At the moment I am trying to do the following: #!/usr/bin/perl use Gtk2 -init; use Gtk2::GladeXML; # Read in glade file with gui $gladexml = Gtk2::GladeXML-new('sscce.glade'); # Get main window vbox $vbox1 = $gladexml-get_widget('vbox1'); # Get vbox to hold created tables $vbox2 = $gladexml-get_widget('vbox2'); # Create a table of widgets $table = ret_table(); # Show the widgets? $vbox2-pack_start_defaults($table); #get undefined error here... $vbox2-show_all; $vbox1-pack_start_defaults($vbox2); $vbox1-show_all; # Get main window from widget tree. $main_window = $gladexml-get_widget('window1'); # Quit when user clicks on the close button/alt-f4 etc. $main_window-signal_connect (destroy = sub { Gtk2-main_quit; }); # Maximise window $main_window-maximize; # Run main loop. Gtk2-main; sub ret_table { my $table = Gtk2::Table-new(2,9,FALSE); # Title Row my $lbl_num = Gtk2::Label-new(Num); my $lbl_time = Gtk2::Label-new(Time/Session); my $lbl_objectives = Gtk2::Label-new(Objectives/Learning Outcomes); my $lbl_tasks = Gtk2::Label-new(Activities/Tasks/Content); my $lbl_resources = Gtk2::Label-new(Resources); my $tcol_sep1 = Gtk2::VSeparator-new; my $tcol_sep2 = Gtk2::VSeparator-new; my $tcol_sep3 = Gtk2::VSeparator-new; my $tcol_sep4 = Gtk2::VSeparator-new; # Entry Row my $chk_num = Gtk2::CheckButton-new(1.); my $e_time = Gtk2::Entry-new; my $txtv_objectives = Gtk2::TextView-new; my $txtv_tasks = Gtk2::TextView-new; my $txtv_resources = Gtk2::TextView-new; my $rcol_sep1 = Gtk2::VSeparator-new; my $rcol_sep2 = Gtk2::VSeparator-new; my $rcol_sep3 = Gtk2::VSeparator-new; my $rcol_sep4 = Gtk2::VSeparator-new; # Layout title row $table-attach_defaults($lbl_num, 0, 1, 0, 1); $table-attach_defaults($tcol_sep1, 1, 2, 0, 1); $table-attach_defaults($lbl_time, 2, 3, 0, 1); $table-attach_defaults($tcol_sep2, 3, 4, 0, 1); $table-attach_defaults($lbl_objectives, 4, 5, 0, 1); $table-attach_defaults($tcol_sep3, 5, 6, 0, 1); $table-attach_defaults($lbl_tasks, 6, 7, 0, 1); $table-attach_defaults($tcol_sep4, 7, 8, 0, 1); $table-attach_defaults($lbl_resources, 8, 9, 0, 1); # Layout entry row $table-attach_defaults($chk_num, 0, 1, 0, 1); $table-attach_defaults($rcol_sep1, 1, 2, 0, 1); $table-attach_defaults($e_time, 2, 3, 0, 1); $table-attach_defaults($rcol_sep2, 3, 4, 0, 1); $table-attach_defaults($txtv_objectives, 4, 5, 0, 1); $table-attach_defaults($rcol_sep3, 5, 6, 0, 1); $table-attach_defaults($txtv_tasks, 6, 7, 0, 1); $table-attach_defaults($rcol_sep4, 7, 8, 0, 1); $table-attach_defaults($txtv_resources, 8, 9, 0, 1); return $table; } However at the moment I get the following error: Can't call method pack_start_defaults on an undefined value at ./main.pl line 18. This is the line: $vbox2-pack_start_defaults($table); # get undefined error here. Is the table not being defined or is it the vbox? Am I going the right way about this? Many thanks, Peter. ___ gtk-perl-list mailing list gtk-perl-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-perl-list -- _ Ryan Niebur ryanrya...@gmail.com signature.asc Description: Digital signature ___ gtk-perl-list mailing list gtk-perl-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Re: Function to return Gtk2::Table
can you please provide your sscce.glade file? Sure it is attached to this email. Sorry wasn't sure if the list accepted attachments or not. sscce.glade Description: application/glade ___ gtk-perl-list mailing list gtk-perl-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-perl-list