How to render an openGL frame in C++ builder?

easy, just use TForm::Handle as window handle … Here some ancient example of mine in BCB5 ported to BDS2006: //————————————————————————— #include <vcl.h> #pragma hdrstop #include “Unit1.h” #include <gl/gl.h> #include <gl/glu.h> //————————————————————————— #pragma package(smart_init) #pragma resource “*.dfm” TForm1 *Form1; //————————————————————————— int TForm1::ogl_init() { if (ogl_inicialized) return 1; hdc = GetDC(Form1->Handle); // get device context PIXELFORMATDESCRIPTOR pfd; … Read more

the images are not loading

I’m sorry to say this, but there are simply so many things wrong with your code… Lets start with: DON’T override any of the paint methods of a top level container. To start with, none of the top level containers are double buffered. Use light weight components instead of heavy weight components (use JFrame instead … Read more

Html code as IFRAME source rather than a URL

You can do this with a data URL. This includes the entire document in a single string of HTML. For example, the following HTML: <html><body>foo</body></html> can be encoded as this: data:text/html;charset=utf-8,%3Chtml%3E%3Cbody%3Efoo%3C/body%3E%3C/html%3E and then set as the src attribute of the iframe. Example. Edit: The other alternative is to do this with Javascript. This is almost … Read more

Adjust UILabel height to text

I’ve just put this in a playground and it works for me. Updated for Swift 4.0 import UIKit func heightForView(text:String, font:UIFont, width:CGFloat) -> CGFloat{ let label:UILabel = UILabel(frame: CGRectMake(0, 0, width, CGFloat.greatestFiniteMagnitude)) label.numberOfLines = 0 label.lineBreakMode = NSLineBreakMode.byWordWrapping label.font = font label.text = text label.sizeToFit() return label.frame.height } let font = UIFont(name: “Helvetica”, size: 20.0) … Read more

Tkinter scrollbar for frame

Here’s example code adapted from the VerticalScrolledFrame page on the now defunct Tkinter Wiki that’s been modified to run on Python 2.7 and 3+. try: # Python 2 import tkinter as tk import tkinter.ttk as ttk from tkinter.constants import * except ImportError: # Python 2 import Tkinter as tk import ttk from tkinter.constants import * … Read more