Author Topic: Passing arguments to frames and dialogs  (Read 4184 times)

JaxKovak

  • Guest
Passing arguments to frames and dialogs
« on: April 09, 2009, 11:17:22 am »
Hi there, I'm very new to CB although I have done some programming with Python before.

I have started a little test program, kind of like my own version of "Hello world", and I have a standard frame open. It contains a list box. Clicking a button opens a second window, this time a dialog, and while working on that dialog I need to update the contents of the list on the main frame. However, I cant seem to find a way to pass any kind of arguments to the dialog that will allow it to access the list on the main frame.

Can anyone give me any idea what I need to do please.

regards

Jax

Offline dje

  • Lives here!
  • ****
  • Posts: 682
Re: Passing arguments to frames and dialogs
« Reply #1 on: April 09, 2009, 11:36:39 am »
Hi,

I think you're not on the good forum (dedicated to C::B).
You should target a beginner C++ programming forum or your UI toolkit forum.

Dje

JaxKovak

  • Guest
Re: Passing arguments to frames and dialogs
« Reply #2 on: April 09, 2009, 03:39:16 pm »
Yes. Iv been down this road already. Unfortunately all of the tutorials and information I have found seem to be aimed at the absolute beginner in programming or someone fairly advanced in C++ already. There are no intermediate tutorials that I can find.

I don't want or need to know how to write command line applications, I'm not even slightly interested. I simply want to write little programs for myself, hence my recent use of Python with wxWidgets (I have been successful enough to write my own Python editor). My move towards C++ has been one purely out of interest, but whichever way I turn I seem to be required to write command line applications first (I cant even think of one that I would want to write), or to spend days or possibly weeks reading up on information that I will use once or possibly never (outside of the tutorial at least).

The reason I asked here was simply because I have already been quite successful using a plain text editor and the console, but I am now trying various GUI's and C::B is one of them. I thought perhaps there would be advice on C++ rather than just C::B in general.

No worries, thanks for your time - it looks like Ill just go back to gedit.

regards

Jax


Offline rcoll

  • Almost regular
  • **
  • Posts: 150
Re: Passing arguments to frames and dialogs
« Reply #3 on: April 09, 2009, 06:46:08 pm »
If you are using the standard "ShowModal()" function to display your dialog, then you cannot pass arguments to it that way.  However, you can pass the pointer to the wxListBox to (for example) a setup function that you write, and in your dialog definition save the pointer.  Then, when you call ShowModal(), you will have a copy of the listbox pointer that you can work with.   Is this what you are looking for?

Ringo

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Passing arguments to frames and dialogs
« Reply #4 on: April 09, 2009, 09:25:17 pm »
We have left the scope of our forum (dedicated to C::B) by far.

So this topic gets locked !