Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7041603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:03:57+00:00 2026-05-28T02:03:57+00:00

MainWindow::MainWindow(int w, int h, const string& c) : Fl_Window(w, h, c.c_str()) // Don’t call

  • 0
MainWindow::MainWindow(int w, int h, const string& c)
: Fl_Window(w, h, c.c_str()) // Don't call constructor over here
{
    script.load_file(WIN_CONFIG_SCRIPT);

    int width = script.get_global_int("width");
    int height = script.get_global_int("height");

    const char* caption = script.get_global_string("caption").c_str();

    /** CALL CONSTRUCTOR NOW **/

    //NOTE: I don't know a way to change an FLTK Fl_Window's Caption after 
    //initialising it.

    Toolbar* toolbar = new Toolbar(0, 0, this->w(),30);
    toolbar->add_button("Hello");
    toolbar->add_button("World!");

    end();
}

How do I initialize the base class inside the constructor? Alternatively, how do I change an FLTK Fl_Window’s caption after initialising it? Is there any other way out of this mess?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:03:58+00:00Added an answer on May 28, 2026 at 2:03 am

    How do I initialize the base class inside the constructor?

    You may not.

    The base part of the instance must be initialised before the derived part of the instance or any of its members.


    How do I change an FLTK Fl_Window’s caption after initialising it?

    The documentation says you can call:

    label("my caption")
    

    What’s wrong with that?


    Any other way out of this mess?

    No.


    Also, you should upgrade to FLTK 2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have q method that shown at below: void MainWindow::slotResults( const QList<QSqlRecord>& records )
Here's my XAML code: <Window x:Class=CarFinder.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=Search for cars in TuMomo Height=480
I have this int MainWindow::messageBox( QString button, QMessageBox::ButtonRole buttons, QString info, QMessageBox::Icon icon )
I have a weird problem I don't understand. I am copying over some C
void MainWindow::addRadioToUI() { int button_cunter=4; while(!database.isEmpty()) { button_cunter++; QPushButton *one = new QPushButton(Play: +name(get_r.getTrackId()));
public MainWindow() { CommandManager.AddExecutedHandler(this, ExecuteHandler); } void ExecuteHandler(object sender, ExecutedRoutedEventArgs e) { } Error
I have a KMainWindow: //file.h class MainWindow: public KMainWindow { public: MainWindow(QWidget *parent =
I am using a QStackedWidget on my mainWindow. The firstPageWidget on stackedWidget contains 3
I have a view that is loaded in the MainWindow.xib. It is just a
Is it possible to translate a point relative to MainWindow to be relative to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.