473,434 Members | 1,405 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,434 software developers and data experts.

C++/wxWidgets Help accessing item

83
Hi, Im basicly stuck trying to access a member, which controls a text box.

What I want to do is set a value for it, outside its class.


This code works in fine.
void ClientFrame::OnAbout(...){
wxTextCtrlBase *Status = ClientFrame::Status;
Status->SetValue(text);
}
What I want to do is access ClientFrame::Status, from int main().
I have tried this:

Expand|Select|Wrap|Line Numbers
  1. void ClientFrame::ChangeStatus(wxString text){
  2.         wxTextCtrlBase *Status = Status;
  3.         Status->SetValue(text);
  4. }
  5. int main(){
  6.     ClientFrame.ChangeStatus(_("Attempting to connect to server "));
  7. .
  8. .
  9. .
  10. }
This may seem simple in some casses, but I cant get my head round it!
error: expected unqualified-id before '.' token.


Sorry if my explanation is poor.
Sep 3 '08 #1
4 1568
weaknessforcats
9,208 Expert Mod 8TB
Is ClientFrame::Status a public member of ClientFrame?

If not, the access is restricted to ClientFrame members.
Sep 3 '08 #2
Adam01
83
Sorry for the late responce, but it seems I declared the prototype not in ClientFrame, but here instead:
Expand|Select|Wrap|Line Numbers
  1. class ClientFrame: public wxFrame
  2. {
  3.     public:
  4.  
  5.         void ChangeStatus(wxString text);
  6. .
  7. .
  8. .
And I cant find the declaration of ClientFrame, so is there another way to access a function like this:

Expand|Select|Wrap|Line Numbers
  1.         wxTextCtrlBase *Status = Status;
  2.         Status->SetValue(text);
Status is private in ClientFrame, and I need to access SetValue somehow.


This function would work because it is in Clientframe class, which I cant seem to find, at all.
Expand|Select|Wrap|Line Numbers
  1. void ClientFrame::OnAbout(wxCommandEvent& event)
  2. {
  3. wxTextCtrlBase *Status = Status;
  4.         Status->SetValue(text);
  5. }
Any suggestions?
Sep 4 '08 #3
Adam01
83
Ok, nevermind that, what I want to do in wxWidgets is to create a main() function, to run for loops.

Im trying to convert a console program into a GUI, and failing.
Sep 4 '08 #4
Adam01
83
Can something tell me a way to have a main-like loop in wxWidgets?
Sep 5 '08 #5

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

Similar topics

10
by: Nomen Nescio | last post by:
PLEASE USE WXWIDGETS Please use wxWidgets, the multiplatform C++ class library. It's free, open-source and non-commercial. It's modelled after MFC but it produces code which can be compiled...
2
by: damonf | last post by:
I'm currently trying to add an ASP hyperlink to a template column in a datagrid. The normal hyperlink column doesn't give me the ability to add attributes to the item. In my grid there are four...
2
by: redmond | last post by:
I am implementing pagination using a repeater bound to an ArrayList. The ArrayList has Prev, 1, 2, 3.. Next values. <itemTemplate> <asp:LinkButton id="lnkPages" value=<%(Dictionary.key)%>...
0
by: N. Demos | last post by:
Hello, I'm having problems accessing a complex XML child node (latitude & longitude), and passing it to a function when the XML file has been read into a DataSet. Specifically, the returned object...
5
by: py | last post by:
i need to design a GUI for my python app. i heard of wxWidgets and was going to look into that, but then I saw wxPython. Why would I use wxPython over wxWidgets? thanks
1
by: sc | last post by:
I'm hoping to hear from anyone who has had extensive experience with writing cross-platform GUI apps using wxWidgets? I'm particularly interested in "advanced" features such as Outlook or Google...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
1
by: Marcin Kalicinski | last post by:
I have an application written in C++ that uses wxWidgets for GUI. I use embedded Python for scripting inside of this application. I want to use wxPython to add GUI to my scripts - because my C++...
1
by: Vinodsrvk | last post by:
I am accessing a string from the previous page's hidden text. While I am reading the string the only last character of the string is getting truncated. When I tried viewing the string in the previous...
0
by: priyamtheone | last post by:
Hi everyone, I'm working with VB.Net 2005(.Net framework 2.0). I am having a problem in accessing the items in a menustrip of a form. Suppose there is an item in a menustrip named FILE. Under the...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
1
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
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
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...
0
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...

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.