473,698 Members | 2,086 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

subclass dialog or put in the resource files?


I'm using wxPython and design the gui via wxglade. One of the gui
components is a simple dialog class that gets displayed when a user
exits the program.
I want to use the same dialog but with a different text for closing
certain dialogs in the program. (it's a pure "do you want to exit
<insert screen name>" dialog)

What would i better use, knowing the rest of the gui is in a resource
(xrc) file:

1. Find some way to put a standard exit dialog in the resource file and
then somehow try to set the message to the correct one.

2. Make a simple dialog class that accepts the message to be displayed.
I could even use glade to generate the python code for a start.

What would be the better/cleaner/logical way to do this?

Thanks,
Benedict
Jul 19 '05 #1
1 1651
flupke wrote:

I'm using wxPython and design the gui via wxglade. One of the gui
components is a simple dialog class that gets displayed when a user
exits the program.
I want to use the same dialog but with a different text for closing
certain dialogs in the program. (it's a pure "do you want to exit
<insert screen name>" dialog)

What would i better use, knowing the rest of the gui is in a resource
(xrc) file:

1. Find some way to put a standard exit dialog in the resource file and
then somehow try to set the message to the correct one.

2. Make a simple dialog class that accepts the message to be displayed.
I could even use glade to generate the python code for a start.

What would be the better/cleaner/logical way to do this?

Thanks,
Benedict


I found what i was looking for.
I first load the dialog from the resource files and then i change the
text like this:

children = self.d_exit.Get Children()
for control in children:
if ( type(control) is wx.StaticText ):
control.SetLabe l("<new message>")

Benedict
Jul 19 '05 #2

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

Similar topics

4
2799
by: lawrence | last post by:
I'm very unhappy with the error message that I'm giving in this method: /** * 11-23-03 - getter * * We want to run the query against a MySql database and get back a
2
1930
by: Kallis | last post by:
Hello, I have the following situation when trying to localize my software: I have BIG solution with about 80 projects. In one of the projects I have a number of dialogs (the dialog project :-) ). I have decided that I do not want to use the "form"-mechanism (using the property "localized=true") for localization since the strings I show are not that "constant" during the life time of the dialog. Thus, I have to put the resources in...
1
1470
by: Jay | last post by:
I am trying to edit a dialog created with msvc 6.0. If I select a control and look in the properties window, there are no properties shown. The drop-down list has 'Selected Object' multiple times (I guess once per control). Is there any way of changing properties using the dialog editor or should I be using a text editor?
1
995
by: M | last post by:
Trying to create a File Preview Dialog. Have created a resource template with GroupBox (ID = stc32). File Open is displayed fine. when I add an activeX control to the dialog, I am getting this error: "The Dialog Box could not be created" error How do I add an activeX (where my selected AVI/BMp files can be displayed) to the template. Thanks. M
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8895
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
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 we have to send another system
2
2330
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.