473,498 Members | 1,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GladeGen and initializing widgets at startup

Hi all,

Being struck by article 7421 of the linux journal
(http://www.linuxjournal.com/article/7421), I'll tried to give it a go.
Mainly because I have done some experiments with Glade and found that
it is really easy to create good looking GUIs. On the other end, there
is the GladeGen tool which helps you in building a skeleton in Python
such that you only have to code the events. But being a newbie with
Python as well as Glade I'm heavily dependent on documentation (mainly
online a big part being usenet). There I found that almost nobody
seems to use it, or they don't have any problems with it. In this group
there is only thread that has a reference to it!

So my questions:

Does anybody use GladeGen? If not, why?

For those that do use it, where do I write the code which has to be
executed when a window loads? The thing is pretty basic here. I have a
window with a treeview, and I simply want that treeview filled up when
opening the window.

Hoping for some echos...

Aengys

May 6 '06 #1
3 1853

On May 6, 2006, at 4:39 PM, Aengys wrote:
Hi all,

Being struck by article 7421 of the linux journal
(http://www.linuxjournal.com/article/7421), I'll tried to give it a
go.
Mainly because I have done some experiments with Glade and found that
it is really easy to create good looking GUIs. On the other end, there
is the GladeGen tool which helps you in building a skeleton in Python
such that you only have to code the events. But being a newbie with
Python as well as Glade I'm heavily dependent on documentation (mainly
online a big part being usenet). There I found that almost nobody
seems to use it, or they don't have any problems with it. In this
group
there is only thread that has a reference to it!

So my questions:

Does anybody use GladeGen? If not, why?

For those that do use it, where do I write the code which has to be
executed when a window loads? The thing is pretty basic here. I
have a
window with a treeview, and I simply want that treeview filled up when
opening the window.

Hoping for some echos...

Aengys

I'm the author of it - I got a number (20-30 I think) of responses
from people using it and a few quick questions. I emailed the gnome-
python maintainer to see if they were interested in including it or
taking it over, but never heard back. If anyone wants to take it over
and extend it, you're welcome to. I believe Linux Journal maintained
copyright ownership for a few months after the publication but then
it reverts back to the author so I'll happily release it under the
GPL for anyone to extend. To answer your question, you can put your
code in the init method after the call to: GladeWindow.__init__ or
you can override the GladeWindow's show method in your class if you
want it to be called every time the window is shown. I often wrote a
method named "populate" to file in data in widgets and then called it
from the show method.

Dave

May 6 '06 #2
Thank you for your reply!

I finally managed to do what I wanted. Maybe a little side-remark here.
In the article you have said that all changes to the init-method are
lost once you regenerate the file. I have tried it, and indeed all my
changes were lost (which I had backed up before). So I've created a
method which do the initialization and I call this method from the
init-method. Maybe it would be a nice extention to include such a
method by default; a method you can fill with all the code that needs
to be done when initializing the window.... I'm not yet so familiar
with the whole process, but I might have a look at it in the future.
I'll keep you updated on that if it happens.

Regarding the extension of the show method: how do I do that? And what
benefit does it have to the solution mentioned above?

Aengys

May 7 '06 #3

On May 7, 2006, at 4:24 AM, Aengys wrote:
Thank you for your reply!

I finally managed to do what I wanted. Maybe a little side-remark
here.
In the article you have said that all changes to the init-method are
lost once you regenerate the file. I have tried it, and indeed all my
changes were lost (which I had backed up before). So I've created a
method which do the initialization and I call this method from the
init-method. Maybe it would be a nice extention to include such a
method by default; a method you can fill with all the code that needs
to be done when initializing the window.... I'm not yet so familiar
with the whole process, but I might have a look at it in the future.
I'll keep you updated on that if it happens.

It's been a while since I've looked at it or used it (haven't been
doing an GUI programming recently). I should have said to put your
code in the __init__ method after the call to init since the init
method is regenerated each time.

Regarding the extension of the show method: how do I do that? And what
benefit does it have to the solution mentioned above?

You mentioned you were new to Python - you really need to learn more
(specifically about inheritance) before you can fully understand
this. The GladeWindow provides a show method but you can write your
own show method that would get called instead of it. If you want the
code to just be called once, using the __init__ method is appropriate
but if your window is repeatedly shown/hidden and you want the code
executed each time the window is shown.

Dave

May 7 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2321
by: Dean | last post by:
Hi All, I was checking out the demos for tk 8.4.4.0 and noticed that alot of them (e.g. the scrollbar) have the XP style. I also noticed that when I use Python 2.3 and a seperately installed...
3
2260
by: bromden | last post by:
Are there any free Python database widgets which provide a link between a database and visual controls? (like those of org.netbeans.lib.sql and org.netbeans.lib.sql.models Java packages or...
2
2313
by: Adonis | last post by:
I am creating some widgets by inheriting from Tkinter.Frame and populating the frame with whatever the widget will be then creating certain attributes/methods to be accessed later. My question is,...
2
1720
by: William Gill | last post by:
I need to display a couple of labels and a checkbox from each entry in my database. Simple enough, but there are several hundred records, and I only want to display 5 or 10 at a time. Can this be...
2
2809
by: nholtz | last post by:
Is there any way to delete a widget (window) from a Text widget, and then add it back to the Text, without re-creating the original widget. For example, I think I would like to do something like...
0
1258
by: Rafal Janas | last post by:
Hi. I create simple program using glade and GladeGen. In main.py is main class and in wind.py is wind class. In main class is entry1 and button1. When I click on button1 I open wind class...
34
3339
by: newsposter0123 | last post by:
The code block below initialized a r/w variable (usually .bss) to the value of pi. One, of many, problem is any linked compilation unit may change the global variable. Adjusting // rodata const...
1
1840
by: Vangati | last post by:
Plusmo is Hiring! Plusmo's mission is to provide the ultimate mobile experience for users by bringing together advanced technologies and easy to use services for mobile phones. Plusmo's...
13
2304
by: WaterWalk | last post by:
Hello. When I consult the ISO C++ standard, I notice that in paragraph 3.6.2.1, the standard states: "Objects with static storage duration shall be zero-initialized before any other...
0
6998
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5460
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4586
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.