Skip to content

Commit

Permalink
accedd to window title bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor committed Jan 31, 2024
1 parent 547957c commit 27323ed
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/scripting/VRPySetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ PyMethodDef VRPyView::methods[] = {

PyMethodDef VRPyWindow::methods[] = {
{"getSize", PyWrap(Window, getSize, "Get window size (width, height) in pixel", Vec2i ) },
{"setTitle", PyWrap(Window, setTitle, "Set window title bar", void, string ) },
{"setIcon", PyWrap(Window, setIcon, "Set window icon", void, string ) },
{NULL} /* Sentinel */
};

Expand Down
11 changes: 11 additions & 0 deletions src/core/setup/windows/VRGlutEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,17 @@ VRGlutEditor::~VRGlutEditor() {
VRGlutEditorPtr VRGlutEditor::ptr() { return static_pointer_cast<VRGlutEditor>( shared_from_this() ); }
VRGlutEditorPtr VRGlutEditor::create() { return VRGlutEditorPtr(new VRGlutEditor() ); }

void VRGlutEditor::setTitle(string title) {
int w = glutGetWindow();
glutSetWindow(topWin);
glutSetWindowTitle(title.c_str());
glutSetWindow(w);
}

void VRGlutEditor::setIcon(string iconpath) {
;
}

int VRGlutEditor::getCurrentWinID() { return glutGetWindow(); }
void VRGlutEditor::setCurrentWinID(int i) { glutSetWindow(i); }

Expand Down
3 changes: 3 additions & 0 deletions src/core/setup/windows/VRGlutEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ class VRGlutEditor: public VRWindow {
int getCurrentWinID();
void setCurrentWinID(int i);

void setTitle(string title) override;
void setIcon(string iconpath) override;

void onMain_Keyboard_special(int k);

void openPopupWindow(string name, int width, int height);
Expand Down
3 changes: 3 additions & 0 deletions src/core/setup/windows/VRWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ class VRWindow : public std::enable_shared_from_this<VRWindow>, public VRName {
void setMSAA(string s);
string getMSAA();

virtual void setTitle(string title) {};
virtual void setIcon(string iconpath) {};

virtual void sync(bool fromThread = false);
virtual void render(bool fromThread = false);
virtual void clear(Color3f c);
Expand Down

0 comments on commit 27323ed

Please sign in to comment.