473,387 Members | 1,897 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Invoking dialog box on file selection

Hey Guys.
This is kind of a mixed question involving the os platform, python and wxpython. I hope this is in the right place, if not then a quick link to somewhere suitable would be great.

Ok basicly i have a dialog box that is acting as the GUI for an image program i'm running. The program is a front end support app for raw image files.
Does anyone know how to invoke the dialog box if the user of the os clicks and tries to open a file of a certain file type?
For example what i want is that the user can either start the dialog box first and then open the file using the open command in my dialog box. Or when navigating through windows explorer (or similar) when the selected file is opened the first box to appear is my dialog box.
Cheers.
Ed
(newbie - only been learning this for a month)
Jul 18 '07 #1
5 2828
bartonc
6,596 Expert 4TB
Hey Guys.
This is kind of a mixed question involving the os platform, python and wxpython. I hope this is in the right place, if not then a quick link to somewhere suitable would be great.

Ok basicly i have a dialog box that is acting as the GUI for an image program i'm running. The program is a front end support app for raw image files.
Does anyone know how to invoke the dialog box if the user of the os clicks and tries to open a file of a certain file type?
For example what i want is that the user can either start the dialog box first and then open the file using the open command in my dialog box. Or when navigating through windows explorer (or similar) when the selected file is opened the first box to appear is my dialog box.
Cheers.
Ed
(newbie - only been learning this for a month)
Hi eddiefisher41. You've come to the right place.
For the first part (getting a file name for a File Dialog), I can provide complete code if you need it (it's actually a code template in Boa Constructor).

For the second part, I can tell you that on Windows you really need to crunch all your scripts and dependencies into a .exe and associate the given file type to your Windows program. But, (I need to try this, myself) it may be possible to just associate the file type with your main script that creates the wxPython app and look at the argv (variable length argument list) that Windows sends it.
Jul 18 '07 #2
Hiya.
Cheers. Yeah ive already sorted out the code to open the file once the dialog box is running, just using the openfile dialog box class.
Yeah thought it may need to wait till right at the end before i can accociate it with the .raw file type.
Thanks.
Ed
Jul 18 '07 #3
Hey Guys.
Right i am coming close to the end of my project and am starting to think about how to invoke my dialog box once a .raw file is selected.
What i am trying to do at the moment is create a small test bench that will open the file and present the filepath to my dialog. The test bench then invokes my dialog
What i am missing is how to pass the filepath into the dialog box. I know how to inport variables into modules that are run from another program, (that is basicly what i'm doing) but when i import the dialog it is called straight away. It seems to go stright into the dialog box's main event loop before i get chance to call it.

How do i get my dialog to look at the test bench and read the value of the filepath?
In terms of the finished solution after i have accociated the dialog with the .raw extension how do i go about passing the filepath from the os into the dialog?

Thanks for your help over the last few months. I'm nearing the end of my project now but will most likely be coding python etc when i come back for my main degree placement.
Cheers.
Ed
Aug 8 '07 #4
bartonc
6,596 Expert 4TB
Hey Guys.
Right i am coming close to the end of my project and am starting to think about how to invoke my dialog box once a .raw file is selected.
What i am trying to do at the moment is create a small test bench that will open the file and present the filepath to my dialog. The test bench then invokes my dialog
What i am missing is how to pass the filepath into the dialog box. I know how to inport variables into modules that are run from another program, (that is basicly what i'm doing) but when i import the dialog it is called straight away. It seems to go stright into the dialog box's main event loop before i get chance to call it.

How do i get my dialog to look at the test bench and read the value of the filepath?
In terms of the finished solution after i have accociated the dialog with the .raw extension how do i go about passing the filepath from the os into the dialog?

Thanks for your help over the last few months. I'm nearing the end of my project now but will most likely be coding python etc when i come back for my main degree placement.
Cheers.
Ed
Hi Ed.

All of the file selection mechanisms that I found, including wxFileSelector, wxFileDialog, and wxFilePickerCtrl, take path, filename, extension and wildcard charaters in their creation methods. If you need a link to the documentation, I can provide that.
Aug 8 '07 #5
Cheers.
Got it sorted now.
Vertually finished my 3 month project, just writing the final report now. In terms of my dialog box i just need to sort out user input verification and thats it.
Quite nicely it absolutly nails every test image i pass it with at most 5 pixels error in a 2Mp image, pretty sweet!!!
Thanks for all of your help on this forum over the past 3 months.
I go back to uni for a year coming in september but come back to work with my industrial placement firm next summer to write my thesis and do an 8 month research project. I expect i'll be using these forums again then as i'll be doing a mixture of hardware and software design, hopefully noise reduction or colour management projects.
Having said that there are a few apps that i want to create to help with day to day life on my hope PC that i may do at some point.
Cheers Guys.
Ed
Aug 10 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: S.W. Rasmussen | last post by:
With the risk of being accused of multi-posting I would like to draw the attention to a serious visual basic/windows issue discussed in the microsoft.public.vb.bugs newsgroup. As pointed out below...
5
by: Fred | last post by:
Hi, I'd like to turn a command-line script into a Windows GUI app using the native widgets so as to reduce the size of the binary (ie. no QT, wxWidgets, et al.) I came up with the following...
3
by: bbxrider | last post by:
running win2k adv server/ iis5.0 trying to setup on my web page where browsers can download a file, an .xls so been trying to figure out with a download 'link' what invokes the standard ms file...
3
by: JoNaS | last post by:
As a lot of us might now, the input file (aka browse button) in html does not allow for multiple file selection or for filtering file types. The File Open dialog used in WinForms allow these things...
1
by: Michael Yanowitz | last post by:
Hello: Below I have included a stripped down version of the GUI I am working on. It contains 2 dialog boxes - one main and one settings. It has the following problems, probably all related, that...
13
by: marathoner | last post by:
How do we invoke the file selection dialog? I would like to do this in C# in ASP.net. I would like to open a file for reading. Marathoner
1
by: =?Utf-8?B?VGVlcmF2ZWU=?= | last post by:
I try to invoke Connection Properties dialog box that Visual Studio 2005 use. The dialog that I said is used in many places such as when developers build connection string in Settings.setting file...
8
by: Janwillem | last post by:
Is there a way to force the wx.FileDialog to show as default the thumbnails vie in stead of list view? thanks, janwillem
6
by: Iain King | last post by:
Hi. I have a modal dialog whcih has a "Browse..." button which pops up a file selector. This all works fine, but the first thing the user has to do when they open the dialog is select a file, so...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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,...
0
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...

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.